diff --git a/.yalc/@ensdomains/ensjs/LICENSE b/.yalc/@ensdomains/ensjs/LICENSE new file mode 100644 index 000000000..a0d0f720d --- /dev/null +++ b/.yalc/@ensdomains/ensjs/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 ENS Labs Limited + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/.yalc/@ensdomains/ensjs/README.md b/.yalc/@ensdomains/ensjs/README.md new file mode 100644 index 000000000..00e44a964 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/README.md @@ -0,0 +1,728 @@ +# ![ENSjs](https://user-images.githubusercontent.com/11844316/161689061-98ea01ee-b119-40ac-a512-5370eb8b4107.svg) + +The ultimate ENS javascript library, with [ethers.js](https://github.com/ethers-io/ethers.js) under the hood. + +## NOTE!!! + +ENSjs v3 is currently in the early development stage, meaning that the APIs are subject to change. +We also use undeployed contracts under the hood, so this **will not** work on any mainnet/testnet where the contracts are not deployed. + +Given the current development status, we're actively seeking feedback so feel free to create an issue or PR if you notice something! + +If you are looking for documentation for **version 2**, it an be found [here](https://github.com/ensdomains/ensjs#readme). + +## Features + +- Dynamically load **everything** +- Super fast response times (1 call for most RPC calls) +- Easy call batchability +- Written in TypeScript +- Supports the most cutting edge ENS features +- - More + +## Installation + +Install @ensdomains/ensjs, alongside [ethers](https://github.com/ethers-io/ethers.js). + +```sh +npm install @ensdomains/ensjs ethers +``` + +## Getting Started + +All that's needed to get started is an ethers provider instance. +Once you create a new ENS instance, you can pass it in using setProvider. + +```js +import { ENS } from '@ensdomains/ensjs' +import { ethers } from 'ethers' + +const provider = new ethers.providers.JsonRpcProvider(providerUrl) + +const ENSInstance = new ENS() +await ENSInstance.setProvider(provider) +``` + +**NOTE:** +If using ENSjs with Node, you may need to pass the `--experimental-specifier-resolution=node` flag. + +```sh +node --experimental-specifier-resolution=node ./index.js +``` + +## Batching Calls + +The batch function is a large part of this library, and there are plenty of situations where you might want to use it. +**Note that only functions with the `GeneratedRawFunction` type can be batched together.** + +```js +/* Batch functions can be called like so, with the function as the first item in an array, with the following items being the function's arguments */ +const batched = await ENSInstance.batch( + ENSInstance.getText.batch('test.eth', 'foo'), + ENSInstance.getAddr.batch('test.eth'), + ENSInstance.getOwner.batch('test.eth'), +) + +/* The response is formatted like so: + [ + response1, + response2, + response3, + ...etc, + ] +*/ +``` + +## Using Custom Graph Node URIs + +If you want to use your own graph-node URI, such as a local graph-node URI, you can pass it through when creating a new ENS instance. +Alternatively, if you don't want to use The Graph at all you can pass through `null`. + +```js +import { ENS } from '@ensdomains/ensjs' + +/* If you want to use a custom URI */ +const ENSInstance = new ENS({ + graphURI: 'http://localhost:8000/subgraphs/name/graphprotocol/ens', +}) + +/* If you want to disable The Graph queries */ +const ENSInstance = new ENS({ graphURI: null }) +``` + +## Single-use Providers + +If you want to use a specific provider to make a single call occasionally, you can easily do so. + +```js +import { ENS } from '@ensdomains/ensjs' + +const ENSInstance = new ENS() + +const callWithProvider = await ENSInstance.withProvider(otherProvider).getText( + 'test.eth', + 'foo', +) +``` + +## Profiles + +You can fetch almost all information about an ENS name (or address) using getProfile. +If an address is used as the first argument, it will fetch the primary name and give the same response as a name would. +It will automatically get all the records for a name, as well as get the resolver address for the name. +Specific records can also be used as an input, if you only want to get certain ones. If an address is used as an input alongside this, +you also save 1 RPC call. + +**NOTE:** +The profile function will always request an ETH addr record. +For names, this means the address will always at the top level of the returned object. +For addresses, this means the "match" property (a boolean value for matching reverse/forward resolution) will always be at the top level of the returned object. + +```js +/* Normal profile fetching */ +const profile = await ENSInstance.getProfile('test.eth') + +/* Profile fetching from an address */ +const profile = await ENSInstance.getProfile( + '0xeefB13C7D42eFCc655E528dA6d6F7bBcf9A2251d', +) + +/* Get all records of a specific type (or multiple) */ +const profile = await ENSInstance.getProfile('test.eth', { + texts: true, + coinTypes: true, + contentHash: true, +}) + +/* Get specific records */ +const profile = await ENSInstance.getProfile('test.eth', { + texts: ['foo'], + coinTypes: ['ETH'], +}) +``` + +Returns: + +```typescript +type RecordItem = { + key: string | number + type: 'addr' | 'text' | 'contentHash' + coin?: string + addr?: string + value?: string +} + +type ProfileReturn = { + address?: string // ONLY RETURNED AT TOP-LEVEL FOR NAME QUERIES + name?: string // ONLY RETURNED AT TOP-LEVEL FOR ADDRESS QUERIES + records: { + contentHash?: ContentHashObject | null + texts?: RecordItem[] + coinTypes?: RecordItem[] + } + resolverAddress: string +} +``` + +## Name History + +Getting the history for a name is very simple and can be done in two ways. +Not all data can be immediately fetched for the history of an ENS name, which is why there is multiple methods for doing so. +Text records do not contain the string value of the changed record, only the key. The value needs to be derived from fetching +the individual transaction hash. This can potentially be very slow if the name has a long history. + +```js +/* Normal Fetching, requires a second function for more details */ +const history = await ENSInstance.getHistory('test.eth') + +/* Details helper for history */ +/* You'll need to implement custom logic to get the index if you want to use that parameter, it's not currently done in the function */ +const detail = await ENSInstance.getHistoryDetailForTransactionHash( + transactionHash, + optionalIndex, +) + +/* Fetching with all details upfront */ +const historyWithDetail = await ENSInstance.getHistoryWithDetail('test.eth') +``` + +## Ownership Levels + +The `getOwner` function returns not only an owner (and potentially a registrant), but also a ownershipLevel value. +This value essentially means the contract for the "real owner" of any given name. In most cases it means the NFT contract +of the name, but if there is no NFT then it's just the registry. This value is useful for input into the `transferName` +function, where a contract needs to be specified. + +## Wrapping Names + +Wrapping names is very simple, you can wrap any name from the same function, with the exact contract to use being inferred. +You can specify both the fuses and resolver address to use with the wrapped name, but it's entirely optional. + +```js +/* wrap a .eth name */ +const tx = await ENSInstance.wrapName( + 'test.eth', // Name to wrap + '0xeefB13C7D42eFCc655E528dA6d6F7bBcf9A2251d', // New owner of wrapped name +) + +/* wrap any other name (e.g. a subname) */ +const tx = await ENSInstance.wrapName( + 'sub.test.eth', + '0xeefB13C7D42eFCc655E528dA6d6F7bBcf9A2251d', +) +``` + +## Write Transaction Options + +Currently, some write functions have an `options` argument. While this may expand over time, +it currently just allows you to pass an address or index for an account array to ethers for specifying the signer of the transaction. + +## Internal Structure + +### Raw Functions + +Raw functions are a crucial part of how ENSjs works. In the function file itself +a `raw` and `decode` function both need to be defined, with the export being an object with those properties. +This allows for the encoding and decoding of contract calls to be split, meaning that multiple calls can be batched together. +For calling a raw function by itself, the raw and decode functions are stitched together with a provider call. This is done +using `importGenerator` which is explained below. + +### importGenerator + +The importGenerator function generates a wrapped function for any given input. +The result of the wrapped function obfuscates the processing that ENSjs does, and exposes a cleaner API to the user/developer. +The reason we do this is to: + +1. Pass through all the required variables for the function +2. Split individual functions from the main class +3. Dynamically load functions and their dependencies +4. Allow each function's dependencies to be imported regularly +5. Remove duplicate code +6. Make it easier to isolate errors +7. Stitch `raw` and `decode` functions together + +### ContractManager + +The contract manager is where all the contracts are dynamically loaded in and resolved based on the network. +A new instance of ContractManager is created every time you switch providers. + +### GqlManager + +The GQL manager is used as to separate the reliance of ENSjs from GQL. +It only loads in GQL when it is needed, or not at all if specified in the constructor of the ENS class. +Very simply, it just exposes the core functions needed for ENSjs which can then be accessed. + +### initialProvider + +The `initialProvider`, and similarly `checkInitialProvider` are used when creating single-use class instances with `withProvider`. +It allows `withProvider` to act as a new ENS instance without having to await a promise, which simplifies the API. +`checkInitialProvider` is run on every function call given that it's extremely lightweight. + +## Individual Functions + +### Utils + +Utils can be imported at follows +`import { encodeContenthash } from '@ensdomains/ensjs/utils/contentHash'` + +### getFuses + +Gets the fuses for a specified wrapped name. + +Input: + +- `name`: string + - Target name + +Output: + +- `fuseObj`: object + - Decoded known fuses +- `vulnerability`: string + - Vulnerability for name + - Will be "Safe" if no vulnerability +- `vulnerableNode`: string | null + - Node that is vulnerable in chain +- `rawFuses`: BigNumber + - Unformatted fuse result + +### getHistory + +Gets the history for a specified name. + +Input: + +- `name`: string + - Target name + +Output: + +- `domain`: array + - Domain event item +- `registration`: array + - Registration event item +- `resolver`: array + - Resolver event item + +### getHistoryWithDetail + +Gets the history for a specified name with details. + +Input: + +- `name`: string + - Target name + +Output: + +- `domain`: array + - Domain event item +- `registration`: array + - Registration event item +- `resolver`: array + - Resolver event item + +### getHistoryDetailForTransactionHash + +Gets the history details for a specified transaction hash. + +Input: + +- `hash`: string + - Target transaction hash +- `indexInTransaction`: number? + - Index of transaction out of same transaction type + +Output: + +- object | array + - `key`: string + - Key for detail + - `value`: string + - Value for detail + +### getName + +Gets the primary name for a specified address. + +Input: + +- `address`: string + - Target address + +Output: + +- `name`: string | null + - Resolved name +- `match`: boolean + - Forward resolved match check value + +### getOwner + +Gets the owner of a specified name. See _ownership levels_ for more details about the output. + +Input: + +- `name`: string + - Target name + +Output: + +- `owner`: string + - Controller of records for name +- `registrant`: string? + - NFT Owner +- `ownershipLevel`: string + - Level at which the ownership data is being read + +### getProfile + +Gets the profile of a specified name or address, or just certain records if specified. + +Input: + +- `nameOrAddress`: string + - Target name or address +- `options`: object? + - `contentHash`: boolean? + - `texts`: boolean? | string[]? + - Array of keys, or true for all keys + - `coinTypes`: boolean? | string[]? + - Array of keys, or true for all keys + +Output: + +- `resolverAddress`: string + - Address of resolver +- `records`: object + - matching records from input + - `contentHash`: object? | null? + - Decoded content hash + - `texts`: array? + - `key`: string + - `value`: string + - `coinTypes`: array? + - `key`: number + - `coin`: string + - Coin name + - `value`: string + - Decoded address +- `name`: string? + - _Only applicable for address inputs_ + - Resolved name +- `address`: string? + - _Only applicable for name inputs_ + - Resolved address +- `match`: boolean? + - _Only applicable for address inputs_ + - Forward resolved match check value + +### getRecords + +Gets all the records of a specified name, or just certain records if specified. + +Input: + +- `name`: string +- `options`: object? + - `contentHash`: boolean? + - `texts`: boolean? | string[]? + - Array of keys, or true for all keys + - `coinTypes`: boolean? | string[]? + - Array of keys, or true for all keys + +Output: **see getProfile** + +### getResolver + +Gets the resolver for a specified name. + +Input: + +- `name`: string + - Target name + +Output: + +- string + - Resolver address + +### getContentHash + +Gets the content hash record for a specified name. + +Input: + +- `name`: string + - Target name + +Output: + +- object | null + - Decoded content hash + +### getText + +Gets a text record for a specified name. + +Input: + +- `name`: string + - Target name +- `key`: string + - Target key + +Output: + +- string | null + - Text record value + +### getAddr + +Gets an address record for a specified name. + +Input: + +- `name`: string + - Target name +- `coinType`: string? | number? + - Target coin + - Defaults to 60 (ETH) if undefined + +Output: + +- string | null + - Address record value + +### burnFuses + +Creates a transaction to burn fuses on a specified wrapped name. + +Input: + +- `name`: string + - Target name +- `fusesToBurn`: object + - Object of fuses intended to be burned. + +Output: + +- transaction + +### createSubname + +Creates a subname using the specified contract. + +Input: + +- object + - `name`: string + - Target name + - `owner`: string + - New owner of subname + - `contract`: `registry` | `nameWrapper` + - Target contract + - `resolverAddress`: string? + - Resolver address for name + - `shouldWrap`: boolean? + - _Only valid with NameWrapper contract_ + - Initial name wrapped state + - `fuses`: object? + - _Only valid with NameWrapper contract_ + - Initial fuses to be burned + +Output: + +- transaction + +### deleteSubname + +Deletes a subname using the specified contract. + +Input: + +- `name`: string + - Target name +- `contract`: `registry` | `nameWrapper` + - Target contract + +Output: + +- transaction + +### transferSubname + +Transfers a subname using the specified contract. +**Please note that transferring a wrapped name using this method will unwrap the name.** + +Input: + +- `name`: string + - Target name +- `contract`: `registry` | `nameWrapper` + - Target contract +- `address`: string + - Address to transfer name to + +Output: + +- transaction + +### setName + +Sets the primary name for a specified address. + +Input: + +- `name`: string + - Name to set +- `address`: string? + - _Setting other primary names requires authorisation_ + - Address to set name for +- `resolver`: string? + - _Setting other primary names requires authorisation_ + - Target resolver + +Output: + +- transaction + +### setRecords + +Sets multiple records at once for the specified name. + +Input: + +- `name`: string + - Target name +- `records`: object + - `contentHash`: string? + - Formatted and encoded content hash + - `texts`: array? + - object + - `key`: string + - Text key + - `value`: string + - Text value + - `coinTypes`: array? + - object + - `key`: string + - Coin name or ID + - `value`: string + - Coin address + +Output: + +- transaction + +### setResolver + +Sets the resolver for the specified name, using the specified contract. + +Input: + +- `name`: string + - Target Name +- `contract`: `registry` | `nameWrapper` + - Target contract +- `resolver`: string? + - _Leaving this undefined will use the default public resolver_ + +Output: + +- transaction + +### transferName + +Transfers a name, using the specified contract. + +Input: + +- `name`: string + - Target name +- `newOwner`: string + - Address to transfer name to +- `contract`: `registry` | `nameWrapper` | `baseRegistrar` + - Target contract + +Output: + +- transaction + +### wrapName + +Wraps a name. + +Input: + +- `name`: string + - Target name +- `wrappedOwner`: string + - New owner of wrapped name +- `fuseOptions`: object? + - Initial fuses to burn +- `resolverAddress`: string? + - Initial resolver address + +Output: + +- transaction + +### unwrapName + +Unwraps a name. + +Input: + +- `name`: string + - Target name +- `newController`: string + - New controller for name +- `newRegistrant`: string? + - New registrant for name + +Output: + +- transaction + +### universalWrapper + +Wraps a function so it is directed to the universal resolver instead of the default public resolver. + +Input: + +- `name`: string + - Name to resolve +- `data`: string + - Hex encoded function data + +Output: + +- object + - `data`: string + - Hex encoded function result + - `resolver`: string + - Used resolver address + +Examples for universalWrapper can be found in `getSpecificRecord`. + +### resolverMulticallWrapper + +Wraps multiple resolver calls so they are made into a single resolver multicall. + +Input: + +- array + - object + - `to`: string + - Placeholder for standard function calls, ignore this. + - `data`: string + - Hex encoded function data + +Output: + +- array + - string + - Hex encoded function result + +Examples for resolverMulticallWrapper can be found in `getProfile`. diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/GqlManager.js b/.yalc/@ensdomains/ensjs/dist/cjs/GqlManager.js new file mode 100644 index 000000000..0706c9936 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/GqlManager.js @@ -0,0 +1,115 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var GqlManager_exports = {}; +__export(GqlManager_exports, { + default: () => GqlManager, + enter: () => enter, + requestMiddleware: () => requestMiddleware, + responseMiddleware: () => responseMiddleware +}); +module.exports = __toCommonJS(GqlManager_exports); +var import_normalise = require("./utils/normalise"); +const generateSelection = (selection) => ({ + kind: "Field", + name: { + kind: "Name", + value: selection + }, + arguments: [], + directives: [], + alias: void 0, + selectionSet: void 0 +}); +const enter = (node) => { + let hasName = false; + let hasId = false; + for (const selection of node.selections) { + if ("name" in selection) { + if (selection.name.value === "name") + hasName = true; + else if (selection.name.value === "id") + hasId = true; + } + } + if (hasName && !hasId) { + node.selections = [...node.selections, generateSelection("id")]; + return node; + } +}; +const requestMiddleware = (visit, parse, print) => (request) => { + const requestBody = JSON.parse(request.body); + const rawQuery = requestBody.query; + const parsedQuery = parse(rawQuery); + const updatedQuery = visit(parsedQuery, { + SelectionSet: { + enter + } + }); + return { + ...request, + body: JSON.stringify({ ...requestBody, query: print(updatedQuery) }) + }; +}; +const responseMiddleware = (traverse) => (response) => { + traverse(response).forEach(function(responseItem) { + if (responseItem instanceof Object && responseItem.name) { + if (responseItem.name && responseItem.name.includes("[")) { + return; + } + const hashedName = (0, import_normalise.namehash)(responseItem.name); + if (responseItem.id !== hashedName) { + this.update({ ...responseItem, name: hashedName, invalidName: true }); + } + } + }); + return response; +}; +class GqlManager { + constructor() { + this.gql = (query) => query.join(); + this.client = { + request: () => Promise.resolve(null) + }; + this.setUrl = async (url) => { + if (url) { + const [imported, traverse, { visit, parse, print }] = await Promise.all([ + import("graphql-request"), + import("traverse"), + import("graphql/language") + ]); + this.client = new imported.GraphQLClient(url, { + requestMiddleware: requestMiddleware(visit, parse, print), + responseMiddleware: responseMiddleware(traverse.default) + }); + this.gql = imported.gql; + } else { + this.client = { + request: () => Promise.resolve(null) + }; + this.gql = (query) => query.join(); + } + }; + } +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/contracts/baseRegistrar.js b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/baseRegistrar.js new file mode 100644 index 000000000..227b519e4 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/baseRegistrar.js @@ -0,0 +1,25 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var baseRegistrar_exports = {}; +__export(baseRegistrar_exports, { + default: () => baseRegistrar_default +}); +module.exports = __toCommonJS(baseRegistrar_exports); +var import_BaseRegistrarImplementation_factory = require("../generated/factories/BaseRegistrarImplementation__factory"); +var baseRegistrar_default = (provider, address) => import_BaseRegistrarImplementation_factory.BaseRegistrarImplementation__factory.connect(address, provider); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/contracts/bulkRenewal.js b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/bulkRenewal.js new file mode 100644 index 000000000..ce2a2dffe --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/bulkRenewal.js @@ -0,0 +1,25 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var bulkRenewal_exports = {}; +__export(bulkRenewal_exports, { + default: () => bulkRenewal_default +}); +module.exports = __toCommonJS(bulkRenewal_exports); +var import_BulkRenewal_factory = require("../generated/factories/BulkRenewal__factory"); +var bulkRenewal_default = (provider, address) => import_BulkRenewal_factory.BulkRenewal__factory.connect(address, provider); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/contracts/dnsRegistrar.js b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/dnsRegistrar.js new file mode 100644 index 000000000..4aeb25868 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/dnsRegistrar.js @@ -0,0 +1,25 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var dnsRegistrar_exports = {}; +__export(dnsRegistrar_exports, { + default: () => dnsRegistrar_default +}); +module.exports = __toCommonJS(dnsRegistrar_exports); +var import_DNSRegistrar_factory = require("../generated/factories/DNSRegistrar__factory"); +var dnsRegistrar_default = (provider, address) => import_DNSRegistrar_factory.DNSRegistrar__factory.connect(address, provider); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/contracts/ethRegistrarController.js b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/ethRegistrarController.js new file mode 100644 index 000000000..c082dbad1 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/ethRegistrarController.js @@ -0,0 +1,25 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var ethRegistrarController_exports = {}; +__export(ethRegistrarController_exports, { + default: () => ethRegistrarController_default +}); +module.exports = __toCommonJS(ethRegistrarController_exports); +var import_ETHRegistrarController_factory = require("../generated/factories/ETHRegistrarController__factory"); +var ethRegistrarController_default = (provider, address) => import_ETHRegistrarController_factory.ETHRegistrarController__factory.connect(address, provider); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/contracts/factories.js b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/factories.js new file mode 100644 index 000000000..35206a156 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/factories.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var factories_exports = {}; +module.exports = __toCommonJS(factories_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/contracts/getContractAddress.js b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/getContractAddress.js new file mode 100644 index 000000000..951fafa48 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/getContractAddress.js @@ -0,0 +1,85 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var getContractAddress_exports = {}; +__export(getContractAddress_exports, { + getContractAddress: () => getContractAddress +}); +module.exports = __toCommonJS(getContractAddress_exports); +const addresses = { + BaseRegistrarImplementation: { + "1": "0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85", + "3": "0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85", + "4": "0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85", + "5": "0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85" + }, + DNSRegistrar: { + "1": "0x58774Bb8acD458A640aF0B88238369A167546ef2", + "3": "0xdB328BA5FEcb432AF325Ca59E3778441eF5aa14F", + "5": "0x8edc487D26F6c8Fa76e032066A3D4F87E273515d" + }, + ETHRegistrarController: { + "1": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", + "3": "0xa5627AB7Ae47063B533622C34FEBDb52d3281dF8", + "4": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", + "5": "0xb7A1f9e633fdeaAa2ec44bE00a61a7Db9a733D70" + }, + Multicall: "0xcA11bde05977b3631167028862bE2a173976CA11", + NameWrapper: { + "1": "0x0000000000000000000000000000000000000000", + "3": "0xF82155e2a43Be0871821E9654Fc8Ae894FB8307C", + "4": "0x0000000000000000000000000000000000000000", + "5": "0xEe1F756aCde7E81B2D8cC6aB3c8A1E2cE6db0F39" + }, + PublicResolver: { + "1": "0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41", + "3": "0x13F0659Ee6bb7484C884FEeFb7F75C93951ef837", + "5": "0x2800Ec5BAB9CE9226d19E0ad5BC607e3cfC4347E" + }, + ENSRegistry: { + "1": "0x00000000000c2e074ec69a0dfb2997ba6c7d2e1e", + "3": "0x00000000000c2e074ec69a0dfb2997ba6c7d2e1e", + "4": "0x00000000000c2e074ec69a0dfb2997ba6c7d2e1e", + "5": "0x00000000000c2e074ec69a0dfb2997ba6c7d2e1e" + }, + ReverseRegistrar: { + "1": "0x084b1c3C81545d370f3634392De611CaaBFf8148", + "3": "0x806246b52f8cB61655d3038c58D2f63Aa55d4edE", + "5": "0x9a879320A9F7ad2BBb02063d67baF5551D6BD8B0" + }, + UniversalResolver: { + "1": "0x74E20Bd2A1fE0cdbe45b9A1d89cb7e0a45b36376", + "3": "0x74e20bd2a1fe0cdbe45b9a1d89cb7e0a45b36376", + "4": "0x74e20bd2a1fe0cdbe45b9a1d89cb7e0a45b36376", + "5": "0x687c30Cc44bFA39A1449e86E172BF002E7b3f0b0" + }, + BulkRenewal: { + "1": "0xfF252725f6122A92551A5FA9a6b6bf10eb0Be035", + "3": "0x051b02245D826757EfaF5C6209D4D79FB39FBC45", + "5": "0xa9e1df95a79C768aA435805b28E1B54Bb5ead063" + } +}; +const getContractAddress = (networkId) => (contractName) => { + try { + return typeof addresses[contractName] === "string" ? addresses[contractName] : addresses[contractName][networkId]; + } catch { + throw new Error( + `No address for contract ${contractName} on network ${networkId}` + ); + } +}; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/contracts/index.js b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/index.js new file mode 100644 index 000000000..e1b358f6f --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/index.js @@ -0,0 +1,61 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var contracts_exports = {}; +__export(contracts_exports, { + default: () => ContractManager +}); +module.exports = __toCommonJS(contracts_exports); +class ContractManager { + constructor(provider, fetchAddress, getModule) { + this.getModule = async (name) => { + const mod = await import( + /* webpackMode: "lazy", webpackChunkName: "[request]", webpackPreload: true, webpackExclude: /.*\.ts$/ */ + `../generated/factories/${name}__factory` + ); + return mod[`${name}__factory`]; + }; + this.generateContractGetter = (name) => { + return async (passedProvider, address) => { + const mod = await this.getModule(name); + const inputAddress = address || this.fetchAddress(name); + const provider = passedProvider || this.provider; + return mod.connect(inputAddress, provider); + }; + }; + this.getPublicResolver = this.generateContractGetter("PublicResolver"); + this.getUniversalResolver = this.generateContractGetter("UniversalResolver"); + this.getRegistry = this.generateContractGetter("ENSRegistry"); + this.getReverseRegistrar = this.generateContractGetter("ReverseRegistrar"); + this.getNameWrapper = this.generateContractGetter("NameWrapper"); + this.getDNSRegistrar = this.generateContractGetter("DNSRegistrar"); + this.getBaseRegistrar = this.generateContractGetter( + "BaseRegistrarImplementation" + ); + this.getEthRegistrarController = this.generateContractGetter( + "ETHRegistrarController" + ); + this.getMulticall = this.generateContractGetter("Multicall"); + this.getBulkRenewal = this.generateContractGetter("BulkRenewal"); + this.provider = provider; + this.fetchAddress = fetchAddress; + if (getModule) { + this.getModule = getModule; + } + } +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/contracts/multicall.js b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/multicall.js new file mode 100644 index 000000000..664fd274c --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/multicall.js @@ -0,0 +1,25 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var multicall_exports = {}; +__export(multicall_exports, { + default: () => multicall_default +}); +module.exports = __toCommonJS(multicall_exports); +var import_Multicall_factory = require("../generated/factories/Multicall__factory"); +var multicall_default = (provider, address) => import_Multicall_factory.Multicall__factory.connect(address, provider); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/contracts/nameWrapper.js b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/nameWrapper.js new file mode 100644 index 000000000..cc398a4d1 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/nameWrapper.js @@ -0,0 +1,25 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var nameWrapper_exports = {}; +__export(nameWrapper_exports, { + default: () => nameWrapper_default +}); +module.exports = __toCommonJS(nameWrapper_exports); +var import_NameWrapper_factory = require("../generated/factories/NameWrapper__factory"); +var nameWrapper_default = (provider, address) => import_NameWrapper_factory.NameWrapper__factory.connect(address, provider); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/contracts/publicResolver.js b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/publicResolver.js new file mode 100644 index 000000000..3ff6e7399 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/publicResolver.js @@ -0,0 +1,25 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var publicResolver_exports = {}; +__export(publicResolver_exports, { + default: () => publicResolver_default +}); +module.exports = __toCommonJS(publicResolver_exports); +var import_PublicResolver_factory = require("../generated/factories/PublicResolver__factory"); +var publicResolver_default = (provider, address) => import_PublicResolver_factory.PublicResolver__factory.connect(address, provider); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/contracts/registry.js b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/registry.js new file mode 100644 index 000000000..b30f3c7e7 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/registry.js @@ -0,0 +1,25 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var registry_exports = {}; +__export(registry_exports, { + default: () => registry_default +}); +module.exports = __toCommonJS(registry_exports); +var import_ENSRegistry_factory = require("../generated/factories/ENSRegistry__factory"); +var registry_default = (provider, address) => import_ENSRegistry_factory.ENSRegistry__factory.connect(address, provider); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/contracts/reverseRegistrar.js b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/reverseRegistrar.js new file mode 100644 index 000000000..01f117bdf --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/reverseRegistrar.js @@ -0,0 +1,25 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var reverseRegistrar_exports = {}; +__export(reverseRegistrar_exports, { + default: () => reverseRegistrar_default +}); +module.exports = __toCommonJS(reverseRegistrar_exports); +var import_ReverseRegistrar_factory = require("../generated/factories/ReverseRegistrar__factory"); +var reverseRegistrar_default = (provider, address) => import_ReverseRegistrar_factory.ReverseRegistrar__factory.connect(address, provider); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/contracts/types.js b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/types.js new file mode 100644 index 000000000..43ae53610 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/types.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var types_exports = {}; +module.exports = __toCommonJS(types_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/contracts/universalResolver.js b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/universalResolver.js new file mode 100644 index 000000000..c39257290 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/contracts/universalResolver.js @@ -0,0 +1,25 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var universalResolver_exports = {}; +__export(universalResolver_exports, { + default: () => universalResolver_default +}); +module.exports = __toCommonJS(universalResolver_exports); +var import_UniversalResolver_factory = require("../generated/factories/UniversalResolver__factory"); +var universalResolver_default = (provider, address) => import_UniversalResolver_factory.UniversalResolver__factory.connect(address, provider); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/batch.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/batch.js new file mode 100644 index 000000000..53cf79163 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/batch.js @@ -0,0 +1,48 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var batch_exports = {}; +__export(batch_exports, { + default: () => batch_default +}); +module.exports = __toCommonJS(batch_exports); +const raw = async ({ multicallWrapper }, ...items) => { + const rawDataArr = await Promise.all( + items.map(({ args, raw: rawRef }, i) => { + if (!rawRef) { + throw new Error(`Function ${i} is not batchable`); + } + return rawRef(...args); + }) + ); + return multicallWrapper.raw(rawDataArr); +}; +const decode = async ({ multicallWrapper }, data, ...items) => { + const response = await multicallWrapper.decode(data); + if (!response) + return; + return Promise.all( + response.map( + (ret, i) => items[i].decode(ret.returnData, ...items[i].args) + ) + ); +}; +var batch_default = { + raw, + decode +}; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/batchWrappers.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/batchWrappers.js new file mode 100644 index 000000000..618e34c89 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/batchWrappers.js @@ -0,0 +1,134 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var batchWrappers_exports = {}; +__export(batchWrappers_exports, { + multicallWrapper: () => multicallWrapper, + resolverMulticallWrapper: () => resolverMulticallWrapper, + universalWrapper: () => universalWrapper +}); +module.exports = __toCommonJS(batchWrappers_exports); +var import_ccip = __toESM(require("../utils/ccip")); +var import_hexEncodedName = require("../utils/hexEncodedName"); +const universalWrapper = { + raw: async ({ contracts }, name, data) => { + const universalResolver = await (contracts == null ? void 0 : contracts.getUniversalResolver()); + return { + to: universalResolver.address, + data: universalResolver.interface.encodeFunctionData( + "resolve(bytes,bytes)", + [(0, import_hexEncodedName.hexEncodeName)(name), data] + ) + }; + }, + decode: async ({ contracts }, data) => { + const universalResolver = await (contracts == null ? void 0 : contracts.getUniversalResolver()); + const response = universalResolver.interface.decodeFunctionResult( + "resolve(bytes,bytes)", + data + ); + if (!response || !response[0]) { + return; + } + return { data: response[0], resolver: response[1] }; + } +}; +const resolverMulticallWrapper = { + raw: async ({ contracts }, data) => { + const publicResolver = await (contracts == null ? void 0 : contracts.getPublicResolver()); + const formattedDataArr = data.map((item) => item.data); + return { + to: publicResolver.address, + data: publicResolver.interface.encodeFunctionData("multicall", [ + formattedDataArr + ]) + }; + }, + decode: async ({ contracts }, data) => { + const publicResolver = await (contracts == null ? void 0 : contracts.getPublicResolver()); + const response = publicResolver.interface.decodeFunctionResult( + "multicall", + data + ); + if (!response) { + return; + } + return response; + } +}; +const multicallWrapper = { + async raw({ contracts }, transactions, requireSuccess = false) { + const multicall = await (contracts == null ? void 0 : contracts.getMulticall()); + return { + to: multicall.address, + data: multicall.interface.encodeFunctionData("tryAggregate", [ + requireSuccess, + transactions.map((tx) => ({ + target: tx.to, + callData: tx.data + })) + ]) + }; + }, + async decode({ contracts, provider }, data, transactions) { + if (!data) + return; + const multicall = await (contracts == null ? void 0 : contracts.getMulticall()); + try { + const [result] = multicall.interface.decodeFunctionResult( + "tryAggregate", + data + ); + const ccipChecked = await Promise.all( + result.map( + async ([success, returnData], i) => { + let newArr = [success, returnData]; + if (!success && returnData.startsWith("0x556f1830")) { + try { + const newData = await (0, import_ccip.default)( + provider, + transactions[i], + returnData + ); + if (newData) { + newArr = [true, newData]; + } + } catch { + } + } + return { + ...newArr, + success: newArr[0], + returnData: newArr[1] + }; + } + ) + ); + return ccipChecked; + } catch (e) { + console.error(e); + return; + } + } +}; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/commitName.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/commitName.js new file mode 100644 index 000000000..dc448b34d --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/commitName.js @@ -0,0 +1,48 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var commitName_exports = {}; +__export(commitName_exports, { + default: () => commitName_default +}); +module.exports = __toCommonJS(commitName_exports); +var import_registerHelpers = require("../utils/registerHelpers"); +var import_wrapper = require("../utils/wrapper"); +async function commitName_default({ contracts }, name, { resolverAddress, ...params }) { + const labels = name.split("."); + if (labels.length !== 2 || labels[1] !== "eth") + throw new Error("Currently only .eth TLD registrations are supported"); + (0, import_wrapper.wrappedLabelLengthCheck)(labels[0]); + const controller = await contracts.getEthRegistrarController(); + const resolver = await contracts.getPublicResolver( + void 0, + resolverAddress + ); + const { secret, commitment } = (0, import_registerHelpers.makeCommitment)({ + name, + resolver, + ...params + }); + return { + ...await controller.populateTransaction.commit(commitment), + customData: { + secret, + commitment + } + }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/createSubname.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/createSubname.js new file mode 100644 index 000000000..15978a986 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/createSubname.js @@ -0,0 +1,80 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var createSubname_exports = {}; +__export(createSubname_exports, { + default: () => createSubname_default +}); +module.exports = __toCommonJS(createSubname_exports); +var import_solidity = require("@ethersproject/solidity"); +var import_fuses = require("../utils/fuses"); +var import_normalise = require("../utils/normalise"); +var import_wrapper = require("../utils/wrapper"); +async function createSubname_default({ + contracts, + signer, + getExpiry +}, name, { owner, resolverAddress, contract, ...wrapperArgs }) { + const labels = name.split("."); + if (labels.length === 1) { + throw new Error("Subnames in ENS.js can only be created for 2LDs, not TLDs"); + } + if ("fuses" in wrapperArgs && contract === "registry") { + throw new Error("Fuses can only be set on a wrapped name"); + } + if (!resolverAddress) { + resolverAddress = (await (contracts == null ? void 0 : contracts.getPublicResolver())).address; + } + const label = labels.shift(); + const labelhash = (0, import_solidity.keccak256)(["string"], [label]); + const parentNodehash = (0, import_normalise.namehash)(labels.join(".")); + switch (contract) { + case "registry": { + const registry = (await contracts.getRegistry()).connect(signer); + return registry.populateTransaction.setSubnodeRecord( + parentNodehash, + labelhash, + owner, + resolverAddress, + 0 + ); + } + case "nameWrapper": { + (0, import_wrapper.wrappedLabelLengthCheck)(label); + const nameWrapper = (await contracts.getNameWrapper()).connect(signer); + const expiry = await (0, import_wrapper.makeExpiry)( + { getExpiry }, + name, + "expiry" in wrapperArgs ? wrapperArgs.expiry : void 0 + ); + const generatedFuses = "fuses" in wrapperArgs && wrapperArgs.fuses ? (0, import_fuses.encodeFuses)(wrapperArgs.fuses) : 0; + return nameWrapper.populateTransaction.setSubnodeRecord( + parentNodehash, + label, + owner, + resolverAddress, + 0, + generatedFuses, + expiry + ); + } + default: { + throw new Error(`Unknown contract: ${contract}`); + } + } +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/deleteSubname.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/deleteSubname.js new file mode 100644 index 000000000..34573116e --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/deleteSubname.js @@ -0,0 +1,61 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var deleteSubname_exports = {}; +__export(deleteSubname_exports, { + default: () => deleteSubname_default +}); +module.exports = __toCommonJS(deleteSubname_exports); +var import_solidity = require("@ethersproject/solidity"); +var import_normalise = require("../utils/normalise"); +async function deleteSubname_default({ contracts, signer }, name, { contract }) { + const labels = name.split("."); + if (labels.length < 3) { + throw new Error(`${name} is not a valid subname`); + } + const label = labels.shift(); + const labelhash = (0, import_solidity.keccak256)(["string"], [label]); + const parentNodehash = (0, import_normalise.namehash)(labels.join(".")); + switch (contract) { + case "registry": { + const registry = (await contracts.getRegistry()).connect(signer); + return registry.populateTransaction.setSubnodeRecord( + parentNodehash, + labelhash, + "0x0000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000", + 0 + ); + } + case "nameWrapper": { + const nameWrapper = (await contracts.getNameWrapper()).connect(signer); + return nameWrapper.populateTransaction.setSubnodeRecord( + parentNodehash, + label, + "0x0000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000", + 0, + 0, + 0 + ); + } + default: { + throw new Error(`Unknown contract: ${contract}`); + } + } +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/getAvailable.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getAvailable.js new file mode 100644 index 000000000..14d1f61a5 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getAvailable.js @@ -0,0 +1,55 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var getAvailable_exports = {}; +__export(getAvailable_exports, { + default: () => getAvailable_default +}); +module.exports = __toCommonJS(getAvailable_exports); +var import_labels = require("../utils/labels"); +const raw = async ({ contracts }, name) => { + const baseRegistrar = await (contracts == null ? void 0 : contracts.getBaseRegistrar()); + const labels = name.split("."); + if (labels.length !== 2 || labels[1] !== "eth") { + throw new Error("Currently only .eth names can be checked for availability"); + } + return { + to: baseRegistrar.address, + data: baseRegistrar.interface.encodeFunctionData("available", [ + (0, import_labels.labelhash)(labels[0]) + ]) + }; +}; +const decode = async ({ contracts }, data) => { + if (data === null) + return; + const baseRegistrar = await (contracts == null ? void 0 : contracts.getBaseRegistrar()); + try { + const result = baseRegistrar.interface.decodeFunctionResult( + "available", + data + ); + return result["0"]; + } catch { + return; + } +}; +var getAvailable_default = { + raw, + decode +}; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/getDNSOwner.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getDNSOwner.js new file mode 100644 index 000000000..cd4fb8fa2 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getDNSOwner.js @@ -0,0 +1,87 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var getDNSOwner_exports = {}; +__export(getDNSOwner_exports, { + default: () => getDNSOwner_default, + dnsQuery: () => dnsQuery, + encodeURLParams: () => encodeURLParams, + getDNS: () => getDNS +}); +module.exports = __toCommonJS(getDNSOwner_exports); +var import_web = require("@ethersproject/web"); +var packet = __toESM(require("dns-packet")); +function encodeURLParams(p) { + return Object.entries(p).map((kv) => kv.map(encodeURIComponent).join("=")).join("&"); +} +const getDNS = async (q) => { + var _a; + const url = `https://cloudflare-dns.com/dns-query?${encodeURLParams({ + ct: "application/dns-udpwireformat", + dns: (_a = packet.encode(q)) == null ? void 0 : _a.toString("base64"), + ts: Date.now().toString() + })}`; + const response = await (0, import_web._fetchData)(url, void 0); + const arrayBuffer = response.buffer.slice( + response.byteOffset, + response.byteLength + response.byteOffset + ); + const fromArrayBuffer = Buffer.from(arrayBuffer); + return packet.decode(fromArrayBuffer); +}; +const dnsQuery = async (qtype, qname) => { + const query = { + type: "query", + id: 1, + flags: packet.RECURSION_DESIRED, + questions: [ + { + type: qtype, + class: "IN", + name: qname + } + ], + additionals: [ + { + type: "OPT", + class: "IN", + name: ".", + udpPayloadSize: 4096, + flags: packet.DNSSEC_OK + } + ], + answers: [] + }; + const response = await getDNS(query); + if (response.rcode !== "NOERROR") { + throw new Error(`DNS query failed: ${response.rcode}`); + } + return response; +}; +async function getDNSOwner_default(_, dnsName) { + var _a, _b, _c, _d, _e, _f; + const result = await dnsQuery("TXT", `_ens.${dnsName}`); + const address = (_f = (_e = (_d = (_c = (_b = (_a = result == null ? void 0 : result.answers) == null ? void 0 : _a[0]) == null ? void 0 : _b.data) == null ? void 0 : _c[0]) == null ? void 0 : _d.toString()) == null ? void 0 : _e.split("=")) == null ? void 0 : _f[1]; + return address; +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/getExpiry.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getExpiry.js new file mode 100644 index 000000000..3dc0342c6 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getExpiry.js @@ -0,0 +1,114 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var getExpiry_exports = {}; +__export(getExpiry_exports, { + default: () => getExpiry_default +}); +module.exports = __toCommonJS(getExpiry_exports); +var import_solidity = require("@ethersproject/solidity"); +var import_normalise = require("../utils/normalise"); +const getRegistrarExpiry = async ({ contracts, multicallWrapper }, labels) => { + if (labels.length > 2 || labels[1] !== "eth") { + throw new Error("Only .eth names have expiry dates on the registrar"); + } + const baseRegistrar = await (contracts == null ? void 0 : contracts.getBaseRegistrar()); + const expiryCall = baseRegistrar.interface.encodeFunctionData("nameExpires", [ + (0, import_solidity.keccak256)(["string"], [labels[0]]) + ]); + const gracePeriodCall = baseRegistrar.interface.encodeFunctionData("GRACE_PERIOD"); + return multicallWrapper.raw([ + { + to: baseRegistrar.address, + data: expiryCall + }, + { + to: baseRegistrar.address, + data: gracePeriodCall + } + ]); +}; +const getWrapperExpiry = async ({ contracts }, labels) => { + const nameWrapper = await (contracts == null ? void 0 : contracts.getNameWrapper()); + const expiryCall = nameWrapper.interface.encodeFunctionData("getData", [ + (0, import_normalise.namehash)(labels.join(".")) + ]); + return { + to: nameWrapper.address, + data: expiryCall + }; +}; +const getContractToUse = (contract, labels) => { + if (contract) + return contract; + if (labels.length === 2 && labels[1] === "eth") { + return "registrar"; + } + return "nameWrapper"; +}; +const raw = async (ensArgs, name, { contract } = {}) => { + const labels = name.split("."); + const contractToUse = getContractToUse(contract, labels); + return contractToUse === "nameWrapper" ? getWrapperExpiry(ensArgs, labels) : getRegistrarExpiry(ensArgs, labels); +}; +const decodeRegistrarExpiry = async ({ contracts, multicallWrapper }, data) => { + const result = await multicallWrapper.decode(data); + const baseRegistrar = await (contracts == null ? void 0 : contracts.getBaseRegistrar()); + try { + const [nameExpires] = baseRegistrar.interface.decodeFunctionResult( + "nameExpires", + result[0].returnData + ); + const [gracePeriod] = baseRegistrar.interface.decodeFunctionResult( + "GRACE_PERIOD", + result[1].returnData + ); + return { + expiry: nameExpires > 0 ? new Date(nameExpires * 1e3) : null, + gracePeriod: gracePeriod.toNumber() * 1e3 + }; + } catch { + return; + } +}; +const decodeWrapperExpiry = async ({ contracts }, data) => { + const nameWrapper = await (contracts == null ? void 0 : contracts.getNameWrapper()); + try { + const [, , expiry] = nameWrapper.interface.decodeFunctionResult( + "getData", + data + ); + return { + expiry: new Date(expiry * 1e3), + gracePeriod: null + }; + } catch { + return; + } +}; +const decode = async (ensArgs, data, name, { contract } = {}) => { + if (data === null) + return; + const labels = name.split("."); + const contractToUse = getContractToUse(contract, labels); + return contractToUse === "nameWrapper" ? decodeWrapperExpiry(ensArgs, data) : decodeRegistrarExpiry(ensArgs, data); +}; +var getExpiry_default = { + raw, + decode +}; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/getHistory.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getHistory.js new file mode 100644 index 000000000..9b7ce0e21 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getHistory.js @@ -0,0 +1,257 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var getHistory_exports = {}; +__export(getHistory_exports, { + getHistory: () => getHistory +}); +module.exports = __toCommonJS(getHistory_exports); +var import_address_encoder = require("@ensdomains/address-encoder"); +var import_bytes = require("@ethersproject/bytes"); +var import_contentHash = require("../utils/contentHash"); +var import_labels = require("../utils/labels"); +var import_normalise = require("../utils/normalise"); +const eventFormat = { + Domain: { + NewOwner: (args) => ({ owner: args.owner.id }), + NewResolver: (args) => ({ + resolver: args.resolver.id.split("-")[0] + }), + Transfer: (args) => ({ owner: args.owner.id }), + NewTTL: (args) => ({ ttl: args.ttl }), + WrappedTransfer: (args) => ({ owner: args.owner.id }), + NameWrapped: (args) => ({ + fuses: args.fuses, + owner: args.owner.id, + expiryDate: args.expiryDate + }), + NameUnwrapped: (args) => ({ owner: args.owner.id }), + FusesSet: (args) => ({ fuses: args.fuses }), + ExpiryExtended: (args) => ({ expiryDate: args.expiryDate }) + }, + Registration: { + NameRegistered: (args) => ({ + registrant: args.registrant.id, + expiryDate: args.expiryDate + }), + NameRenewed: (args) => ({ expiryDate: args.expiryDate }), + NameTransferred: (args) => ({ owner: args.newOwner.id }) + }, + Resolver: { + AddrChanged: (args) => ({ addr: args.addr.id }), + MulticoinAddrChanged: (args) => { + const format = import_address_encoder.formatsByCoinType[parseInt(args.coinType)]; + if (!format) { + return { + coinType: args.coinType, + rawAddr: args.multiaddr + }; + } + if ((0, import_bytes.hexStripZeros)(args.multiaddr) === "0x") { + return { + coinType: args.coinType, + coinName: format.name, + rawAddr: "0x" + }; + } + return { + coinType: args.coinType, + coinName: format.name, + addr: format.encoder(Buffer.from(args.multiaddr.slice(2), "hex")) + }; + }, + NameChanged: (args) => ({ name: args.name }), + AbiChanged: (args) => ({ contentType: args.contentType }), + PubkeyChanged: (args) => ({ x: args.x, y: args.y }), + TextChanged: (args) => ({ key: args.key, value: args.value }), + ContenthashChanged: (args) => ({ + hash: (0, import_contentHash.decodeContenthash)(args.hash) + }), + InterfaceChanged: (args) => ({ + interfaceId: args.interfaceID, + implementer: args.implementer + }), + AuthorisationChanged: (args) => ({ + owner: args.owner, + target: args.target, + isAuthorized: args.isAuthorized + }), + VersionChanged: (args) => ({ version: args.version }) + } +}; +const mapEvents = (eventArray, type) => eventArray.map( + (event) => ({ + type: event.__typename, + blockNumber: event.blockNumber, + transactionHash: event.transactionID, + id: event.id, + data: eventFormat[type][event.__typename](event) + }) +); +async function getHistory({ gqlInstance }, name) { + const { client } = gqlInstance; + const query = gqlInstance.gql` + query getHistory($namehash: String!, $labelhash: String!) { + domain(id: $namehash) { + events { + id + blockNumber + transactionID + __typename + ...on Transfer { + owner { + id + } + } + ...on NewOwner { + owner { + id + } + } + ...on NewResolver { + resolver { + id + } + } + ...on NewTTL { + ttl + } + ...on WrappedTransfer { + owner { + id + } + } + ...on NameWrapped { + fuses + expiryDate + owner { + id + } + } + ...on NameUnwrapped { + owner { + id + } + } + ...on FusesSet { + fuses + } + ...on ExpiryExtended { + expiryDate + } + } + registration { + events { + id + blockNumber + transactionID + __typename + ...on NameRegistered { + registrant { + id + } + expiryDate + } + ...on NameRenewed { + expiryDate + } + ...on NameTransferred { + newOwner { + id + } + } + } + } + resolver { + events { + id + blockNumber + transactionID + __typename + ...on AddrChanged { + addr { + id + } + } + ...on MulticoinAddrChanged { + coinType + multiaddr: addr + } + ...on NameChanged { + name + } + ...on AbiChanged { + contentType + } + ...on PubkeyChanged { + x + y + } + ...on TextChanged { + key + value + } + ...on ContenthashChanged { + hash + } + ...on InterfaceChanged { + interfaceID + implementer + } + ...on AuthorisationChanged { + owner + target + isAuthorized + } + ...on VersionChanged { + version + } + } + } + } + } + `; + const label = name.split(".")[0]; + const nameHash = (0, import_normalise.namehash)(name); + const labelHash = (0, import_labels.labelhash)(label); + const response = await client.request(query, { + namehash: nameHash, + labelhash: labelHash + }); + const domain = response == null ? void 0 : response.domain; + if (!domain) + return; + const { + events: domainEvents, + registration: { events: registrationEvents }, + resolver: { events: resolverEvents } + } = domain; + const domainHistory = mapEvents(domainEvents, "Domain"); + const registrationHistory = mapEvents(registrationEvents, "Registration"); + const resolverHistory = mapEvents( + resolverEvents.filter( + (event) => !event.coinType || event.coinType !== "60" + ), + "Resolver" + ); + return { + domain: domainHistory, + registration: registrationHistory, + resolver: resolverHistory + }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/getName.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getName.js new file mode 100644 index 000000000..fcafd1b57 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getName.js @@ -0,0 +1,57 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var getName_exports = {}; +__export(getName_exports, { + default: () => getName_default +}); +module.exports = __toCommonJS(getName_exports); +var import_hexEncodedName = require("../utils/hexEncodedName"); +const raw = async ({ contracts }, address) => { + const universalResolver = await (contracts == null ? void 0 : contracts.getUniversalResolver()); + const reverseNode = `${address.toLowerCase().substring(2)}.addr.reverse`; + return { + to: universalResolver.address, + data: universalResolver.interface.encodeFunctionData("reverse(bytes)", [ + (0, import_hexEncodedName.hexEncodeName)(reverseNode) + ]) + }; +}; +const decode = async ({ contracts }, data, address) => { + if (data === null) + return; + const universalResolver = await (contracts == null ? void 0 : contracts.getUniversalResolver()); + try { + const result = universalResolver.interface.decodeFunctionResult( + "reverse(bytes)", + data + ); + return { + name: result["0"], + match: result["1"].toLowerCase() === address.toLowerCase(), + reverseResolverAddress: result["2"], + resolverAddress: result["3"] + }; + } catch { + return { name: void 0 }; + } +}; +var getName_default = { + raw, + decode +}; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/getNames.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getNames.js new file mode 100644 index 000000000..bd76888a0 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getNames.js @@ -0,0 +1,335 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var getNames_exports = {}; +__export(getNames_exports, { + default: () => getNames_default +}); +module.exports = __toCommonJS(getNames_exports); +var import_format = require("../utils/format"); +var import_fuses = require("../utils/fuses"); +var import_labels = require("../utils/labels"); +const mapDomain = ({ name, ...domain }) => { + const decrypted = name ? (0, import_labels.decryptName)(name) : void 0; + return { + ...domain, + name: decrypted, + truncatedName: decrypted ? (0, import_format.truncateFormat)(decrypted) : void 0, + createdAt: new Date(parseInt(domain.createdAt) * 1e3), + type: "domain" + }; +}; +const mapWrappedDomain = (wrappedDomain) => { + const domain = mapDomain(wrappedDomain.domain); + if (domain.registration) { + domain.registration = { + expiryDate: new Date( + parseInt(domain.registration.expiryDate) * 1e3 + ), + registrationDate: new Date( + parseInt(domain.registration.registrationDate) * 1e3 + ) + }; + } + return { + expiryDate: new Date(parseInt(wrappedDomain.expiryDate) * 1e3), + fuses: (0, import_fuses.decodeFuses)(wrappedDomain.fuses), + ...domain, + type: "wrappedDomain" + }; +}; +const mapRegistration = (registration) => { + const decrypted = (0, import_labels.decryptName)(registration.domain.name); + return { + expiryDate: new Date(parseInt(registration.expiryDate) * 1e3), + registrationDate: new Date(parseInt(registration.registrationDate) * 1e3), + ...registration.domain, + name: decrypted, + truncatedName: (0, import_format.truncateFormat)(decrypted), + type: "registration" + }; +}; +const getNames = async ({ gqlInstance }, { + address: _address, + type, + page, + pageSize = 10, + orderDirection, + orderBy = "labelName" +}) => { + const address = _address.toLowerCase(); + const client = gqlInstance.client; + const domainQueryData = ` + id + labelName + labelhash + name + isMigrated + parent { + name + } + `; + let queryVars = {}; + let finalQuery = ""; + if (type === "all") { + finalQuery = gqlInstance.gql` + query getNames( + $id: ID! + $expiryDate: Int + ) { + account(id: $id) { + registrations( + first: 1000 + where: { expiryDate_gt: $expiryDate } + ) { + registrationDate + expiryDate + domain { + ${domainQueryData} + } + } + domains(first: 1000) { + ${domainQueryData} + createdAt + } + wrappedDomains(first: 1000) { + expiryDate + fuses + domain { + ${domainQueryData} + registration { + registrationDate + expiryDate + } + } + } + } + } + `; + queryVars = { + id: address, + expiryDate: Math.floor(Date.now() / 1e3) - 90 * 24 * 60 * 60 + }; + } else if (type === "owner") { + if (typeof page !== "number") { + finalQuery = gqlInstance.gql` + query getNames( + $id: ID! + $orderBy: Domain_orderBy + $orderDirection: OrderDirection + ) { + account(id: $id) { + domains(orderBy: $orderBy, orderDirection: $orderDirection) { + ${domainQueryData} + createdAt + } + } + } + `; + queryVars = { + id: address, + orderBy, + orderDirection + }; + } else { + finalQuery = gqlInstance.gql` + query getNames( + $id: ID! + $first: Int + $skip: Int + $orderBy: Domain_orderBy + $orderDirection: OrderDirection + ) { + account(id: $id) { + domains( + first: $first + skip: $skip + orderBy: $orderBy + orderDirection: $orderDirection + ) { + ${domainQueryData} + createdAt + } + } + } + `; + queryVars = { + id: address, + first: pageSize, + skip: (page || 0) * pageSize, + orderBy, + orderDirection + }; + } + } else if (type === "wrappedOwner") { + if (typeof page !== "number") { + finalQuery = gqlInstance.gql` + query getNames( + $id: ID! + $orderBy: WrappedDomain_orderBy + $orderDirection: OrderDirection + $expiryDate: Int + ) { + account(id: $id) { + wrappedDomains( + orderBy: $orderBy + orderDirection: $orderDirection + where: { expiryDate_gt: $expiryDate } + ) { + expiryDate + fuses + domain { + ${domainQueryData} + createdAt + } + } + } + } + `; + queryVars = { + id: address, + expiryDate: Math.floor(Date.now() / 1e3) - 90 * 24 * 60 * 60 + }; + } else { + finalQuery = gqlInstance.gql` + query getNames( + $id: ID! + $first: Int + $skip: Int + $orderBy: WrappedDomain_orderBy + $orderDirection: OrderDirection + ) { + account(id: $id) { + wrappedDomains( + first: $first + skip: $skip + orderBy: $orderBy + orderDirection: $orderDirection + ) { + expiryDate + fuses + domain { + ${domainQueryData} + createdAt + } + } + } + } + `; + queryVars = { + id: address, + first: pageSize, + skip: (page || 0) * pageSize, + orderBy: orderBy === "labelName" ? "name" : orderBy, + orderDirection + }; + } + } else if (typeof page !== "number") { + finalQuery = gqlInstance.gql` + query getNames( + $id: ID! + $orderBy: Registration_orderBy + $orderDirection: OrderDirection + $expiryDate: Int + ) { + account(id: $id) { + registrations( + orderBy: $orderBy + orderDirection: $orderDirection + where: { expiryDate_gt: $expiryDate } + ) { + registrationDate + expiryDate + domain { + ${domainQueryData} + } + } + } + } + `; + queryVars = { + id: address, + orderBy, + orderDirection, + expiryDate: Math.floor(Date.now() / 1e3) - 90 * 24 * 60 * 60 + }; + } else { + finalQuery = gqlInstance.gql` + query getNames( + $id: ID! + $first: Int + $skip: Int + $orderBy: Registration_orderBy + $orderDirection: OrderDirection + $expiryDate: Int + ) { + account(id: $id) { + registrations( + first: $first + skip: $skip + orderBy: $orderBy + orderDirection: $orderDirection + where: { expiryDate_gt: $expiryDate } + ) { + registrationDate + expiryDate + domain { + ${domainQueryData} + } + } + } + } + `; + queryVars = { + id: address, + first: pageSize, + skip: (page || 0) * pageSize, + orderBy, + orderDirection, + expiryDate: Math.floor(Date.now() / 1e3) - 90 * 24 * 60 * 60 + }; + } + const response = await client.request(finalQuery, queryVars); + const account = response == null ? void 0 : response.account; + if (type === "all") { + return [ + ...(account == null ? void 0 : account.domains.map(mapDomain)) || [], + ...(account == null ? void 0 : account.registrations.map(mapRegistration)) || [], + ...(account == null ? void 0 : account.wrappedDomains.map(mapWrappedDomain)) || [] + ].sort((a, b) => { + if (orderDirection === "desc") { + if (orderBy === "labelName") { + return b.name.localeCompare(a.name); + } + return b.createdAt.getTime() - a.createdAt.getTime(); + } + if (orderBy === "labelName") { + return a.name.localeCompare(b.name); + } + return a.createdAt.getTime() - b.createdAt.getTime(); + }); + } + if (type === "owner") { + return (account == null ? void 0 : account.domains.map(mapDomain)) || []; + } + if (type === "wrappedOwner") { + return (account == null ? void 0 : account.wrappedDomains.map(mapWrappedDomain)) || []; + } + return (account == null ? void 0 : account.registrations.map(mapRegistration)) || []; +}; +var getNames_default = getNames; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/getOwner.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getOwner.js new file mode 100644 index 000000000..19e075791 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getOwner.js @@ -0,0 +1,208 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var getOwner_exports = {}; +__export(getOwner_exports, { + default: () => getOwner_default +}); +module.exports = __toCommonJS(getOwner_exports); +var import_abi_coder = require("@ethersproject/abi/lib/abi-coder"); +var import_bytes = require("@ethersproject/bytes"); +var import_labels = require("../utils/labels"); +var import_normalise = require("../utils/normalise"); +const singleContractOwnerRaw = async ({ contracts }, contract, namehash, labels) => { + switch (contract) { + case "nameWrapper": { + const nameWrapper = await (contracts == null ? void 0 : contracts.getNameWrapper()); + return { + to: nameWrapper.address, + data: nameWrapper.interface.encodeFunctionData("ownerOf", [namehash]) + }; + } + case "registry": { + const registry = await (contracts == null ? void 0 : contracts.getRegistry()); + return { + to: registry.address, + data: registry.interface.encodeFunctionData("owner", [namehash]) + }; + } + case "registrar": { + const registrar = await (contracts == null ? void 0 : contracts.getBaseRegistrar()); + return { + to: registrar.address, + data: registrar.interface.encodeFunctionData("ownerOf", [ + (0, import_labels.labelhash)(labels[0]) + ]) + }; + } + } +}; +const raw = async ({ contracts, multicallWrapper }, name, contract) => { + const namehash = (0, import_normalise.namehash)(name); + const labels = name.split("."); + if (contract || labels.length === 1) { + return singleContractOwnerRaw( + { contracts }, + contract || "registry", + namehash, + labels + ); + } + const registryData = await singleContractOwnerRaw( + { contracts }, + "registry", + namehash, + labels + ); + const nameWrapperData = await singleContractOwnerRaw( + { contracts }, + "nameWrapper", + namehash, + labels + ); + const registrarData = await singleContractOwnerRaw( + { contracts }, + "registrar", + namehash, + labels + ); + const data = [registryData, nameWrapperData]; + if (labels.length === 2 && labels[1] === "eth") { + data.push(registrarData); + } + return multicallWrapper.raw(data); +}; +const registrantQuery = ` + query GetRegistrant($namehash: String!) { + domain(id: $namehash) { + registration { + registrant { + id + } + } + } + } +`; +const singleContractOwnerDecode = (data) => import_abi_coder.defaultAbiCoder.decode(["address"], data)[0]; +const decode = async ({ + contracts, + multicallWrapper, + gqlInstance +}, data, name, contract) => { + var _a, _b, _c, _d, _e; + if (!data) + return; + const labels = name.split("."); + if (contract || labels.length === 1) { + const singleOwner = singleContractOwnerDecode(data); + const obj = { + ownershipLevel: contract || "registry" + }; + if (contract === "registrar") { + return { + ...obj, + registrant: singleOwner + }; + } + return { + ...obj, + owner: singleOwner + }; + } + const result = await multicallWrapper.decode(data); + if (!result) + return; + const nameWrapper = await (contracts == null ? void 0 : contracts.getNameWrapper()); + const decodedData = [result[0][1], result[1][1], (_a = result[2]) == null ? void 0 : _a[1]].map( + (ret) => ret && ret !== "0x" && import_abi_coder.defaultAbiCoder.decode(["address"], ret) + ); + const registryOwner = decodedData[0][0]; + const nameWrapperOwner = decodedData[1][0]; + let registrarOwner = (_b = decodedData[2]) == null ? void 0 : _b[0]; + let baseReturnObject = {}; + if (labels[labels.length - 1] === "eth") { + if (labels.length === 2) { + if (!registrarOwner) { + const graphRegistrantResult = await gqlInstance.client.request( + registrantQuery, + { + namehash: (0, import_normalise.namehash)(name) + } + ); + registrarOwner = (_e = (_d = (_c = graphRegistrantResult.domain) == null ? void 0 : _c.registration) == null ? void 0 : _d.registrant) == null ? void 0 : _e.id; + baseReturnObject = { + expired: true + }; + } else { + baseReturnObject = { + expired: false + }; + } + } + if ((registrarOwner == null ? void 0 : registrarOwner.toLowerCase()) === nameWrapper.address.toLowerCase()) { + return { + owner: nameWrapperOwner, + ownershipLevel: "nameWrapper", + ...baseReturnObject + }; + } + if (registrarOwner) { + return { + registrant: registrarOwner, + owner: registryOwner, + ownershipLevel: "registrar", + ...baseReturnObject + }; + } + if ((0, import_bytes.hexStripZeros)(registryOwner) !== "0x") { + if (labels.length === 2) { + return { + registrant: void 0, + owner: registryOwner, + ownershipLevel: "registrar", + expired: true + }; + } + if (registryOwner === nameWrapper.address && nameWrapperOwner && (0, import_bytes.hexStripZeros)(nameWrapperOwner) !== "0x") { + return { + owner: nameWrapperOwner, + ownershipLevel: "nameWrapper" + }; + } + return { + owner: registryOwner, + ownershipLevel: "registry" + }; + } + return; + } + if (registryOwner === nameWrapper.address && nameWrapperOwner && (0, import_bytes.hexStripZeros)(nameWrapperOwner) !== "0x") { + return { + owner: nameWrapperOwner, + ownershipLevel: "nameWrapper" + }; + } + if ((0, import_bytes.hexStripZeros)(registryOwner) !== "0x") { + return { + owner: registryOwner, + ownershipLevel: "registry" + }; + } + return; +}; +var getOwner_default = { raw, decode }; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/getPrice.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getPrice.js new file mode 100644 index 000000000..384054cca --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getPrice.js @@ -0,0 +1,126 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var getPrice_exports = {}; +__export(getPrice_exports, { + default: () => getPrice_default +}); +module.exports = __toCommonJS(getPrice_exports); +var import_abi_coder = require("@ethersproject/abi/lib/abi-coder"); +var import_bignumber = require("@ethersproject/bignumber/lib/bignumber"); +const raw = async ({ contracts, multicallWrapper }, nameOrNames, duration, legacy) => { + const names = Array.isArray(nameOrNames) ? nameOrNames : [nameOrNames]; + if (names.length > 1) { + const bulkRenewal = await (contracts == null ? void 0 : contracts.getBulkRenewal()); + const baseCall2 = { + to: bulkRenewal.address, + data: bulkRenewal.interface.encodeFunctionData("rentPrice", [ + names, + duration + ]) + }; + if (legacy) { + return multicallWrapper.raw([ + baseCall2, + { + to: bulkRenewal.address, + data: bulkRenewal.interface.encodeFunctionData("rentPrice", [ + names, + 0 + ]) + } + ]); + } + return baseCall2; + } + const controller = await (contracts == null ? void 0 : contracts.getEthRegistrarController()); + const baseCall = { + to: controller.address, + data: controller.interface.encodeFunctionData("rentPrice", [ + names[0], + duration + ]) + }; + if (legacy) { + return multicallWrapper.raw([ + baseCall, + { + to: controller.address, + data: controller.interface.encodeFunctionData("rentPrice", [ + names[0], + 0 + ]) + } + ]); + } + return baseCall; +}; +const decode = async ({ contracts, multicallWrapper }, data, _nameOrNames, _duration, legacy) => { + if (data === null) + return; + try { + let base; + let premium; + const isBulkRenewal = Array.isArray(_nameOrNames) && _nameOrNames.length > 1; + if (isBulkRenewal && legacy) { + const result = await multicallWrapper.decode(data); + const [price] = import_abi_coder.defaultAbiCoder.decode( + ["uint256"], + result[0].returnData + ); + [premium] = import_abi_coder.defaultAbiCoder.decode( + ["uint256"], + result[1].returnData + ); + base = price.sub(premium); + } else if (isBulkRenewal) { + const bulkRenewal = await (contracts == null ? void 0 : contracts.getBulkRenewal()); + const result = bulkRenewal.interface.decodeFunctionResult( + "rentPrice", + data + ); + [base] = result; + premium = import_bignumber.BigNumber.from(0); + } else if (!isBulkRenewal && legacy) { + const result = await multicallWrapper.decode(data); + const [price] = import_abi_coder.defaultAbiCoder.decode( + ["uint256"], + result[0].returnData + ); + [premium] = import_abi_coder.defaultAbiCoder.decode( + ["uint256"], + result[1].returnData + ); + base = price.sub(premium); + } else { + const controller = await (contracts == null ? void 0 : contracts.getEthRegistrarController()); + const result = controller.interface.decodeFunctionResult( + "rentPrice", + data + ); + [base, premium] = result[0]; + } + return { + base, + premium + }; + } catch { + return; + } +}; +var getPrice_default = { raw, decode }; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/getProfile.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getProfile.js new file mode 100644 index 000000000..717805cfb --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getProfile.js @@ -0,0 +1,498 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var getProfile_exports = {}; +__export(getProfile_exports, { + default: () => getProfile_default +}); +module.exports = __toCommonJS(getProfile_exports); +var import_address_encoder = require("@ensdomains/address-encoder"); +var import_abi_coder = require("@ethersproject/abi/lib/abi-coder"); +var import_bytes = require("@ethersproject/bytes"); +var import_contentHash = require("../utils/contentHash"); +var import_hexEncodedName = require("../utils/hexEncodedName"); +var import_normalise = require("../utils/normalise"); +var import_validation = require("../utils/validation"); +const makeMulticallData = async ({ + _getAddr, + _getContentHash, + _getText +}, name, options) => { + let calls = []; + if (options.texts) + calls = [ + ...calls, + ...await Promise.all( + options.texts.map(async (x) => ({ + key: x, + data: await _getText.raw(name, x), + type: "text" + })) + ) + ]; + if (options.coinTypes) + calls = [ + ...calls, + ...await Promise.all( + options.coinTypes.map(async (x) => ({ + key: x, + data: await _getAddr.raw(name, x, true), + type: "addr" + })) + ) + ]; + if (typeof options.contentHash === "boolean" && options.contentHash) { + calls.push({ + key: "contentHash", + data: await _getContentHash.raw(name), + type: "contentHash" + }); + } + if (!calls.find((x) => x.key === "60")) { + calls.push({ + key: "60", + data: await _getAddr.raw(name, "60", true), + type: "addr" + }); + } + return { data: calls.map((x) => x.data.data), calls }; +}; +const fetchWithoutResolverMulticall = async ({ multicallWrapper }, calls, resolverAddress) => { + const callsWithResolver = calls.map((call) => ({ + to: resolverAddress, + data: call.data.data + })); + const results = await multicallWrapper(callsWithResolver); + if (!results || !results.length) + return []; + return results.map((x) => x[1]); +}; +const formatRecords = async ({ + _getText, + _getAddr, + _getContentHash +}, data, calls, options) => { + const returnedRecords = (await Promise.all( + data.map(async (item, i) => { + let decodedFromAbi; + let itemRet = { + key: calls[i].key, + type: calls[i].type + }; + if (itemRet.type === "contentHash") { + ; + [decodedFromAbi] = import_abi_coder.defaultAbiCoder.decode(["bytes"], item); + if ((0, import_bytes.hexStripZeros)(decodedFromAbi) === "0x") { + return; + } + } + switch (calls[i].type) { + case "text": + itemRet = { + ...itemRet, + value: await _getText.decode(item) + }; + if (itemRet.value === "" || itemRet.value === void 0) + return; + break; + case "addr": + try { + const addr = await _getAddr.decode(item, "", calls[i].key); + if (addr) { + itemRet = { + ...itemRet, + ...addr + }; + break; + } else { + return; + } + } catch { + return; + } + case "contentHash": + try { + itemRet = { + ...itemRet, + value: await _getContentHash.decode(item) + }; + break; + } catch { + return; + } + } + return itemRet; + }) + )).filter((x) => { + return typeof x === "object"; + }).filter((x) => x); + const returnedResponse = {}; + if (typeof options.contentHash === "string" || typeof options.contentHash === "object") { + if (typeof options.contentHash === "string" && (0, import_bytes.hexStripZeros)(options.contentHash) === "0x") { + returnedResponse.contentHash = null; + } else if ((0, import_bytes.isBytesLike)(options.contentHash.decoded) && (0, import_bytes.hexStripZeros)(options.contentHash.decoded) === "0x") { + returnedResponse.contentHash = null; + } else { + returnedResponse.contentHash = options.contentHash; + } + } else if (options.contentHash) { + const foundRecord = returnedRecords.find( + (item) => item.type === "contentHash" + ); + returnedResponse.contentHash = foundRecord ? foundRecord.value : null; + } + if (options.texts) { + returnedResponse.texts = returnedRecords.filter( + (x) => x.type === "text" + ); + } + if (options.coinTypes) { + returnedResponse.coinTypes = returnedRecords.filter( + (x) => x.type === "addr" + ); + } + return returnedResponse; +}; +const getDataForName = async ({ + contracts, + _getAddr, + _getContentHash, + _getText, + multicallWrapper +}, name, options, specificResolver) => { + const universalResolver = await (contracts == null ? void 0 : contracts.getUniversalResolver()); + const { data, calls } = await makeMulticallData( + { _getAddr, _getContentHash, _getText }, + name, + options + ); + let recordData; + let resolverAddress = specificResolver; + if (specificResolver) { + try { + const publicResolver = await (contracts == null ? void 0 : contracts.getPublicResolver( + void 0, + specificResolver + )); + recordData = await (publicResolver == null ? void 0 : publicResolver.callStatic.multicall(data)); + } catch (e) { + console.error("getProfile error:", e); + recordData = await fetchWithoutResolverMulticall( + { multicallWrapper }, + calls, + resolverAddress + ); + } + } else { + try { + const resolvedData = await universalResolver["resolve(bytes,bytes[])"]( + (0, import_hexEncodedName.hexEncodeName)(name), + data, + { + ccipReadEnabled: true + } + ); + recordData = [...resolvedData["0"]]; + resolverAddress = resolvedData["1"]; + for (let i = 0; i < recordData.length; i += 1) { + if (recordData[i].startsWith("0x0d1947a9")) { + calls[i] = null; + recordData[i] = null; + } + } + } catch { + const registryContract = await (contracts == null ? void 0 : contracts.getRegistry()); + resolverAddress = await (registryContract == null ? void 0 : registryContract.resolver((0, import_normalise.namehash)(name))); + return { + address: void 0, + records: {}, + resolverAddress, + isInvalidResolverAddress: true + }; + } + } + if (!resolverAddress || !recordData || (0, import_bytes.hexStripZeros)(resolverAddress) === "0x") { + return { + address: void 0, + records: {}, + resolverAddress: void 0 + }; + } + const filteredCalls = calls.filter((x) => x); + const filteredRecordData = recordData.filter((x) => x); + const matchAddress = filteredRecordData[filteredCalls.findIndex((x) => x.key === "60")]; + return { + address: matchAddress && await _getAddr.decode(matchAddress).catch(() => false), + records: await formatRecords( + { _getAddr, _getContentHash, _getText }, + filteredRecordData, + filteredCalls, + options + ), + resolverAddress + }; +}; +const graphFetch = async ({ gqlInstance }, name, wantedRecords, resolverAddress) => { + const query = gqlInstance.gql` + query getRecords($id: String!) { + domain(id: $id) { + isMigrated + createdAt + resolver { + texts + coinTypes + contentHash + addr { + id + } + } + } + } + `; + const customResolverQuery = gqlInstance.gql` + query getRecordsWithCustomResolver($id: String!, $resolverId: String!) { + domain(id: $id) { + isMigrated + createdAt + } + resolver(id: $resolverId) { + texts + coinTypes + contentHash + addr { + id + } + } + } + `; + const { client } = gqlInstance; + const id = (0, import_normalise.namehash)(name); + let domain; + let resolverResponse; + if (!resolverAddress) { + const response = await client.request(query, { id }); + domain = response == null ? void 0 : response.domain; + resolverResponse = domain == null ? void 0 : domain.resolver; + } else { + const resolverId = `${resolverAddress.toLowerCase()}-${id}`; + const response = await client.request(customResolverQuery, { + id, + resolverId + }); + resolverResponse = response == null ? void 0 : response.resolver; + domain = response == null ? void 0 : response.domain; + } + if (!domain) + return; + const { isMigrated, createdAt } = domain; + const returnedRecords = {}; + if (!resolverResponse || !wantedRecords) + return { isMigrated, createdAt }; + Object.keys(wantedRecords).forEach((key) => { + const data = wantedRecords[key]; + if (typeof data === "boolean" && data) { + if (key === "contentHash") { + returnedRecords[key] = (0, import_contentHash.decodeContenthash)(resolverResponse.contentHash); + } else { + returnedRecords[key] = resolverResponse[key]; + } + } + }); + return { + ...returnedRecords, + isMigrated, + createdAt + }; +}; +const getProfileFromName = async ({ + contracts, + gqlInstance, + _getAddr, + _getContentHash, + _getText, + resolverMulticallWrapper, + multicallWrapper +}, name, options) => { + const { resolverAddress, fallback, ..._options } = options || {}; + const optsLength = Object.keys(_options).length; + let usingOptions; + if (!optsLength || (_options == null ? void 0 : _options.texts) === true || (_options == null ? void 0 : _options.coinTypes) === true) { + if (optsLength) + usingOptions = _options; + else + usingOptions = { contentHash: true, texts: true, coinTypes: true }; + } + const graphResult = await graphFetch( + { gqlInstance }, + name, + usingOptions, + resolverAddress + ); + let isMigrated = null; + let createdAt = null; + let result = null; + if (!graphResult) { + if (!fallback) + return; + result = await getDataForName( + { + contracts, + _getAddr, + _getContentHash, + _getText, + resolverMulticallWrapper, + multicallWrapper + }, + name, + fallback, + void 0 + ); + } else { + const { + isMigrated: _isMigrated, + createdAt: _createdAt, + ...wantedRecords + } = graphResult; + isMigrated = _isMigrated; + createdAt = _createdAt; + let recordsWithFallback = usingOptions ? wantedRecords : _options; + if ((Object.keys(recordsWithFallback).length === 0 || !recordsWithFallback.coinTypes && !recordsWithFallback.texts && Object.keys(recordsWithFallback.contentHash || {}).length === 0) && fallback) { + recordsWithFallback = fallback; + } + result = await getDataForName( + { + contracts, + _getAddr, + _getContentHash, + _getText, + resolverMulticallWrapper, + multicallWrapper + }, + name, + recordsWithFallback, + options == null ? void 0 : options.resolverAddress + ); + } + if (!(result == null ? void 0 : result.resolverAddress)) + return { + isMigrated, + createdAt, + message: !result ? "Records fetch didn't complete" : "Name doesn't have a resolver" + }; + return { ...result, isMigrated, createdAt, message: void 0 }; +}; +const getProfileFromAddress = async ({ + contracts, + gqlInstance, + getName, + _getAddr, + _getContentHash, + _getText, + resolverMulticallWrapper, + multicallWrapper +}, address, options) => { + let name; + try { + name = await getName(address); + } catch (e) { + return; + } + if (!name || !name.name || name.name === "") + return; + if (!name.match) + return { ...name, isMigrated: null, createdAt: null }; + const result = await getProfileFromName( + { + contracts, + gqlInstance, + _getAddr, + _getContentHash, + _getText, + resolverMulticallWrapper, + multicallWrapper + }, + name.name, + options + ); + if (!result || result.message) + return; + delete result.address; + return { + ...result, + ...name, + message: void 0 + }; +}; +const mapCoinTypes = (coin) => { + if (!Number.isNaN(parseInt(coin))) { + return coin; + } + return `${import_address_encoder.formatsByName[coin.toUpperCase()].coinType}`; +}; +async function getProfile_default({ + contracts, + gqlInstance, + getName, + _getAddr, + _getContentHash, + _getText, + resolverMulticallWrapper, + multicallWrapper +}, nameOrAddress, options) { + if (options) { + if (options.coinTypes && typeof options.coinTypes !== "boolean") { + options.coinTypes = options.coinTypes.map(mapCoinTypes); + } + if (options.fallback && options.fallback.coinTypes) { + options.fallback.coinTypes = options.fallback.coinTypes.map(mapCoinTypes); + } + } + const inputType = (0, import_validation.parseInputType)(nameOrAddress); + if (inputType.type === "unknown" || inputType.info === "unsupported") { + throw new Error("Invalid input type"); + } + if (inputType.type === "address") { + return getProfileFromAddress( + { + contracts, + gqlInstance, + getName, + _getAddr, + _getContentHash, + _getText, + resolverMulticallWrapper, + multicallWrapper + }, + nameOrAddress, + options + ); + } + return getProfileFromName( + { + contracts, + gqlInstance, + _getAddr, + _getContentHash, + _getText, + resolverMulticallWrapper, + multicallWrapper + }, + nameOrAddress, + options + ); +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/getRecords.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getRecords.js new file mode 100644 index 000000000..aa2bd407e --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getRecords.js @@ -0,0 +1,31 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var getRecords_exports = {}; +__export(getRecords_exports, { + default: () => getRecords_default +}); +module.exports = __toCommonJS(getRecords_exports); +var import_validation = require("../utils/validation"); +async function getRecords_default({ getProfile }, name, options) { + const inputType = (0, import_validation.parseInputType)(name); + if (inputType.type !== "name" && inputType.type !== "label") { + throw new Error("Input must be an ENS name"); + } + return getProfile(name, options); +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/getResolver.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getResolver.js new file mode 100644 index 000000000..84fe80641 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getResolver.js @@ -0,0 +1,46 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var getResolver_exports = {}; +__export(getResolver_exports, { + default: () => getResolver_default +}); +module.exports = __toCommonJS(getResolver_exports); +var import_bytes = require("@ethersproject/bytes"); +var import_hexEncodedName = require("../utils/hexEncodedName"); +const raw = async ({ contracts }, name) => { + const universalResolver = await (contracts == null ? void 0 : contracts.getUniversalResolver()); + return { + to: universalResolver.address, + data: universalResolver.interface.encodeFunctionData("findResolver", [ + (0, import_hexEncodedName.hexEncodeName)(name) + ]) + }; +}; +const decode = async ({ contracts }, data) => { + const universalResolver = await (contracts == null ? void 0 : contracts.getUniversalResolver()); + const response = universalResolver.interface.decodeFunctionResult( + "findResolver", + data + ); + if (!response || !response[0] || (0, import_bytes.hexStripZeros)(response[0]) === "0x") { + return; + } + return response[0]; +}; +var getResolver_default = { raw, decode }; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/getSpecificRecord.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getSpecificRecord.js new file mode 100644 index 000000000..c5e8ce5e4 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getSpecificRecord.js @@ -0,0 +1,278 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var getSpecificRecord_exports = {}; +__export(getSpecificRecord_exports, { + _getABI: () => _getABI, + _getAddr: () => _getAddr, + _getContentHash: () => _getContentHash, + _getText: () => _getText, + getABI: () => getABI, + getAddr: () => getAddr, + getContentHash: () => getContentHash, + getText: () => getText +}); +module.exports = __toCommonJS(getSpecificRecord_exports); +var import_address_encoder = require("@ensdomains/address-encoder"); +var import_bytes = require("@ethersproject/bytes"); +var import_strings = require("@ethersproject/strings"); +var import_contentHash = require("../utils/contentHash"); +var import_normalise = require("../utils/normalise"); +const _getContentHash = { + raw: async ({ contracts }, name) => { + const publicResolver = await (contracts == null ? void 0 : contracts.getPublicResolver()); + return { + to: "0x0000000000000000000000000000000000000000", + data: publicResolver.interface.encodeFunctionData("contenthash", [ + (0, import_normalise.namehash)(name) + ]) + }; + }, + decode: async ({ contracts }, data) => { + let response; + const publicResolver = await (contracts == null ? void 0 : contracts.getPublicResolver()); + try { + ; + [response] = publicResolver.interface.decodeFunctionResult( + "contenthash", + data + ); + } catch { + return; + } + if (!response) { + return; + } + const decodedContent = (0, import_contentHash.decodeContenthash)(response); + if (!decodedContent || (0, import_bytes.isBytesLike)(decodedContent.decoded) && (0, import_bytes.hexStripZeros)(decodedContent.decoded) === "0x" || Object.keys(decodedContent).length === 0) { + return; + } + return decodedContent; + } +}; +const getContentHash = { + raw: async ({ contracts, universalWrapper }, name) => { + const prData = await _getContentHash.raw({ contracts }, name); + return universalWrapper.raw(name, prData.data); + }, + decode: async ({ contracts, universalWrapper }, data) => { + const urData = await universalWrapper.decode(data); + if (!urData) + return; + return _getContentHash.decode({ contracts }, urData.data); + } +}; +const _getText = { + raw: async ({ contracts }, name, key) => { + const publicResolver = await (contracts == null ? void 0 : contracts.getPublicResolver()); + return { + to: "0x0000000000000000000000000000000000000000", + data: publicResolver.interface.encodeFunctionData("text", [ + (0, import_normalise.namehash)(name), + key + ]) + }; + }, + decode: async ({ contracts }, data) => { + const publicResolver = await (contracts == null ? void 0 : contracts.getPublicResolver()); + const [response] = publicResolver.interface.decodeFunctionResult( + "text", + data + ); + if (!response) { + return; + } + return response; + } +}; +const getText = { + raw: async ({ contracts, universalWrapper }, name, key) => { + const prData = await _getText.raw({ contracts }, name, key); + return universalWrapper.raw(name, prData.data); + }, + decode: async ({ contracts, universalWrapper }, data) => { + const urData = await universalWrapper.decode(data); + if (!urData) + return; + return _getText.decode({ contracts }, urData.data); + } +}; +const _getAddr = { + raw: async ({ contracts }, name, coinType, bypassFormat) => { + if (!coinType) { + coinType = 60; + } + const publicResolver = await (contracts == null ? void 0 : contracts.getPublicResolver()); + if (coinType === 60 || coinType === "60") { + return { + to: "0x0000000000000000000000000000000000000000", + data: publicResolver.interface.encodeFunctionData("addr(bytes32)", [ + (0, import_normalise.namehash)(name) + ]) + }; + } + if (bypassFormat) { + return { + to: "0x0000000000000000000000000000000000000000", + data: publicResolver.interface.encodeFunctionData( + "addr(bytes32,uint256)", + [(0, import_normalise.namehash)(name), coinType] + ) + }; + } + const formatter = typeof coinType === "string" && Number.isNaN(parseInt(coinType)) ? import_address_encoder.formatsByName[coinType] : import_address_encoder.formatsByCoinType[typeof coinType === "number" ? coinType : parseInt(coinType)]; + if (!formatter) { + throw new Error(`No formatter found for coin: ${coinType}`); + } + return { + to: "0x0000000000000000000000000000000000000000", + data: publicResolver.interface.encodeFunctionData( + "addr(bytes32,uint256)", + [(0, import_normalise.namehash)(name), formatter.coinType] + ) + }; + }, + decode: async ({ contracts }, data, _name, coinType) => { + let returnCoinType = true; + if (!coinType) { + coinType = 60; + returnCoinType = false; + } + const publicResolver = await (contracts == null ? void 0 : contracts.getPublicResolver()); + const formatter = typeof coinType === "string" && Number.isNaN(parseInt(coinType)) ? import_address_encoder.formatsByName[coinType] : import_address_encoder.formatsByCoinType[typeof coinType === "number" ? coinType : parseInt(coinType)]; + let response; + if (coinType === 60 || coinType === "60") { + ; + [response] = publicResolver.interface.decodeFunctionResult( + "addr(bytes32)", + data + ); + } else { + ; + [response] = publicResolver.interface.decodeFunctionResult( + "addr(bytes32,uint256)", + data + ); + } + if (!response) + return; + if ((0, import_bytes.hexStripZeros)(response) === "0x") { + return; + } + const decodedAddr = formatter.encoder(Buffer.from(response.slice(2), "hex")); + if (!decodedAddr) { + return; + } + if (!returnCoinType) { + return decodedAddr; + } + return { coin: formatter.name, addr: decodedAddr }; + } +}; +const getAddr = { + raw: async ({ contracts, universalWrapper }, name, coinType) => { + const prData = await _getAddr.raw({ contracts }, name, coinType); + return universalWrapper.raw(name, prData.data); + }, + decode: async ({ contracts, universalWrapper }, data, _name, coinType) => { + const urData = await universalWrapper.decode(data); + if (!urData) + return; + return _getAddr.decode({ contracts }, urData.data, _name, coinType); + } +}; +const supportedContentTypes = "0xf"; +const _getABI = { + raw: async ({ contracts }, name) => { + const publicResolver = await (contracts == null ? void 0 : contracts.getPublicResolver()); + return { + to: "0x0000000000000000000000000000000000000000", + data: publicResolver.interface.encodeFunctionData("ABI", [ + (0, import_normalise.namehash)(name), + supportedContentTypes + ]) + }; + }, + decode: async ({ contracts }, data) => { + const publicResolver = await (contracts == null ? void 0 : contracts.getPublicResolver()); + const [bnContentType, encodedABIData] = publicResolver.interface.decodeFunctionResult("ABI", data); + if (!bnContentType || !data) { + return; + } + const contentType = bnContentType.toNumber(); + if (!contentType) { + return; + } + let abiData; + let decoded = false; + switch (contentType) { + case 1: + abiData = JSON.parse((0, import_strings.toUtf8String)(encodedABIData)); + decoded = true; + break; + case 2: { + const { inflate } = await import("pako/dist/pako_inflate.min.js"); + abiData = JSON.parse( + inflate((0, import_bytes.arrayify)(encodedABIData), { to: "string" }) + ); + decoded = true; + break; + } + case 4: { + const { decodeFirst } = await import("cbor"); + abiData = await decodeFirst((0, import_bytes.arrayify)(encodedABIData)); + decoded = true; + break; + } + case 8: + abiData = (0, import_strings.toUtf8String)(encodedABIData); + decoded = false; + break; + default: + try { + abiData = (0, import_strings.toUtf8String)(encodedABIData); + } catch { + abiData = encodedABIData; + } + decoded = false; + } + return { + contentType, + decoded, + abi: abiData + }; + } +}; +const getABI = { + raw: async ({ contracts, universalWrapper }, name) => { + const prData = await _getABI.raw({ contracts }, name); + return universalWrapper.raw(name, prData.data); + }, + decode: async ({ contracts, universalWrapper }, data) => { + const urData = await universalWrapper.decode(data); + if (!urData) + return; + return _getABI.decode({ contracts }, urData.data); + } +}; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/getSubnames.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getSubnames.js new file mode 100644 index 000000000..b0207f2d6 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getSubnames.js @@ -0,0 +1,111 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var getSubnames_exports = {}; +__export(getSubnames_exports, { + default: () => getSubnames_default +}); +module.exports = __toCommonJS(getSubnames_exports); +var import_format = require("../utils/format"); +var import_labels = require("../utils/labels"); +var import_normalise = require("../utils/normalise"); +const largeQuery = async ({ gqlInstance }, { + name, + pageSize = 10, + orderDirection, + orderBy, + lastSubnames = [], + search = "" +}) => { + const { client } = gqlInstance; + const lastSubname = lastSubnames == null ? void 0 : lastSubnames[lastSubnames.length - 1]; + const lastCreatedAt = lastSubname == null ? void 0 : lastSubname.createdAt; + const lastLabelName = lastSubname == null ? void 0 : lastSubname.labelName; + let whereFilter = ""; + if (orderBy === "createdAt" && lastCreatedAt) { + whereFilter += orderDirection === "asc" ? "createdAt_gt: $lastCreatedAt" : "createdAt_lt: $lastCreatedAt"; + } else if (orderBy === "labelName" && lastLabelName) { + whereFilter += orderDirection === "asc" ? "labelName_gt: $lastLabelName" : "labelName_lt: $lastLabelName"; + } + if (search) { + whereFilter += " labelName_contains: $search"; + } + const finalQuery = gqlInstance.gql` + query getSubnames( + $id: ID! + $first: Int + $lastCreatedAt: BigInt + $lastLabelName: String + $orderBy: Domain_orderBy + $orderDirection: OrderDirection + $search: String + ) { + domain( + id: $id + ) { + subdomainCount + subdomains( + first: $first + orderBy: $orderBy + orderDirection: $orderDirection + where: { + ${whereFilter} + } + ) { + id + labelName + labelhash + isMigrated + name + subdomainCount + createdAt + owner { + id + } + } + } + } + `; + const queryVars = { + id: (0, import_normalise.namehash)(name), + first: pageSize, + lastCreatedAt, + lastLabelName, + orderBy, + orderDirection, + search: search == null ? void 0 : search.toLowerCase() + }; + const response = await client.request(finalQuery, queryVars); + const domain = response == null ? void 0 : response.domain; + const subdomains = domain.subdomains.map((subname) => { + const decrypted = (0, import_labels.decryptName)(subname.name); + return { + ...subname, + name: decrypted, + truncatedName: (0, import_format.truncateFormat)(decrypted) + }; + }); + return { + subnames: subdomains, + subnameCount: domain.subdomainCount + }; +}; +const getSubnames = (injected, functionArgs) => { + return largeQuery(injected, functionArgs); +}; +var getSubnames_default = getSubnames; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/getWrapperData.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getWrapperData.js new file mode 100644 index 000000000..b2ad2bf04 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/getWrapperData.js @@ -0,0 +1,56 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var getWrapperData_exports = {}; +__export(getWrapperData_exports, { + default: () => getWrapperData_default +}); +module.exports = __toCommonJS(getWrapperData_exports); +var import_fuses = require("../utils/fuses"); +var import_normalise = require("../utils/normalise"); +const raw = async ({ contracts }, name) => { + const nameWrapper = await (contracts == null ? void 0 : contracts.getNameWrapper()); + return { + to: nameWrapper.address, + data: nameWrapper.interface.encodeFunctionData("getData", [(0, import_normalise.namehash)(name)]) + }; +}; +const decode = async ({ contracts }, data) => { + const nameWrapper = await (contracts == null ? void 0 : contracts.getNameWrapper()); + try { + const [owner, fuses, expiry] = nameWrapper.interface.decodeFunctionResult( + "getData", + data + ); + const fuseObj = (0, import_fuses.decodeFuses)(fuses); + const expiryDate = expiry.gt(0) ? new Date(expiry.toNumber() * 1e3) : void 0; + return { + ...fuseObj, + expiryDate, + rawFuses: fuses, + owner + }; + } catch (e) { + console.error("Error decoding wrapper data: ", e); + return; + } +}; +var getWrapperData_default = { + raw, + decode +}; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/importDNSSECName.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/importDNSSECName.js new file mode 100644 index 000000000..315fed75d --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/importDNSSECName.js @@ -0,0 +1,65 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var importDNSSECName_exports = {}; +__export(importDNSSECName_exports, { + DNS_OVER_HTTP_ENDPOINT: () => DNS_OVER_HTTP_ENDPOINT, + default: () => importDNSSECName_default +}); +module.exports = __toCommonJS(importDNSSECName_exports); +var import_dnssecoraclejs = require("@ensdomains/dnssecoraclejs"); +var import_dns_packet = __toESM(require("dns-packet")); +var import_consts = require("../utils/consts"); +const DNS_OVER_HTTP_ENDPOINT = "https://1.1.1.1/dns-query"; +async function importDNSSECName_default({ contracts, provider }, name, { address, proverResult }) { + const dnsRegistrarContract = await (contracts == null ? void 0 : contracts.getDNSRegistrar()); + const resolverContract = await (contracts == null ? void 0 : contracts.getPublicResolver()); + const registrarOracle = await (dnsRegistrarContract == null ? void 0 : dnsRegistrarContract.oracle()); + if (!registrarOracle) { + throw new Error("No oracle found"); + } + const oracle = new import_dnssecoraclejs.Oracle(registrarOracle, provider); + const proofData = await oracle.getProofData(proverResult); + const encodedName = `0x${import_dns_packet.default.name.encode(name).toString("hex")}`; + const data = proofData.rrsets.map( + (x) => Object.values(x) + ); + const { proof } = proofData; + if (address === import_consts.EMPTY_ADDRESS) { + return dnsRegistrarContract == null ? void 0 : dnsRegistrarContract.populateTransaction.proveAndClaim( + encodedName, + data, + proof + ); + } + if (address) { + return dnsRegistrarContract == null ? void 0 : dnsRegistrarContract.populateTransaction.proveAndClaimWithResolver( + encodedName, + data, + proof, + resolverContract.address, + address + ); + } +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/initialGetters.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/initialGetters.js new file mode 100644 index 000000000..97dd632de --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/initialGetters.js @@ -0,0 +1,51 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default")); +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var initialGetters_exports = {}; +__export(initialGetters_exports, { + batch: () => import_batch.default, + getExpiry: () => import_getExpiry.default, + getName: () => import_getName.default, + getNames: () => import_getNames.default, + getOwner: () => import_getOwner.default, + getPrice: () => import_getPrice.default, + getProfile: () => import_getProfile.default, + getRecords: () => import_getRecords.default, + getSubnames: () => import_getSubnames.default, + supportsTLD: () => import_supportsTLD.default +}); +module.exports = __toCommonJS(initialGetters_exports); +var import_batch = __toESM(require("./batch")); +__reExport(initialGetters_exports, require("./batchWrappers"), module.exports); +var import_getExpiry = __toESM(require("./getExpiry")); +var import_getName = __toESM(require("./getName")); +var import_getNames = __toESM(require("./getNames")); +var import_getOwner = __toESM(require("./getOwner")); +var import_getPrice = __toESM(require("./getPrice")); +var import_getProfile = __toESM(require("./getProfile")); +var import_getRecords = __toESM(require("./getRecords")); +__reExport(initialGetters_exports, require("./getSpecificRecord"), module.exports); +var import_getSubnames = __toESM(require("./getSubnames")); +var import_supportsTLD = __toESM(require("./supportsTLD")); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/registerName.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/registerName.js new file mode 100644 index 000000000..590e46bec --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/registerName.js @@ -0,0 +1,44 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var registerName_exports = {}; +__export(registerName_exports, { + default: () => registerName_default +}); +module.exports = __toCommonJS(registerName_exports); +var import_registerHelpers = require("../utils/registerHelpers"); +var import_wrapper = require("../utils/wrapper"); +async function registerName_default({ contracts }, name, { resolverAddress, value, ...params }) { + const labels = name.split("."); + if (labels.length !== 2 || labels[1] !== "eth") + throw new Error("Currently only .eth TLD registrations are supported"); + (0, import_wrapper.wrappedLabelLengthCheck)(labels[0]); + const controller = await contracts.getEthRegistrarController(); + const _resolver = await contracts.getPublicResolver( + void 0, + resolverAddress + ); + const generatedParams = (0, import_registerHelpers.makeRegistrationData)({ + name, + resolver: _resolver, + ...params + }); + return controller.populateTransaction.register(...generatedParams, { + value + }); +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/renewNames.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/renewNames.js new file mode 100644 index 000000000..779361a52 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/renewNames.js @@ -0,0 +1,55 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var renewNames_exports = {}; +__export(renewNames_exports, { + default: () => renewNames_default, + extendWrappedName: () => extendWrappedName +}); +module.exports = __toCommonJS(renewNames_exports); +var import_consts = require("../utils/consts"); +var import_labels = require("../utils/labels"); +var import_normalise = require("../utils/normalise"); +async function extendWrappedName({ contracts }, name, options) { + const expiry = (options == null ? void 0 : options.duration) || import_consts.MAX_INT_64; + const labels = name.split("."); + const labelHash = (0, import_labels.labelhash)(labels.shift()); + const parentNode = (0, import_normalise.namehash)(labels.join(".")); + const nameWrapper = await contracts.getNameWrapper(); + return nameWrapper.populateTransaction.extendExpiry( + parentNode, + labelHash, + expiry + ); +} +async function renewNames_default({ contracts }, nameOrNames, { duration, value }) { + const names = Array.isArray(nameOrNames) ? nameOrNames : [nameOrNames]; + const labels = names.map((name) => { + const label = name.split("."); + if (label.length !== 2 || label[1] !== "eth") { + throw new Error("Currently only .eth TLD renewals are supported"); + } + return label[0]; + }); + if (labels.length === 1) { + const controller = await contracts.getEthRegistrarController(); + return controller.populateTransaction.renew(labels[0], duration, { value }); + } + const bulkRenewal = await contracts.getBulkRenewal(); + return bulkRenewal.populateTransaction.renewAll(labels, duration, { value }); +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/setFuses.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/setFuses.js new file mode 100644 index 000000000..0d3a76321 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/setFuses.js @@ -0,0 +1,49 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var setFuses_exports = {}; +__export(setFuses_exports, { + default: () => setFuses_default, + setChildFuses: () => setChildFuses +}); +module.exports = __toCommonJS(setFuses_exports); +var import_fuses = require("../utils/fuses"); +var import_labels = require("../utils/labels"); +var import_normalise = require("../utils/normalise"); +async function setChildFuses({ contracts, signer }, name, { + fuses, + expiry = 0 +}) { + const encodedFuses = (0, import_fuses.encodeFuses)(fuses); + const labels = name.split("."); + const labelHash = (0, import_labels.labelhash)(labels.shift()); + const parentNode = (0, import_normalise.namehash)(labels.join(".")); + const nameWrapper = (await contracts.getNameWrapper()).connect(signer); + return nameWrapper.populateTransaction.setChildFuses( + parentNode, + labelHash, + encodedFuses, + expiry + ); +} +async function setFuses_default({ contracts, signer }, name, props) { + const encodedFuses = (0, import_fuses.encodeFuses)(props, "child"); + const nameWrapper = (await contracts.getNameWrapper()).connect(signer); + const hash = (0, import_normalise.namehash)(name); + return nameWrapper.populateTransaction.setFuses(hash, encodedFuses); +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/setName.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/setName.js new file mode 100644 index 000000000..14636e95f --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/setName.js @@ -0,0 +1,43 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var setName_exports = {}; +__export(setName_exports, { + default: () => setName_default +}); +module.exports = __toCommonJS(setName_exports); +async function setName_default({ contracts, signer }, name, { + address, + resolver +} = {}) { + var _a; + const signerAddress = await signer.getAddress(); + const reverseRegistrar = (_a = await (contracts == null ? void 0 : contracts.getReverseRegistrar())) == null ? void 0 : _a.connect( + signer + ); + if (address) { + const publicResolver = await (contracts == null ? void 0 : contracts.getPublicResolver()); + return reverseRegistrar.populateTransaction.setNameForAddr( + address, + signerAddress, + resolver || publicResolver.address, + name + ); + } + return reverseRegistrar.populateTransaction.setName(name); +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/setRecord.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/setRecord.js new file mode 100644 index 000000000..759e426c4 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/setRecord.js @@ -0,0 +1,56 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var setRecord_exports = {}; +__export(setRecord_exports, { + default: () => setRecord_default +}); +module.exports = __toCommonJS(setRecord_exports); +var import_normalise = require("../utils/normalise"); +var import_recordHelpers = require("../utils/recordHelpers"); +async function setRecord_default({ + contracts, + provider, + getResolver, + signer +}, name, { + record, + type, + resolverAddress +}) { + var _a; + if (!name.includes(".")) { + throw new Error("Input is not an ENS name"); + } + let resolverToUse; + if (resolverAddress) { + resolverToUse = resolverAddress; + } else { + resolverToUse = await getResolver(name); + } + if (!resolverToUse) { + throw new Error("No resolver found for input address"); + } + const resolver = (_a = await (contracts == null ? void 0 : contracts.getPublicResolver(provider, resolverToUse))) == null ? void 0 : _a.connect(signer); + const hash = (0, import_normalise.namehash)(name); + const call = (0, import_recordHelpers.generateSingleRecordCall)(hash, resolver, type)(record); + return { + to: resolver.address, + data: call + }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/setRecords.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/setRecords.js new file mode 100644 index 000000000..0c9f751a1 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/setRecords.js @@ -0,0 +1,52 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var setRecords_exports = {}; +__export(setRecords_exports, { + default: () => setRecords_default +}); +module.exports = __toCommonJS(setRecords_exports); +var import_normalise = require("../utils/normalise"); +var import_recordHelpers = require("../utils/recordHelpers"); +async function setRecords_default({ + contracts, + provider, + getResolver, + signer +}, name, { + records, + resolverAddress +}) { + var _a; + if (!name.includes(".")) { + throw new Error("Input is not an ENS name"); + } + let resolverToUse; + if (resolverAddress) { + resolverToUse = resolverAddress; + } else { + resolverToUse = await getResolver(name); + } + if (!resolverToUse) { + throw new Error("No resolver found for input address"); + } + const resolver = (_a = await (contracts == null ? void 0 : contracts.getPublicResolver(provider, resolverToUse))) == null ? void 0 : _a.connect(signer); + const hash = (0, import_normalise.namehash)(name); + const calls = (0, import_recordHelpers.generateRecordCallArray)(hash, records, resolver); + return resolver.populateTransaction.multicall(calls); +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/setResolver.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/setResolver.js new file mode 100644 index 000000000..2d9db4706 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/setResolver.js @@ -0,0 +1,48 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var setResolver_exports = {}; +__export(setResolver_exports, { + default: () => setResolver_default +}); +module.exports = __toCommonJS(setResolver_exports); +var import_normalise = require("../utils/normalise"); +async function setResolver_default({ contracts, signer }, name, { + contract, + resolver +}) { + if (!resolver) { + resolver = (await contracts.getPublicResolver()).address; + } + switch (contract) { + case "registry": { + const registry = (await (contracts == null ? void 0 : contracts.getRegistry())).connect(signer); + return registry.populateTransaction.setResolver((0, import_normalise.namehash)(name), resolver); + } + case "nameWrapper": { + const nameWrapper = (await (contracts == null ? void 0 : contracts.getNameWrapper())).connect(signer); + return nameWrapper.populateTransaction.setResolver( + (0, import_normalise.namehash)(name), + resolver + ); + } + default: { + throw new Error(`Unknown contract: ${contract}`); + } + } +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/supportsTLD.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/supportsTLD.js new file mode 100644 index 000000000..4341ccd77 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/supportsTLD.js @@ -0,0 +1,48 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var supportsTLD_exports = {}; +__export(supportsTLD_exports, { + default: () => supportsTLD_default +}); +module.exports = __toCommonJS(supportsTLD_exports); +var import_DNSRegistrar_factory = require("../generated/factories/DNSRegistrar__factory"); +const DNSSEC_CLAIM_INTERFACE_IDS = ["0x2f435428", "0x17d8f49b", "0x1aa2e641"]; +async function supportsTLD_default({ getOwner, provider }, name) { + try { + const labels = name.split("."); + const tld = labels[labels.length - 1]; + if (tld === "eth") + return true; + const tldOwner = await getOwner(tld, "registry"); + if (!(tldOwner == null ? void 0 : tldOwner.owner)) + return false; + const dnsRegistrar = import_DNSRegistrar_factory.DNSRegistrar__factory.connect( + tldOwner.owner, + provider + ); + const supports = await Promise.all( + DNSSEC_CLAIM_INTERFACE_IDS.map( + (interfaceId) => dnsRegistrar.supportsInterface(interfaceId) + ) + ); + return supports.some((s) => !!s); + } catch { + return false; + } +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/transferController.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/transferController.js new file mode 100644 index 000000000..201b9eabc --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/transferController.js @@ -0,0 +1,42 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var transferController_exports = {}; +__export(transferController_exports, { + default: () => transferController_default +}); +module.exports = __toCommonJS(transferController_exports); +var import_solidity = require("@ethersproject/solidity"); +async function transferController_default({ contracts, signer }, name, { + newOwner, + isOwner +}) { + const baseRegistrar = (await (contracts == null ? void 0 : contracts.getBaseRegistrar())).connect(signer); + const registry = (await (contracts == null ? void 0 : contracts.getRegistry())).connect(signer); + const labels = name.split("."); + if (isOwner) { + return registry.populateTransaction.setOwner( + (0, import_solidity.keccak256)(["string"], [labels[0]]), + newOwner + ); + } + return baseRegistrar.populateTransaction.reclaim( + (0, import_solidity.keccak256)(["string"], [labels[0]]), + newOwner + ); +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/transferName.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/transferName.js new file mode 100644 index 000000000..4766363e9 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/transferName.js @@ -0,0 +1,65 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var transferName_exports = {}; +__export(transferName_exports, { + default: () => transferName_default +}); +module.exports = __toCommonJS(transferName_exports); +var import_solidity = require("@ethersproject/solidity"); +var import_normalise = require("../utils/normalise"); +async function transferName_default({ contracts, signer }, name, { + newOwner, + contract, + reclaim +}) { + const address = await signer.getAddress(); + switch (contract) { + case "registry": { + const registry = (await (contracts == null ? void 0 : contracts.getRegistry())).connect(signer); + return registry.populateTransaction.setOwner((0, import_normalise.namehash)(name), newOwner); + } + case "baseRegistrar": { + const baseRegistrar = (await (contracts == null ? void 0 : contracts.getBaseRegistrar())).connect( + signer + ); + const labels = name.split("."); + if (labels.length > 2 || labels[labels.length - 1] !== "eth") { + throw new Error("Invalid name for baseRegistrar"); + } + const tokenId = (0, import_solidity.keccak256)(["string"], [labels[0]]); + if (reclaim) { + return baseRegistrar.populateTransaction.reclaim(tokenId, newOwner); + } + return baseRegistrar.populateTransaction["safeTransferFrom(address,address,uint256)"](address, newOwner, tokenId); + } + case "nameWrapper": { + const nameWrapper = (await (contracts == null ? void 0 : contracts.getNameWrapper())).connect(signer); + return nameWrapper.populateTransaction.safeTransferFrom( + address, + newOwner, + (0, import_normalise.namehash)(name), + 1, + "0x" + ); + } + default: { + throw new Error(`Unknown contract: ${contract}`); + } + } +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/transferSubname.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/transferSubname.js new file mode 100644 index 000000000..d08ff0f87 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/transferSubname.js @@ -0,0 +1,64 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var transferSubname_exports = {}; +__export(transferSubname_exports, { + default: () => transferSubname_default +}); +module.exports = __toCommonJS(transferSubname_exports); +var import_solidity = require("@ethersproject/solidity"); +var import_normalise = require("../utils/normalise"); +var import_wrapper = require("../utils/wrapper"); +async function transferSubname_default({ + contracts, + signer, + getExpiry +}, name, { contract, owner, resolverAddress, ...wrapperArgs }) { + const labels = name.split("."); + const label = labels.shift(); + const labelhash = (0, import_solidity.keccak256)(["string"], [label]); + const parentNodehash = (0, import_normalise.namehash)(labels.join(".")); + switch (contract) { + case "registry": { + const registry = (await contracts.getRegistry()).connect(signer); + return registry.populateTransaction.setSubnodeOwner( + parentNodehash, + labelhash, + owner + ); + } + case "nameWrapper": { + const nameWrapper = (await contracts.getNameWrapper()).connect(signer); + const expiry = await (0, import_wrapper.makeExpiry)( + { getExpiry }, + labels.join("."), + "expiry" in wrapperArgs ? wrapperArgs.expiry : void 0 + ); + return nameWrapper.populateTransaction.setSubnodeOwner( + parentNodehash, + label, + owner, + "0", + expiry + ); + } + default: { + throw new Error(`Unknown contract: ${contract}`); + } + } +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/types.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/types.js new file mode 100644 index 000000000..43ae53610 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/types.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var types_exports = {}; +module.exports = __toCommonJS(types_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/unwrapName.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/unwrapName.js new file mode 100644 index 000000000..076be62f4 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/unwrapName.js @@ -0,0 +1,52 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var unwrapName_exports = {}; +__export(unwrapName_exports, { + default: () => unwrapName_default +}); +module.exports = __toCommonJS(unwrapName_exports); +var import_solidity = require("@ethersproject/solidity"); +var import_normalise = require("../utils/normalise"); +async function unwrapName_default({ contracts, signer }, name, { + newController, + newRegistrant +}) { + const labels = name.split("."); + const labelhash = (0, import_solidity.keccak256)(["string"], [labels[0]]); + const parentNodehash = (0, import_normalise.namehash)(labels.slice(1).join(".")); + const nameWrapper = (await contracts.getNameWrapper()).connect(signer); + if (labels.length === 2 && labels[1] === "eth") { + if (!newRegistrant) { + throw new Error("newRegistrant must be specified for .eth names"); + } + return nameWrapper.populateTransaction.unwrapETH2LD( + labelhash, + newRegistrant, + newController + ); + } + if (newRegistrant) { + throw new Error("newRegistrant can only be specified for .eth names"); + } + return nameWrapper.populateTransaction.unwrap( + parentNodehash, + labelhash, + newController + ); +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/functions/wrapName.js b/.yalc/@ensdomains/ensjs/dist/cjs/functions/wrapName.js new file mode 100644 index 000000000..89363a79e --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/functions/wrapName.js @@ -0,0 +1,114 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var wrapName_exports = {}; +__export(wrapName_exports, { + default: () => wrapName_default +}); +module.exports = __toCommonJS(wrapName_exports); +var import_abi_coder = require("@ethersproject/abi/lib/abi-coder"); +var import_solidity = require("@ethersproject/solidity"); +var import_fuses = require("../utils/fuses"); +var import_hexEncodedName = require("../utils/hexEncodedName"); +var import_wrapper = require("../utils/wrapper"); +async function wrapETH({ contracts }, labels, wrappedOwner, decodedFuses, resolverAddress, signer, address) { + const nameWrapper = await (contracts == null ? void 0 : contracts.getNameWrapper()); + const baseRegistrar = (await contracts.getBaseRegistrar()).connect(signer); + const labelhash = (0, import_solidity.keccak256)(["string"], [labels[0]]); + const data = import_abi_coder.defaultAbiCoder.encode( + ["string", "address", "uint16", "address"], + [labels[0], wrappedOwner, decodedFuses, resolverAddress] + ); + return baseRegistrar.populateTransaction["safeTransferFrom(address,address,uint256,bytes)"](address, nameWrapper.address, labelhash, data); +} +async function wrapOther({ contracts }, name, wrappedOwner, resolverAddress, address, signer) { + const nameWrapper = (await contracts.getNameWrapper()).connect(signer); + const registry = await (contracts == null ? void 0 : contracts.getRegistry()); + const hasApproval = await registry.isApprovedForAll( + address, + nameWrapper.address + ); + if (!hasApproval) { + throw new Error( + "NameWrapper must have approval to wrap a name from this address." + ); + } + return nameWrapper.populateTransaction.wrap( + (0, import_hexEncodedName.hexEncodeName)(name), + wrappedOwner, + resolverAddress + ); +} +async function wrapName_default({ contracts, signer }, name, { + wrappedOwner, + fuseOptions, + expiry, + resolverAddress +}) { + const address = await signer.getAddress(); + let decodedFuses; + const publicResolver = await (contracts == null ? void 0 : contracts.getPublicResolver()); + if (!resolverAddress) + resolverAddress = publicResolver.address; + const labels = name.split("."); + (0, import_wrapper.wrappedLabelLengthCheck)(labels[0]); + if (labels.length === 2 && labels[1] === "eth") { + switch (typeof fuseOptions) { + case "object": { + decodedFuses = (0, import_fuses.encodeFuses)(fuseOptions); + break; + } + case "number": { + decodedFuses = fuseOptions; + break; + } + case "undefined": { + decodedFuses = 0; + break; + } + default: { + throw new Error(`Invalid fuseOptions type: ${typeof fuseOptions}`); + } + } + return wrapETH( + { contracts }, + labels, + wrappedOwner, + decodedFuses, + resolverAddress, + signer, + address + ); + } + if (fuseOptions) + throw new Error( + "Fuses can not be initially set when wrapping a non .eth name" + ); + if (expiry) + throw new Error( + "Expiry can not be initially set when wrapping a non .eth name" + ); + return wrapOther( + { contracts }, + name, + wrappedOwner, + resolverAddress, + address, + signer + ); +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/BaseRegistrarImplementation.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/BaseRegistrarImplementation.js new file mode 100644 index 000000000..7c25f397b --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/BaseRegistrarImplementation.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var BaseRegistrarImplementation_exports = {}; +module.exports = __toCommonJS(BaseRegistrarImplementation_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/BulkRenewal.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/BulkRenewal.js new file mode 100644 index 000000000..afea3106b --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/BulkRenewal.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var BulkRenewal_exports = {}; +module.exports = __toCommonJS(BulkRenewal_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/DNSRegistrar.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/DNSRegistrar.js new file mode 100644 index 000000000..406408f5f --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/DNSRegistrar.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var DNSRegistrar_exports = {}; +module.exports = __toCommonJS(DNSRegistrar_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/DNSSECImpl.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/DNSSECImpl.js new file mode 100644 index 000000000..de82e70d6 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/DNSSECImpl.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var DNSSECImpl_exports = {}; +module.exports = __toCommonJS(DNSSECImpl_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/DefaultReverseResolver.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/DefaultReverseResolver.js new file mode 100644 index 000000000..24e0256b5 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/DefaultReverseResolver.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var DefaultReverseResolver_exports = {}; +module.exports = __toCommonJS(DefaultReverseResolver_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/ENSRegistry.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/ENSRegistry.js new file mode 100644 index 000000000..88b2ff633 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/ENSRegistry.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var ENSRegistry_exports = {}; +module.exports = __toCommonJS(ENSRegistry_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/ETHRegistrarController.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/ETHRegistrarController.js new file mode 100644 index 000000000..52f6f3f41 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/ETHRegistrarController.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var ETHRegistrarController_exports = {}; +module.exports = __toCommonJS(ETHRegistrarController_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/Multicall.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/Multicall.js new file mode 100644 index 000000000..df4546ff4 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/Multicall.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var Multicall_exports = {}; +module.exports = __toCommonJS(Multicall_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/NameWrapper.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/NameWrapper.js new file mode 100644 index 000000000..9081015f2 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/NameWrapper.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var NameWrapper_exports = {}; +module.exports = __toCommonJS(NameWrapper_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/P256SHA256Algorithm.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/P256SHA256Algorithm.js new file mode 100644 index 000000000..38e0da536 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/P256SHA256Algorithm.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var P256SHA256Algorithm_exports = {}; +module.exports = __toCommonJS(P256SHA256Algorithm_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/PublicResolver.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/PublicResolver.js new file mode 100644 index 000000000..cf108f4b9 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/PublicResolver.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var PublicResolver_exports = {}; +module.exports = __toCommonJS(PublicResolver_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/RSASHA1Algorithm.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/RSASHA1Algorithm.js new file mode 100644 index 000000000..c662a570c --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/RSASHA1Algorithm.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var RSASHA1Algorithm_exports = {}; +module.exports = __toCommonJS(RSASHA1Algorithm_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/RSASHA256Algorithm.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/RSASHA256Algorithm.js new file mode 100644 index 000000000..1b2a6aa23 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/RSASHA256Algorithm.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var RSASHA256Algorithm_exports = {}; +module.exports = __toCommonJS(RSASHA256Algorithm_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/ReverseRegistrar.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/ReverseRegistrar.js new file mode 100644 index 000000000..e31f2f51b --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/ReverseRegistrar.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var ReverseRegistrar_exports = {}; +module.exports = __toCommonJS(ReverseRegistrar_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/Root.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/Root.js new file mode 100644 index 000000000..d8a701496 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/Root.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var Root_exports = {}; +module.exports = __toCommonJS(Root_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/SHA1Digest.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/SHA1Digest.js new file mode 100644 index 000000000..f86af86e2 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/SHA1Digest.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var SHA1Digest_exports = {}; +module.exports = __toCommonJS(SHA1Digest_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/SHA1NSEC3Digest.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/SHA1NSEC3Digest.js new file mode 100644 index 000000000..3c6332183 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/SHA1NSEC3Digest.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var SHA1NSEC3Digest_exports = {}; +module.exports = __toCommonJS(SHA1NSEC3Digest_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/SHA256Digest.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/SHA256Digest.js new file mode 100644 index 000000000..9077b5f28 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/SHA256Digest.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var SHA256Digest_exports = {}; +module.exports = __toCommonJS(SHA256Digest_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/StaticMetadataService.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/StaticMetadataService.js new file mode 100644 index 000000000..245645658 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/StaticMetadataService.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var StaticMetadataService_exports = {}; +module.exports = __toCommonJS(StaticMetadataService_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/TLDPublicSuffixList.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/TLDPublicSuffixList.js new file mode 100644 index 000000000..b5a0a86d4 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/TLDPublicSuffixList.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var TLDPublicSuffixList_exports = {}; +module.exports = __toCommonJS(TLDPublicSuffixList_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/UniversalResolver.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/UniversalResolver.js new file mode 100644 index 000000000..425c3eca2 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/UniversalResolver.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var UniversalResolver_exports = {}; +module.exports = __toCommonJS(UniversalResolver_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/common.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/common.js new file mode 100644 index 000000000..df54878ed --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/common.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var common_exports = {}; +module.exports = __toCommonJS(common_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/BaseRegistrarImplementation__factory.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/BaseRegistrarImplementation__factory.js new file mode 100644 index 000000000..c786ac59b --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/BaseRegistrarImplementation__factory.js @@ -0,0 +1,791 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var BaseRegistrarImplementation_factory_exports = {}; +__export(BaseRegistrarImplementation_factory_exports, { + BaseRegistrarImplementation__factory: () => BaseRegistrarImplementation__factory +}); +module.exports = __toCommonJS(BaseRegistrarImplementation_factory_exports); +var import_interface = require("@ethersproject/abi/lib/interface"); +var import_contracts = require("@ethersproject/contracts"); +const _abi = [ + { + inputs: [ + { + internalType: "contract ENS", + name: "_ens", + type: "address" + }, + { + internalType: "bytes32", + name: "_baseNode", + type: "bytes32" + } + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "approved", + type: "address" + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256" + } + ], + name: "Approval", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address" + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool" + } + ], + name: "ApprovalForAll", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "controller", + type: "address" + } + ], + name: "ControllerAdded", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "controller", + type: "address" + } + ], + name: "ControllerRemoved", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "id", + type: "uint256" + }, + { + indexed: true, + internalType: "address", + name: "owner", + type: "address" + }, + { + indexed: false, + internalType: "uint256", + name: "expires", + type: "uint256" + } + ], + name: "NameMigrated", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "id", + type: "uint256" + }, + { + indexed: true, + internalType: "address", + name: "owner", + type: "address" + }, + { + indexed: false, + internalType: "uint256", + name: "expires", + type: "uint256" + } + ], + name: "NameRegistered", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "id", + type: "uint256" + }, + { + indexed: false, + internalType: "uint256", + name: "expires", + type: "uint256" + } + ], + name: "NameRenewed", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "previousOwner", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "newOwner", + type: "address" + } + ], + name: "OwnershipTransferred", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address" + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256" + } + ], + name: "Transfer", + type: "event" + }, + { + constant: true, + inputs: [], + name: "GRACE_PERIOD", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "controller", + type: "address" + } + ], + name: "addController", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "to", + type: "address" + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256" + } + ], + name: "approve", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "uint256", + name: "id", + type: "uint256" + } + ], + name: "available", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "owner", + type: "address" + } + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [], + name: "baseNode", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + name: "controllers", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [], + name: "ens", + outputs: [ + { + internalType: "contract ENS", + name: "", + type: "address" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256" + } + ], + name: "getApproved", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "address", + name: "operator", + type: "address" + } + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [], + name: "isOwner", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "uint256", + name: "id", + type: "uint256" + } + ], + name: "nameExpires", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256" + } + ], + name: "ownerOf", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "id", + type: "uint256" + }, + { + internalType: "address", + name: "owner", + type: "address" + } + ], + name: "reclaim", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "id", + type: "uint256" + }, + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "uint256", + name: "duration", + type: "uint256" + } + ], + name: "register", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "id", + type: "uint256" + }, + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "uint256", + name: "duration", + type: "uint256" + } + ], + name: "registerOnly", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "controller", + type: "address" + } + ], + name: "removeController", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "id", + type: "uint256" + }, + { + internalType: "uint256", + name: "duration", + type: "uint256" + } + ], + name: "renew", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [], + name: "renounceOwnership", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "from", + type: "address" + }, + { + internalType: "address", + name: "to", + type: "address" + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256" + } + ], + name: "safeTransferFrom", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "from", + type: "address" + }, + { + internalType: "address", + name: "to", + type: "address" + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256" + }, + { + internalType: "bytes", + name: "_data", + type: "bytes" + } + ], + name: "safeTransferFrom", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "to", + type: "address" + }, + { + internalType: "bool", + name: "approved", + type: "bool" + } + ], + name: "setApprovalForAll", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "resolver", + type: "address" + } + ], + name: "setResolver", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "bytes4", + name: "interfaceID", + type: "bytes4" + } + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "from", + type: "address" + }, + { + internalType: "address", + name: "to", + type: "address" + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256" + } + ], + name: "transferFrom", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address" + } + ], + name: "transferOwnership", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + } +]; +class BaseRegistrarImplementation__factory { + static createInterface() { + return new import_interface.Interface(_abi); + } + static connect(address, signerOrProvider) { + return new import_contracts.Contract( + address, + _abi, + signerOrProvider + ); + } +} +BaseRegistrarImplementation__factory.abi = _abi; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/BulkRenewal__factory.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/BulkRenewal__factory.js new file mode 100644 index 000000000..2518971e2 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/BulkRenewal__factory.js @@ -0,0 +1,121 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var BulkRenewal_factory_exports = {}; +__export(BulkRenewal_factory_exports, { + BulkRenewal__factory: () => BulkRenewal__factory +}); +module.exports = __toCommonJS(BulkRenewal_factory_exports); +var import_interface = require("@ethersproject/abi/lib/interface"); +var import_contracts = require("@ethersproject/contracts"); +const _abi = [ + { + inputs: [ + { + internalType: "contract ENS", + name: "_ens", + type: "address" + } + ], + stateMutability: "nonpayable", + type: "constructor" + }, + { + inputs: [], + name: "ens", + outputs: [ + { + internalType: "contract ENS", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "string[]", + name: "names", + type: "string[]" + }, + { + internalType: "uint256", + name: "duration", + type: "uint256" + } + ], + name: "renewAll", + outputs: [], + stateMutability: "payable", + type: "function" + }, + { + inputs: [ + { + internalType: "string[]", + name: "names", + type: "string[]" + }, + { + internalType: "uint256", + name: "duration", + type: "uint256" + } + ], + name: "rentPrice", + outputs: [ + { + internalType: "uint256", + name: "total", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes4", + name: "interfaceID", + type: "bytes4" + } + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "pure", + type: "function" + } +]; +class BulkRenewal__factory { + static createInterface() { + return new import_interface.Interface(_abi); + } + static connect(address, signerOrProvider) { + return new import_contracts.Contract(address, _abi, signerOrProvider); + } +} +BulkRenewal__factory.abi = _abi; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/DNSRegistrar__factory.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/DNSRegistrar__factory.js new file mode 100644 index 000000000..d270e655d --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/DNSRegistrar__factory.js @@ -0,0 +1,290 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var DNSRegistrar_factory_exports = {}; +__export(DNSRegistrar_factory_exports, { + DNSRegistrar__factory: () => DNSRegistrar__factory +}); +module.exports = __toCommonJS(DNSRegistrar_factory_exports); +var import_interface = require("@ethersproject/abi/lib/interface"); +var import_contracts = require("@ethersproject/contracts"); +const _abi = [ + { + inputs: [ + { + internalType: "contract DNSSEC", + name: "_dnssec", + type: "address" + }, + { + internalType: "contract PublicSuffixList", + name: "_suffixes", + type: "address" + }, + { + internalType: "contract ENS", + name: "_ens", + type: "address" + } + ], + stateMutability: "nonpayable", + type: "constructor" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: true, + internalType: "address", + name: "owner", + type: "address" + }, + { + indexed: false, + internalType: "bytes", + name: "dnsname", + type: "bytes" + } + ], + name: "Claim", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "oracle", + type: "address" + } + ], + name: "NewOracle", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "suffixes", + type: "address" + } + ], + name: "NewPublicSuffixList", + type: "event" + }, + { + inputs: [ + { + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + internalType: "bytes", + name: "proof", + type: "bytes" + } + ], + name: "claim", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [], + name: "ens", + outputs: [ + { + internalType: "contract ENS", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "oracle", + outputs: [ + { + internalType: "contract DNSSEC", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + components: [ + { + internalType: "bytes", + name: "rrset", + type: "bytes" + }, + { + internalType: "bytes", + name: "sig", + type: "bytes" + } + ], + internalType: "struct DNSSEC.RRSetWithSignature[]", + name: "input", + type: "tuple[]" + }, + { + internalType: "bytes", + name: "proof", + type: "bytes" + } + ], + name: "proveAndClaim", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + components: [ + { + internalType: "bytes", + name: "rrset", + type: "bytes" + }, + { + internalType: "bytes", + name: "sig", + type: "bytes" + } + ], + internalType: "struct DNSSEC.RRSetWithSignature[]", + name: "input", + type: "tuple[]" + }, + { + internalType: "bytes", + name: "proof", + type: "bytes" + }, + { + internalType: "address", + name: "resolver", + type: "address" + }, + { + internalType: "address", + name: "addr", + type: "address" + } + ], + name: "proveAndClaimWithResolver", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "contract DNSSEC", + name: "_dnssec", + type: "address" + } + ], + name: "setOracle", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "contract PublicSuffixList", + name: "_suffixes", + type: "address" + } + ], + name: "setPublicSuffixList", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [], + name: "suffixes", + outputs: [ + { + internalType: "contract PublicSuffixList", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes4", + name: "interfaceID", + type: "bytes4" + } + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "pure", + type: "function" + } +]; +class DNSRegistrar__factory { + static createInterface() { + return new import_interface.Interface(_abi); + } + static connect(address, signerOrProvider) { + return new import_contracts.Contract(address, _abi, signerOrProvider); + } +} +DNSRegistrar__factory.abi = _abi; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/DNSSECImpl__factory.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/DNSSECImpl__factory.js new file mode 100644 index 000000000..7b8b87cf9 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/DNSSECImpl__factory.js @@ -0,0 +1,495 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var DNSSECImpl_factory_exports = {}; +__export(DNSSECImpl_factory_exports, { + DNSSECImpl__factory: () => DNSSECImpl__factory +}); +module.exports = __toCommonJS(DNSSECImpl_factory_exports); +var import_interface = require("@ethersproject/abi/lib/interface"); +var import_contracts = require("@ethersproject/contracts"); +const _abi = [ + { + inputs: [ + { + internalType: "bytes", + name: "_anchors", + type: "bytes" + } + ], + stateMutability: "nonpayable", + type: "constructor" + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint8", + name: "id", + type: "uint8" + }, + { + indexed: false, + internalType: "address", + name: "addr", + type: "address" + } + ], + name: "AlgorithmUpdated", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint8", + name: "id", + type: "uint8" + }, + { + indexed: false, + internalType: "address", + name: "addr", + type: "address" + } + ], + name: "DigestUpdated", + type: "event" + }, + { + anonymous: false, + inputs: [], + name: "Marker", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint8", + name: "id", + type: "uint8" + }, + { + indexed: false, + internalType: "address", + name: "addr", + type: "address" + } + ], + name: "NSEC3DigestUpdated", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + indexed: false, + internalType: "bytes", + name: "rrset", + type: "bytes" + } + ], + name: "RRSetUpdated", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "t", + type: "uint256" + } + ], + name: "Test", + type: "event" + }, + { + inputs: [ + { + internalType: "uint8", + name: "", + type: "uint8" + } + ], + name: "algorithms", + outputs: [ + { + internalType: "contract Algorithm", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "anchors", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "uint16", + name: "deleteType", + type: "uint16" + }, + { + internalType: "bytes", + name: "deleteName", + type: "bytes" + }, + { + components: [ + { + internalType: "bytes", + name: "rrset", + type: "bytes" + }, + { + internalType: "bytes", + name: "sig", + type: "bytes" + } + ], + internalType: "struct DNSSEC.RRSetWithSignature", + name: "nsec", + type: "tuple" + }, + { + internalType: "bytes", + name: "proof", + type: "bytes" + } + ], + name: "deleteRRSet", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "uint16", + name: "deleteType", + type: "uint16" + }, + { + internalType: "bytes", + name: "deleteName", + type: "bytes" + }, + { + components: [ + { + internalType: "bytes", + name: "rrset", + type: "bytes" + }, + { + internalType: "bytes", + name: "sig", + type: "bytes" + } + ], + internalType: "struct DNSSEC.RRSetWithSignature", + name: "closestEncloser", + type: "tuple" + }, + { + components: [ + { + internalType: "bytes", + name: "rrset", + type: "bytes" + }, + { + internalType: "bytes", + name: "sig", + type: "bytes" + } + ], + internalType: "struct DNSSEC.RRSetWithSignature", + name: "nextClosest", + type: "tuple" + }, + { + internalType: "bytes", + name: "dnskey", + type: "bytes" + } + ], + name: "deleteRRSetNSEC3", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "uint8", + name: "", + type: "uint8" + } + ], + name: "digests", + outputs: [ + { + internalType: "contract Digest", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "uint8", + name: "", + type: "uint8" + } + ], + name: "nsec3Digests", + outputs: [ + { + internalType: "contract NSEC3Digest", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "uint16", + name: "dnstype", + type: "uint16" + }, + { + internalType: "bytes", + name: "name", + type: "bytes" + } + ], + name: "rrdata", + outputs: [ + { + internalType: "uint32", + name: "", + type: "uint32" + }, + { + internalType: "uint32", + name: "", + type: "uint32" + }, + { + internalType: "bytes20", + name: "", + type: "bytes20" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "uint8", + name: "id", + type: "uint8" + }, + { + internalType: "contract Algorithm", + name: "algo", + type: "address" + } + ], + name: "setAlgorithm", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "uint8", + name: "id", + type: "uint8" + }, + { + internalType: "contract Digest", + name: "digest", + type: "address" + } + ], + name: "setDigest", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "uint8", + name: "id", + type: "uint8" + }, + { + internalType: "contract NSEC3Digest", + name: "digest", + type: "address" + } + ], + name: "setNSEC3Digest", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address" + } + ], + name: "setOwner", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + components: [ + { + internalType: "bytes", + name: "rrset", + type: "bytes" + }, + { + internalType: "bytes", + name: "sig", + type: "bytes" + } + ], + internalType: "struct DNSSEC.RRSetWithSignature", + name: "input", + type: "tuple" + }, + { + internalType: "bytes", + name: "proof", + type: "bytes" + } + ], + name: "submitRRSet", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + components: [ + { + internalType: "bytes", + name: "rrset", + type: "bytes" + }, + { + internalType: "bytes", + name: "sig", + type: "bytes" + } + ], + internalType: "struct DNSSEC.RRSetWithSignature[]", + name: "input", + type: "tuple[]" + }, + { + internalType: "bytes", + name: "_proof", + type: "bytes" + } + ], + name: "submitRRSets", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes" + } + ], + stateMutability: "nonpayable", + type: "function" + } +]; +class DNSSECImpl__factory { + static createInterface() { + return new import_interface.Interface(_abi); + } + static connect(address, signerOrProvider) { + return new import_contracts.Contract(address, _abi, signerOrProvider); + } +} +DNSSECImpl__factory.abi = _abi; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/DefaultReverseResolver__factory.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/DefaultReverseResolver__factory.js new file mode 100644 index 000000000..6f579f79c --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/DefaultReverseResolver__factory.js @@ -0,0 +1,108 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var DefaultReverseResolver_factory_exports = {}; +__export(DefaultReverseResolver_factory_exports, { + DefaultReverseResolver__factory: () => DefaultReverseResolver__factory +}); +module.exports = __toCommonJS(DefaultReverseResolver_factory_exports); +var import_interface = require("@ethersproject/abi/lib/interface"); +var import_contracts = require("@ethersproject/contracts"); +const _abi = [ + { + inputs: [ + { + internalType: "contract ENS", + name: "ensAddr", + type: "address" + } + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor" + }, + { + constant: true, + inputs: [], + name: "ens", + outputs: [ + { + internalType: "contract ENS", + name: "", + type: "address" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + name: "name", + outputs: [ + { + internalType: "string", + name: "", + type: "string" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "string", + name: "_name", + type: "string" + } + ], + name: "setName", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + } +]; +class DefaultReverseResolver__factory { + static createInterface() { + return new import_interface.Interface(_abi); + } + static connect(address, signerOrProvider) { + return new import_contracts.Contract( + address, + _abi, + signerOrProvider + ); + } +} +DefaultReverseResolver__factory.abi = _abi; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/ENSRegistry__factory.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/ENSRegistry__factory.js new file mode 100644 index 000000000..73e4a97f6 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/ENSRegistry__factory.js @@ -0,0 +1,456 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var ENSRegistry_factory_exports = {}; +__export(ENSRegistry_factory_exports, { + ENSRegistry__factory: () => ENSRegistry__factory +}); +module.exports = __toCommonJS(ENSRegistry_factory_exports); +var import_interface = require("@ethersproject/abi/lib/interface"); +var import_contracts = require("@ethersproject/contracts"); +const _abi = [ + { + inputs: [ + { + internalType: "contract ENS", + name: "_old", + type: "address" + } + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address" + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool" + } + ], + name: "ApprovalForAll", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: true, + internalType: "bytes32", + name: "label", + type: "bytes32" + }, + { + indexed: false, + internalType: "address", + name: "owner", + type: "address" + } + ], + name: "NewOwner", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "address", + name: "resolver", + type: "address" + } + ], + name: "NewResolver", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "uint64", + name: "ttl", + type: "uint64" + } + ], + name: "NewTTL", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "address", + name: "owner", + type: "address" + } + ], + name: "Transfer", + type: "event" + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "address", + name: "operator", + type: "address" + } + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [], + name: "old", + outputs: [ + { + internalType: "contract ENS", + name: "", + type: "address" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "recordExists", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "resolver", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "operator", + type: "address" + }, + { + internalType: "bool", + name: "approved", + type: "bool" + } + ], + name: "setApprovalForAll", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "address", + name: "owner", + type: "address" + } + ], + name: "setOwner", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "address", + name: "resolver", + type: "address" + }, + { + internalType: "uint64", + name: "ttl", + type: "uint64" + } + ], + name: "setRecord", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "address", + name: "resolver", + type: "address" + } + ], + name: "setResolver", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "bytes32", + name: "label", + type: "bytes32" + }, + { + internalType: "address", + name: "owner", + type: "address" + } + ], + name: "setSubnodeOwner", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "bytes32", + name: "label", + type: "bytes32" + }, + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "address", + name: "resolver", + type: "address" + }, + { + internalType: "uint64", + name: "ttl", + type: "uint64" + } + ], + name: "setSubnodeRecord", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "uint64", + name: "ttl", + type: "uint64" + } + ], + name: "setTTL", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "ttl", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64" + } + ], + payable: false, + stateMutability: "view", + type: "function" + } +]; +class ENSRegistry__factory { + static createInterface() { + return new import_interface.Interface(_abi); + } + static connect(address, signerOrProvider) { + return new import_contracts.Contract(address, _abi, signerOrProvider); + } +} +ENSRegistry__factory.abi = _abi; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/ETHRegistrarController__factory.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/ETHRegistrarController__factory.js new file mode 100644 index 000000000..4bcb27bb6 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/ETHRegistrarController__factory.js @@ -0,0 +1,630 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var ETHRegistrarController_factory_exports = {}; +__export(ETHRegistrarController_factory_exports, { + ETHRegistrarController__factory: () => ETHRegistrarController__factory +}); +module.exports = __toCommonJS(ETHRegistrarController_factory_exports); +var import_interface = require("@ethersproject/abi/lib/interface"); +var import_contracts = require("@ethersproject/contracts"); +const _abi = [ + { + inputs: [ + { + internalType: "contract BaseRegistrarImplementation", + name: "_base", + type: "address" + }, + { + internalType: "contract IPriceOracle", + name: "_prices", + type: "address" + }, + { + internalType: "uint256", + name: "_minCommitmentAge", + type: "uint256" + }, + { + internalType: "uint256", + name: "_maxCommitmentAge", + type: "uint256" + }, + { + internalType: "contract ReverseRegistrar", + name: "_reverseRegistrar", + type: "address" + }, + { + internalType: "contract INameWrapper", + name: "_nameWrapper", + type: "address" + } + ], + stateMutability: "nonpayable", + type: "constructor" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "commitment", + type: "bytes32" + } + ], + name: "CommitmentTooNew", + type: "error" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "commitment", + type: "bytes32" + } + ], + name: "CommitmentTooOld", + type: "error" + }, + { + inputs: [ + { + internalType: "uint256", + name: "duration", + type: "uint256" + } + ], + name: "DurationTooShort", + type: "error" + }, + { + inputs: [], + name: "InsufficientValue", + type: "error" + }, + { + inputs: [], + name: "MaxCommitmentAgeTooHigh", + type: "error" + }, + { + inputs: [], + name: "MaxCommitmentAgeTooLow", + type: "error" + }, + { + inputs: [ + { + internalType: "string", + name: "name", + type: "string" + } + ], + name: "NameNotAvailable", + type: "error" + }, + { + inputs: [], + name: "ResolverRequiredWhenDataSupplied", + type: "error" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "commitment", + type: "bytes32" + } + ], + name: "UnexpiredCommitmentExists", + type: "error" + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "string", + name: "name", + type: "string" + }, + { + indexed: true, + internalType: "bytes32", + name: "label", + type: "bytes32" + }, + { + indexed: true, + internalType: "address", + name: "owner", + type: "address" + }, + { + indexed: false, + internalType: "uint256", + name: "baseCost", + type: "uint256" + }, + { + indexed: false, + internalType: "uint256", + name: "premium", + type: "uint256" + }, + { + indexed: false, + internalType: "uint256", + name: "expires", + type: "uint256" + } + ], + name: "NameRegistered", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "string", + name: "name", + type: "string" + }, + { + indexed: true, + internalType: "bytes32", + name: "label", + type: "bytes32" + }, + { + indexed: false, + internalType: "uint256", + name: "cost", + type: "uint256" + }, + { + indexed: false, + internalType: "uint256", + name: "expires", + type: "uint256" + } + ], + name: "NameRenewed", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "previousOwner", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "newOwner", + type: "address" + } + ], + name: "OwnershipTransferred", + type: "event" + }, + { + inputs: [], + name: "MIN_REGISTRATION_DURATION", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "string", + name: "name", + type: "string" + } + ], + name: "available", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "commitment", + type: "bytes32" + } + ], + name: "commit", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + name: "commitments", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "string", + name: "name", + type: "string" + }, + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "uint256", + name: "duration", + type: "uint256" + }, + { + internalType: "bytes32", + name: "secret", + type: "bytes32" + }, + { + internalType: "address", + name: "resolver", + type: "address" + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]" + }, + { + internalType: "bool", + name: "reverseRecord", + type: "bool" + }, + { + internalType: "uint16", + name: "ownerControlledFuses", + type: "uint16" + } + ], + name: "makeCommitment", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + stateMutability: "pure", + type: "function" + }, + { + inputs: [], + name: "maxCommitmentAge", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "minCommitmentAge", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "nameWrapper", + outputs: [ + { + internalType: "contract INameWrapper", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "prices", + outputs: [ + { + internalType: "contract IPriceOracle", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "_token", + type: "address" + }, + { + internalType: "address", + name: "_to", + type: "address" + }, + { + internalType: "uint256", + name: "_amount", + type: "uint256" + } + ], + name: "recoverFunds", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "string", + name: "name", + type: "string" + }, + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "uint256", + name: "duration", + type: "uint256" + }, + { + internalType: "bytes32", + name: "secret", + type: "bytes32" + }, + { + internalType: "address", + name: "resolver", + type: "address" + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]" + }, + { + internalType: "bool", + name: "reverseRecord", + type: "bool" + }, + { + internalType: "uint16", + name: "ownerControlledFuses", + type: "uint16" + } + ], + name: "register", + outputs: [], + stateMutability: "payable", + type: "function" + }, + { + inputs: [ + { + internalType: "string", + name: "name", + type: "string" + }, + { + internalType: "uint256", + name: "duration", + type: "uint256" + } + ], + name: "renew", + outputs: [], + stateMutability: "payable", + type: "function" + }, + { + inputs: [], + name: "renounceOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "string", + name: "name", + type: "string" + }, + { + internalType: "uint256", + name: "duration", + type: "uint256" + } + ], + name: "rentPrice", + outputs: [ + { + components: [ + { + internalType: "uint256", + name: "base", + type: "uint256" + }, + { + internalType: "uint256", + name: "premium", + type: "uint256" + } + ], + internalType: "struct IPriceOracle.Price", + name: "price", + type: "tuple" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "reverseRegistrar", + outputs: [ + { + internalType: "contract ReverseRegistrar", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes4", + name: "interfaceID", + type: "bytes4" + } + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "pure", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address" + } + ], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "string", + name: "name", + type: "string" + } + ], + name: "valid", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "pure", + type: "function" + }, + { + inputs: [], + name: "withdraw", + outputs: [], + stateMutability: "nonpayable", + type: "function" + } +]; +class ETHRegistrarController__factory { + static createInterface() { + return new import_interface.Interface(_abi); + } + static connect(address, signerOrProvider) { + return new import_contracts.Contract( + address, + _abi, + signerOrProvider + ); + } +} +ETHRegistrarController__factory.abi = _abi; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/Multicall__factory.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/Multicall__factory.js new file mode 100644 index 000000000..8e199c4b4 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/Multicall__factory.js @@ -0,0 +1,474 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var Multicall_factory_exports = {}; +__export(Multicall_factory_exports, { + Multicall__factory: () => Multicall__factory +}); +module.exports = __toCommonJS(Multicall_factory_exports); +var import_interface = require("@ethersproject/abi/lib/interface"); +var import_contracts = require("@ethersproject/contracts"); +const _abi = [ + { + inputs: [ + { + components: [ + { + internalType: "address", + name: "target", + type: "address" + }, + { + internalType: "bytes", + name: "callData", + type: "bytes" + } + ], + internalType: "struct Multicall3.Call[]", + name: "calls", + type: "tuple[]" + } + ], + name: "aggregate", + outputs: [ + { + internalType: "uint256", + name: "blockNumber", + type: "uint256" + }, + { + internalType: "bytes[]", + name: "returnData", + type: "bytes[]" + } + ], + stateMutability: "payable", + type: "function" + }, + { + inputs: [ + { + components: [ + { + internalType: "address", + name: "target", + type: "address" + }, + { + internalType: "bool", + name: "allowFailure", + type: "bool" + }, + { + internalType: "bytes", + name: "callData", + type: "bytes" + } + ], + internalType: "struct Multicall3.Call3[]", + name: "calls", + type: "tuple[]" + } + ], + name: "aggregate3", + outputs: [ + { + components: [ + { + internalType: "bool", + name: "success", + type: "bool" + }, + { + internalType: "bytes", + name: "returnData", + type: "bytes" + } + ], + internalType: "struct Multicall3.Result[]", + name: "returnData", + type: "tuple[]" + } + ], + stateMutability: "payable", + type: "function" + }, + { + inputs: [ + { + components: [ + { + internalType: "address", + name: "target", + type: "address" + }, + { + internalType: "bool", + name: "allowFailure", + type: "bool" + }, + { + internalType: "uint256", + name: "value", + type: "uint256" + }, + { + internalType: "bytes", + name: "callData", + type: "bytes" + } + ], + internalType: "struct Multicall3.Call3Value[]", + name: "calls", + type: "tuple[]" + } + ], + name: "aggregate3Value", + outputs: [ + { + components: [ + { + internalType: "bool", + name: "success", + type: "bool" + }, + { + internalType: "bytes", + name: "returnData", + type: "bytes" + } + ], + internalType: "struct Multicall3.Result[]", + name: "returnData", + type: "tuple[]" + } + ], + stateMutability: "payable", + type: "function" + }, + { + inputs: [ + { + components: [ + { + internalType: "address", + name: "target", + type: "address" + }, + { + internalType: "bytes", + name: "callData", + type: "bytes" + } + ], + internalType: "struct Multicall3.Call[]", + name: "calls", + type: "tuple[]" + } + ], + name: "blockAndAggregate", + outputs: [ + { + internalType: "uint256", + name: "blockNumber", + type: "uint256" + }, + { + internalType: "bytes32", + name: "blockHash", + type: "bytes32" + }, + { + components: [ + { + internalType: "bool", + name: "success", + type: "bool" + }, + { + internalType: "bytes", + name: "returnData", + type: "bytes" + } + ], + internalType: "struct Multicall3.Result[]", + name: "returnData", + type: "tuple[]" + } + ], + stateMutability: "payable", + type: "function" + }, + { + inputs: [], + name: "getBasefee", + outputs: [ + { + internalType: "uint256", + name: "basefee", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "uint256", + name: "blockNumber", + type: "uint256" + } + ], + name: "getBlockHash", + outputs: [ + { + internalType: "bytes32", + name: "blockHash", + type: "bytes32" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "getBlockNumber", + outputs: [ + { + internalType: "uint256", + name: "blockNumber", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "getChainId", + outputs: [ + { + internalType: "uint256", + name: "chainid", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "getCurrentBlockCoinbase", + outputs: [ + { + internalType: "address", + name: "coinbase", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "getCurrentBlockDifficulty", + outputs: [ + { + internalType: "uint256", + name: "difficulty", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "getCurrentBlockGasLimit", + outputs: [ + { + internalType: "uint256", + name: "gaslimit", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "getCurrentBlockTimestamp", + outputs: [ + { + internalType: "uint256", + name: "timestamp", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "addr", + type: "address" + } + ], + name: "getEthBalance", + outputs: [ + { + internalType: "uint256", + name: "balance", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "getLastBlockHash", + outputs: [ + { + internalType: "bytes32", + name: "blockHash", + type: "bytes32" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bool", + name: "requireSuccess", + type: "bool" + }, + { + components: [ + { + internalType: "address", + name: "target", + type: "address" + }, + { + internalType: "bytes", + name: "callData", + type: "bytes" + } + ], + internalType: "struct Multicall3.Call[]", + name: "calls", + type: "tuple[]" + } + ], + name: "tryAggregate", + outputs: [ + { + components: [ + { + internalType: "bool", + name: "success", + type: "bool" + }, + { + internalType: "bytes", + name: "returnData", + type: "bytes" + } + ], + internalType: "struct Multicall3.Result[]", + name: "returnData", + type: "tuple[]" + } + ], + stateMutability: "payable", + type: "function" + }, + { + inputs: [ + { + internalType: "bool", + name: "requireSuccess", + type: "bool" + }, + { + components: [ + { + internalType: "address", + name: "target", + type: "address" + }, + { + internalType: "bytes", + name: "callData", + type: "bytes" + } + ], + internalType: "struct Multicall3.Call[]", + name: "calls", + type: "tuple[]" + } + ], + name: "tryBlockAndAggregate", + outputs: [ + { + internalType: "uint256", + name: "blockNumber", + type: "uint256" + }, + { + internalType: "bytes32", + name: "blockHash", + type: "bytes32" + }, + { + components: [ + { + internalType: "bool", + name: "success", + type: "bool" + }, + { + internalType: "bytes", + name: "returnData", + type: "bytes" + } + ], + internalType: "struct Multicall3.Result[]", + name: "returnData", + type: "tuple[]" + } + ], + stateMutability: "payable", + type: "function" + } +]; +class Multicall__factory { + static createInterface() { + return new import_interface.Interface(_abi); + } + static connect(address, signerOrProvider) { + return new import_contracts.Contract(address, _abi, signerOrProvider); + } +} +Multicall__factory.abi = _abi; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/NameWrapper__factory.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/NameWrapper__factory.js new file mode 100644 index 000000000..fb7bb53bb --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/NameWrapper__factory.js @@ -0,0 +1,1406 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var NameWrapper_factory_exports = {}; +__export(NameWrapper_factory_exports, { + NameWrapper__factory: () => NameWrapper__factory +}); +module.exports = __toCommonJS(NameWrapper_factory_exports); +var import_interface = require("@ethersproject/abi/lib/interface"); +var import_contracts = require("@ethersproject/contracts"); +const _abi = [ + { + inputs: [ + { + internalType: "contract ENS", + name: "_ens", + type: "address" + }, + { + internalType: "contract IBaseRegistrar", + name: "_registrar", + type: "address" + }, + { + internalType: "contract IMetadataService", + name: "_metadataService", + type: "address" + } + ], + stateMutability: "nonpayable", + type: "constructor" + }, + { + inputs: [], + name: "CannotUpgrade", + type: "error" + }, + { + inputs: [], + name: "IncompatibleParent", + type: "error" + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address" + } + ], + name: "IncorrectTargetOwner", + type: "error" + }, + { + inputs: [], + name: "IncorrectTokenType", + type: "error" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "labelHash", + type: "bytes32" + }, + { + internalType: "bytes32", + name: "expectedLabelhash", + type: "bytes32" + } + ], + name: "LabelMismatch", + type: "error" + }, + { + inputs: [ + { + internalType: "string", + name: "label", + type: "string" + } + ], + name: "LabelTooLong", + type: "error" + }, + { + inputs: [], + name: "LabelTooShort", + type: "error" + }, + { + inputs: [], + name: "NameIsNotWrapped", + type: "error" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "OperationProhibited", + type: "error" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "address", + name: "addr", + type: "address" + } + ], + name: "Unauthorised", + type: "error" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address" + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool" + } + ], + name: "ApprovalForAll", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "controller", + type: "address" + }, + { + indexed: false, + internalType: "bool", + name: "active", + type: "bool" + } + ], + name: "ControllerChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "uint64", + name: "expiry", + type: "uint64" + } + ], + name: "ExpiryExtended", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "uint32", + name: "fuses", + type: "uint32" + } + ], + name: "FusesSet", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "address", + name: "owner", + type: "address" + } + ], + name: "NameUnwrapped", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + indexed: false, + internalType: "address", + name: "owner", + type: "address" + }, + { + indexed: false, + internalType: "uint32", + name: "fuses", + type: "uint32" + }, + { + indexed: false, + internalType: "uint64", + name: "expiry", + type: "uint64" + } + ], + name: "NameWrapped", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "previousOwner", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "newOwner", + type: "address" + } + ], + name: "OwnershipTransferred", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "operator", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "from", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address" + }, + { + indexed: false, + internalType: "uint256[]", + name: "ids", + type: "uint256[]" + }, + { + indexed: false, + internalType: "uint256[]", + name: "values", + type: "uint256[]" + } + ], + name: "TransferBatch", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "operator", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "from", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address" + }, + { + indexed: false, + internalType: "uint256", + name: "id", + type: "uint256" + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256" + } + ], + name: "TransferSingle", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "string", + name: "value", + type: "string" + }, + { + indexed: true, + internalType: "uint256", + name: "id", + type: "uint256" + } + ], + name: "URI", + type: "event" + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + name: "_tokens", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "uint32", + name: "fuseMask", + type: "uint32" + } + ], + name: "allFusesBurned", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address" + }, + { + internalType: "uint256", + name: "id", + type: "uint256" + } + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address[]", + name: "accounts", + type: "address[]" + }, + { + internalType: "uint256[]", + name: "ids", + type: "uint256[]" + } + ], + name: "balanceOfBatch", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "address", + name: "addr", + type: "address" + } + ], + name: "canModifyName", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + name: "controllers", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "ens", + outputs: [ + { + internalType: "contract ENS", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "parentNode", + type: "bytes32" + }, + { + internalType: "bytes32", + name: "labelhash", + type: "bytes32" + }, + { + internalType: "uint64", + name: "expiry", + type: "uint64" + } + ], + name: "extendExpiry", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "uint256", + name: "id", + type: "uint256" + } + ], + name: "getData", + outputs: [ + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "uint32", + name: "fuses", + type: "uint32" + }, + { + internalType: "uint64", + name: "expiry", + type: "uint64" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address" + }, + { + internalType: "address", + name: "operator", + type: "address" + } + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "isWrapped", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "metadataService", + outputs: [ + { + internalType: "contract IMetadataService", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "name", + outputs: [ + { + internalType: "string", + name: "", + type: "string" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + name: "names", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address" + }, + { + internalType: "address", + name: "", + type: "address" + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256" + }, + { + internalType: "bytes", + name: "data", + type: "bytes" + } + ], + name: "onERC721Received", + outputs: [ + { + internalType: "bytes4", + name: "", + type: "bytes4" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "uint256", + name: "id", + type: "uint256" + } + ], + name: "ownerOf", + outputs: [ + { + internalType: "address", + name: "owner", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "_token", + type: "address" + }, + { + internalType: "address", + name: "_to", + type: "address" + }, + { + internalType: "uint256", + name: "_amount", + type: "uint256" + } + ], + name: "recoverFunds", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "string", + name: "label", + type: "string" + }, + { + internalType: "address", + name: "wrappedOwner", + type: "address" + }, + { + internalType: "uint256", + name: "duration", + type: "uint256" + }, + { + internalType: "address", + name: "resolver", + type: "address" + }, + { + internalType: "uint16", + name: "ownerControlledFuses", + type: "uint16" + } + ], + name: "registerAndWrapETH2LD", + outputs: [ + { + internalType: "uint256", + name: "registrarExpiry", + type: "uint256" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [], + name: "registrar", + outputs: [ + { + internalType: "contract IBaseRegistrar", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256" + }, + { + internalType: "uint256", + name: "duration", + type: "uint256" + } + ], + name: "renew", + outputs: [ + { + internalType: "uint256", + name: "expires", + type: "uint256" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [], + name: "renounceOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address" + }, + { + internalType: "address", + name: "to", + type: "address" + }, + { + internalType: "uint256[]", + name: "ids", + type: "uint256[]" + }, + { + internalType: "uint256[]", + name: "amounts", + type: "uint256[]" + }, + { + internalType: "bytes", + name: "data", + type: "bytes" + } + ], + name: "safeBatchTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address" + }, + { + internalType: "address", + name: "to", + type: "address" + }, + { + internalType: "uint256", + name: "id", + type: "uint256" + }, + { + internalType: "uint256", + name: "amount", + type: "uint256" + }, + { + internalType: "bytes", + name: "data", + type: "bytes" + } + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address" + }, + { + internalType: "bool", + name: "approved", + type: "bool" + } + ], + name: "setApprovalForAll", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "parentNode", + type: "bytes32" + }, + { + internalType: "bytes32", + name: "labelhash", + type: "bytes32" + }, + { + internalType: "uint32", + name: "fuses", + type: "uint32" + }, + { + internalType: "uint64", + name: "expiry", + type: "uint64" + } + ], + name: "setChildFuses", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "controller", + type: "address" + }, + { + internalType: "bool", + name: "active", + type: "bool" + } + ], + name: "setController", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "uint16", + name: "ownerControlledFuses", + type: "uint16" + } + ], + name: "setFuses", + outputs: [ + { + internalType: "uint32", + name: "", + type: "uint32" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "contract IMetadataService", + name: "_metadataService", + type: "address" + } + ], + name: "setMetadataService", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "address", + name: "resolver", + type: "address" + }, + { + internalType: "uint64", + name: "ttl", + type: "uint64" + } + ], + name: "setRecord", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "address", + name: "resolver", + type: "address" + } + ], + name: "setResolver", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "parentNode", + type: "bytes32" + }, + { + internalType: "string", + name: "label", + type: "string" + }, + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "uint32", + name: "fuses", + type: "uint32" + }, + { + internalType: "uint64", + name: "expiry", + type: "uint64" + } + ], + name: "setSubnodeOwner", + outputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "parentNode", + type: "bytes32" + }, + { + internalType: "string", + name: "label", + type: "string" + }, + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "address", + name: "resolver", + type: "address" + }, + { + internalType: "uint64", + name: "ttl", + type: "uint64" + }, + { + internalType: "uint32", + name: "fuses", + type: "uint32" + }, + { + internalType: "uint64", + name: "expiry", + type: "uint64" + } + ], + name: "setSubnodeRecord", + outputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "uint64", + name: "ttl", + type: "uint64" + } + ], + name: "setTTL", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "contract INameWrapperUpgrade", + name: "_upgradeAddress", + type: "address" + } + ], + name: "setUpgradeContract", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes4", + name: "interfaceId", + type: "bytes4" + } + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address" + } + ], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "parentNode", + type: "bytes32" + }, + { + internalType: "bytes32", + name: "labelhash", + type: "bytes32" + }, + { + internalType: "address", + name: "controller", + type: "address" + } + ], + name: "unwrap", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "labelhash", + type: "bytes32" + }, + { + internalType: "address", + name: "registrant", + type: "address" + }, + { + internalType: "address", + name: "controller", + type: "address" + } + ], + name: "unwrapETH2LD", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "parentNode", + type: "bytes32" + }, + { + internalType: "string", + name: "label", + type: "string" + }, + { + internalType: "address", + name: "wrappedOwner", + type: "address" + }, + { + internalType: "address", + name: "resolver", + type: "address" + } + ], + name: "upgrade", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [], + name: "upgradeContract", + outputs: [ + { + internalType: "contract INameWrapperUpgrade", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "string", + name: "label", + type: "string" + }, + { + internalType: "address", + name: "wrappedOwner", + type: "address" + }, + { + internalType: "address", + name: "resolver", + type: "address" + } + ], + name: "upgradeETH2LD", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256" + } + ], + name: "uri", + outputs: [ + { + internalType: "string", + name: "", + type: "string" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + internalType: "address", + name: "wrappedOwner", + type: "address" + }, + { + internalType: "address", + name: "resolver", + type: "address" + } + ], + name: "wrap", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "string", + name: "label", + type: "string" + }, + { + internalType: "address", + name: "wrappedOwner", + type: "address" + }, + { + internalType: "uint16", + name: "ownerControlledFuses", + type: "uint16" + }, + { + internalType: "address", + name: "resolver", + type: "address" + } + ], + name: "wrapETH2LD", + outputs: [], + stateMutability: "nonpayable", + type: "function" + } +]; +class NameWrapper__factory { + static createInterface() { + return new import_interface.Interface(_abi); + } + static connect(address, signerOrProvider) { + return new import_contracts.Contract(address, _abi, signerOrProvider); + } +} +NameWrapper__factory.abi = _abi; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/P256SHA256Algorithm__factory.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/P256SHA256Algorithm__factory.js new file mode 100644 index 000000000..a48cebe0d --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/P256SHA256Algorithm__factory.js @@ -0,0 +1,65 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var P256SHA256Algorithm_factory_exports = {}; +__export(P256SHA256Algorithm_factory_exports, { + P256SHA256Algorithm__factory: () => P256SHA256Algorithm__factory +}); +module.exports = __toCommonJS(P256SHA256Algorithm_factory_exports); +var import_interface = require("@ethersproject/abi/lib/interface"); +var import_contracts = require("@ethersproject/contracts"); +const _abi = [ + { + inputs: [ + { + internalType: "bytes", + name: "key", + type: "bytes" + }, + { + internalType: "bytes", + name: "data", + type: "bytes" + }, + { + internalType: "bytes", + name: "signature", + type: "bytes" + } + ], + name: "verify", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + } +]; +class P256SHA256Algorithm__factory { + static createInterface() { + return new import_interface.Interface(_abi); + } + static connect(address, signerOrProvider) { + return new import_contracts.Contract(address, _abi, signerOrProvider); + } +} +P256SHA256Algorithm__factory.abi = _abi; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/PublicResolver__factory.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/PublicResolver__factory.js new file mode 100644 index 000000000..02bb0961e --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/PublicResolver__factory.js @@ -0,0 +1,1047 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var PublicResolver_factory_exports = {}; +__export(PublicResolver_factory_exports, { + PublicResolver__factory: () => PublicResolver__factory +}); +module.exports = __toCommonJS(PublicResolver_factory_exports); +var import_interface = require("@ethersproject/abi/lib/interface"); +var import_contracts = require("@ethersproject/contracts"); +const _abi = [ + { + inputs: [ + { + internalType: "contract ENS", + name: "_ens", + type: "address" + }, + { + internalType: "contract INameWrapper", + name: "wrapperAddress", + type: "address" + }, + { + internalType: "address", + name: "_trustedETHController", + type: "address" + }, + { + internalType: "address", + name: "_trustedReverseRegistrar", + type: "address" + } + ], + stateMutability: "nonpayable", + type: "constructor" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: true, + internalType: "uint256", + name: "contentType", + type: "uint256" + } + ], + name: "ABIChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "address", + name: "a", + type: "address" + } + ], + name: "AddrChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "uint256", + name: "coinType", + type: "uint256" + }, + { + indexed: false, + internalType: "bytes", + name: "newAddress", + type: "bytes" + } + ], + name: "AddressChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address" + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool" + } + ], + name: "ApprovalForAll", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "owner", + type: "address" + }, + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: true, + internalType: "address", + name: "delegate", + type: "address" + }, + { + indexed: true, + internalType: "bool", + name: "approved", + type: "bool" + } + ], + name: "Approved", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "bytes", + name: "hash", + type: "bytes" + } + ], + name: "ContenthashChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + indexed: false, + internalType: "uint16", + name: "resource", + type: "uint16" + }, + { + indexed: false, + internalType: "bytes", + name: "record", + type: "bytes" + } + ], + name: "DNSRecordChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + indexed: false, + internalType: "uint16", + name: "resource", + type: "uint16" + } + ], + name: "DNSRecordDeleted", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "bytes", + name: "lastzonehash", + type: "bytes" + }, + { + indexed: false, + internalType: "bytes", + name: "zonehash", + type: "bytes" + } + ], + name: "DNSZonehashChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: true, + internalType: "bytes4", + name: "interfaceID", + type: "bytes4" + }, + { + indexed: false, + internalType: "address", + name: "implementer", + type: "address" + } + ], + name: "InterfaceChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "string", + name: "name", + type: "string" + } + ], + name: "NameChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "bytes32", + name: "x", + type: "bytes32" + }, + { + indexed: false, + internalType: "bytes32", + name: "y", + type: "bytes32" + } + ], + name: "PubkeyChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: true, + internalType: "string", + name: "indexedKey", + type: "string" + }, + { + indexed: false, + internalType: "string", + name: "key", + type: "string" + }, + { + indexed: false, + internalType: "string", + name: "value", + type: "string" + } + ], + name: "TextChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "uint64", + name: "newVersion", + type: "uint64" + } + ], + name: "VersionChanged", + type: "event" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "uint256", + name: "contentTypes", + type: "uint256" + } + ], + name: "ABI", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + }, + { + internalType: "bytes", + name: "", + type: "bytes" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "addr", + outputs: [ + { + internalType: "address payable", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "uint256", + name: "coinType", + type: "uint256" + } + ], + name: "addr", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "address", + name: "delegate", + type: "address" + }, + { + internalType: "bool", + name: "approved", + type: "bool" + } + ], + name: "approve", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "clearRecords", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "contenthash", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "bytes32", + name: "name", + type: "bytes32" + }, + { + internalType: "uint16", + name: "resource", + type: "uint16" + } + ], + name: "dnsRecord", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "bytes32", + name: "name", + type: "bytes32" + } + ], + name: "hasDNSRecords", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "bytes4", + name: "interfaceID", + type: "bytes4" + } + ], + name: "interfaceImplementer", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "address", + name: "delegate", + type: "address" + } + ], + name: "isApprovedFor", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address" + }, + { + internalType: "address", + name: "operator", + type: "address" + } + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes[]", + name: "data", + type: "bytes[]" + } + ], + name: "multicall", + outputs: [ + { + internalType: "bytes[]", + name: "results", + type: "bytes[]" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "nodehash", + type: "bytes32" + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]" + } + ], + name: "multicallWithNodeCheck", + outputs: [ + { + internalType: "bytes[]", + name: "results", + type: "bytes[]" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "name", + outputs: [ + { + internalType: "string", + name: "", + type: "string" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "pubkey", + outputs: [ + { + internalType: "bytes32", + name: "x", + type: "bytes32" + }, + { + internalType: "bytes32", + name: "y", + type: "bytes32" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + name: "recordVersions", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "uint256", + name: "contentType", + type: "uint256" + }, + { + internalType: "bytes", + name: "data", + type: "bytes" + } + ], + name: "setABI", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "uint256", + name: "coinType", + type: "uint256" + }, + { + internalType: "bytes", + name: "a", + type: "bytes" + } + ], + name: "setAddr", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "address", + name: "a", + type: "address" + } + ], + name: "setAddr", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address" + }, + { + internalType: "bool", + name: "approved", + type: "bool" + } + ], + name: "setApprovalForAll", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "bytes", + name: "hash", + type: "bytes" + } + ], + name: "setContenthash", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "bytes", + name: "data", + type: "bytes" + } + ], + name: "setDNSRecords", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "bytes4", + name: "interfaceID", + type: "bytes4" + }, + { + internalType: "address", + name: "implementer", + type: "address" + } + ], + name: "setInterface", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "string", + name: "newName", + type: "string" + } + ], + name: "setName", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "bytes32", + name: "x", + type: "bytes32" + }, + { + internalType: "bytes32", + name: "y", + type: "bytes32" + } + ], + name: "setPubkey", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "string", + name: "key", + type: "string" + }, + { + internalType: "string", + name: "value", + type: "string" + } + ], + name: "setText", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "bytes", + name: "hash", + type: "bytes" + } + ], + name: "setZonehash", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes4", + name: "interfaceID", + type: "bytes4" + } + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "string", + name: "key", + type: "string" + } + ], + name: "text", + outputs: [ + { + internalType: "string", + name: "", + type: "string" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "zonehash", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes" + } + ], + stateMutability: "view", + type: "function" + } +]; +class PublicResolver__factory { + static createInterface() { + return new import_interface.Interface(_abi); + } + static connect(address, signerOrProvider) { + return new import_contracts.Contract(address, _abi, signerOrProvider); + } +} +PublicResolver__factory.abi = _abi; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/RSASHA1Algorithm__factory.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/RSASHA1Algorithm__factory.js new file mode 100644 index 000000000..bf2f5322d --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/RSASHA1Algorithm__factory.js @@ -0,0 +1,65 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var RSASHA1Algorithm_factory_exports = {}; +__export(RSASHA1Algorithm_factory_exports, { + RSASHA1Algorithm__factory: () => RSASHA1Algorithm__factory +}); +module.exports = __toCommonJS(RSASHA1Algorithm_factory_exports); +var import_interface = require("@ethersproject/abi/lib/interface"); +var import_contracts = require("@ethersproject/contracts"); +const _abi = [ + { + inputs: [ + { + internalType: "bytes", + name: "key", + type: "bytes" + }, + { + internalType: "bytes", + name: "data", + type: "bytes" + }, + { + internalType: "bytes", + name: "sig", + type: "bytes" + } + ], + name: "verify", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + } +]; +class RSASHA1Algorithm__factory { + static createInterface() { + return new import_interface.Interface(_abi); + } + static connect(address, signerOrProvider) { + return new import_contracts.Contract(address, _abi, signerOrProvider); + } +} +RSASHA1Algorithm__factory.abi = _abi; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/RSASHA256Algorithm__factory.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/RSASHA256Algorithm__factory.js new file mode 100644 index 000000000..e62816c82 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/RSASHA256Algorithm__factory.js @@ -0,0 +1,65 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var RSASHA256Algorithm_factory_exports = {}; +__export(RSASHA256Algorithm_factory_exports, { + RSASHA256Algorithm__factory: () => RSASHA256Algorithm__factory +}); +module.exports = __toCommonJS(RSASHA256Algorithm_factory_exports); +var import_interface = require("@ethersproject/abi/lib/interface"); +var import_contracts = require("@ethersproject/contracts"); +const _abi = [ + { + inputs: [ + { + internalType: "bytes", + name: "key", + type: "bytes" + }, + { + internalType: "bytes", + name: "data", + type: "bytes" + }, + { + internalType: "bytes", + name: "sig", + type: "bytes" + } + ], + name: "verify", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + } +]; +class RSASHA256Algorithm__factory { + static createInterface() { + return new import_interface.Interface(_abi); + } + static connect(address, signerOrProvider) { + return new import_contracts.Contract(address, _abi, signerOrProvider); + } +} +RSASHA256Algorithm__factory.abi = _abi; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/ReverseRegistrar__factory.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/ReverseRegistrar__factory.js new file mode 100644 index 000000000..00b5079a3 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/ReverseRegistrar__factory.js @@ -0,0 +1,370 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var ReverseRegistrar_factory_exports = {}; +__export(ReverseRegistrar_factory_exports, { + ReverseRegistrar__factory: () => ReverseRegistrar__factory +}); +module.exports = __toCommonJS(ReverseRegistrar_factory_exports); +var import_interface = require("@ethersproject/abi/lib/interface"); +var import_contracts = require("@ethersproject/contracts"); +const _abi = [ + { + inputs: [ + { + internalType: "contract ENS", + name: "ensAddr", + type: "address" + } + ], + stateMutability: "nonpayable", + type: "constructor" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "controller", + type: "address" + }, + { + indexed: false, + internalType: "bool", + name: "enabled", + type: "bool" + } + ], + name: "ControllerChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "contract NameResolver", + name: "resolver", + type: "address" + } + ], + name: "DefaultResolverChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "previousOwner", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "newOwner", + type: "address" + } + ], + name: "OwnershipTransferred", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "addr", + type: "address" + }, + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "ReverseClaimed", + type: "event" + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address" + } + ], + name: "claim", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "addr", + type: "address" + }, + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "address", + name: "resolver", + type: "address" + } + ], + name: "claimForAddr", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "address", + name: "resolver", + type: "address" + } + ], + name: "claimWithResolver", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + name: "controllers", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "defaultResolver", + outputs: [ + { + internalType: "contract NameResolver", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "ens", + outputs: [ + { + internalType: "contract ENS", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "addr", + type: "address" + } + ], + name: "node", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + stateMutability: "pure", + type: "function" + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "renounceOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "controller", + type: "address" + }, + { + internalType: "bool", + name: "enabled", + type: "bool" + } + ], + name: "setController", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "resolver", + type: "address" + } + ], + name: "setDefaultResolver", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "string", + name: "name", + type: "string" + } + ], + name: "setName", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "addr", + type: "address" + }, + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "address", + name: "resolver", + type: "address" + }, + { + internalType: "string", + name: "name", + type: "string" + } + ], + name: "setNameForAddr", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address" + } + ], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function" + } +]; +class ReverseRegistrar__factory { + static createInterface() { + return new import_interface.Interface(_abi); + } + static connect(address, signerOrProvider) { + return new import_contracts.Contract(address, _abi, signerOrProvider); + } +} +ReverseRegistrar__factory.abi = _abi; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/Root__factory.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/Root__factory.js new file mode 100644 index 000000000..b867a1405 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/Root__factory.js @@ -0,0 +1,260 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var Root_factory_exports = {}; +__export(Root_factory_exports, { + Root__factory: () => Root__factory +}); +module.exports = __toCommonJS(Root_factory_exports); +var import_interface = require("@ethersproject/abi/lib/interface"); +var import_contracts = require("@ethersproject/contracts"); +const _abi = [ + { + inputs: [ + { + internalType: "contract ENS", + name: "_ens", + type: "address" + } + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "label", + type: "bytes32" + } + ], + name: "TLDLocked", + type: "event" + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + name: "controllers", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [], + name: "ens", + outputs: [ + { + internalType: "contract ENS", + name: "", + type: "address" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "addr", + type: "address" + } + ], + name: "isOwner", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "label", + type: "bytes32" + } + ], + name: "lock", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + name: "locked", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "controller", + type: "address" + }, + { + internalType: "bool", + name: "enabled", + type: "bool" + } + ], + name: "setController", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "resolver", + type: "address" + } + ], + name: "setResolver", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "label", + type: "bytes32" + }, + { + internalType: "address", + name: "owner", + type: "address" + } + ], + name: "setSubnodeOwner", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "bytes4", + name: "interfaceID", + type: "bytes4" + } + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + payable: false, + stateMutability: "pure", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address" + } + ], + name: "transferOwnership", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + } +]; +class Root__factory { + static createInterface() { + return new import_interface.Interface(_abi); + } + static connect(address, signerOrProvider) { + return new import_contracts.Contract(address, _abi, signerOrProvider); + } +} +Root__factory.abi = _abi; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/SHA1Digest__factory.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/SHA1Digest__factory.js new file mode 100644 index 000000000..807719ff9 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/SHA1Digest__factory.js @@ -0,0 +1,60 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var SHA1Digest_factory_exports = {}; +__export(SHA1Digest_factory_exports, { + SHA1Digest__factory: () => SHA1Digest__factory +}); +module.exports = __toCommonJS(SHA1Digest_factory_exports); +var import_interface = require("@ethersproject/abi/lib/interface"); +var import_contracts = require("@ethersproject/contracts"); +const _abi = [ + { + inputs: [ + { + internalType: "bytes", + name: "data", + type: "bytes" + }, + { + internalType: "bytes", + name: "hash", + type: "bytes" + } + ], + name: "verify", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "pure", + type: "function" + } +]; +class SHA1Digest__factory { + static createInterface() { + return new import_interface.Interface(_abi); + } + static connect(address, signerOrProvider) { + return new import_contracts.Contract(address, _abi, signerOrProvider); + } +} +SHA1Digest__factory.abi = _abi; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/SHA1NSEC3Digest__factory.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/SHA1NSEC3Digest__factory.js new file mode 100644 index 000000000..3e34e60b4 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/SHA1NSEC3Digest__factory.js @@ -0,0 +1,65 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var SHA1NSEC3Digest_factory_exports = {}; +__export(SHA1NSEC3Digest_factory_exports, { + SHA1NSEC3Digest__factory: () => SHA1NSEC3Digest__factory +}); +module.exports = __toCommonJS(SHA1NSEC3Digest_factory_exports); +var import_interface = require("@ethersproject/abi/lib/interface"); +var import_contracts = require("@ethersproject/contracts"); +const _abi = [ + { + inputs: [ + { + internalType: "bytes", + name: "salt", + type: "bytes" + }, + { + internalType: "bytes", + name: "data", + type: "bytes" + }, + { + internalType: "uint256", + name: "iterations", + type: "uint256" + } + ], + name: "hash", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + stateMutability: "pure", + type: "function" + } +]; +class SHA1NSEC3Digest__factory { + static createInterface() { + return new import_interface.Interface(_abi); + } + static connect(address, signerOrProvider) { + return new import_contracts.Contract(address, _abi, signerOrProvider); + } +} +SHA1NSEC3Digest__factory.abi = _abi; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/SHA256Digest__factory.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/SHA256Digest__factory.js new file mode 100644 index 000000000..2ba454da9 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/SHA256Digest__factory.js @@ -0,0 +1,60 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var SHA256Digest_factory_exports = {}; +__export(SHA256Digest_factory_exports, { + SHA256Digest__factory: () => SHA256Digest__factory +}); +module.exports = __toCommonJS(SHA256Digest_factory_exports); +var import_interface = require("@ethersproject/abi/lib/interface"); +var import_contracts = require("@ethersproject/contracts"); +const _abi = [ + { + inputs: [ + { + internalType: "bytes", + name: "data", + type: "bytes" + }, + { + internalType: "bytes", + name: "hash", + type: "bytes" + } + ], + name: "verify", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "pure", + type: "function" + } +]; +class SHA256Digest__factory { + static createInterface() { + return new import_interface.Interface(_abi); + } + static connect(address, signerOrProvider) { + return new import_contracts.Contract(address, _abi, signerOrProvider); + } +} +SHA256Digest__factory.abi = _abi; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/StaticMetadataService__factory.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/StaticMetadataService__factory.js new file mode 100644 index 000000000..50b64d00a --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/StaticMetadataService__factory.js @@ -0,0 +1,70 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var StaticMetadataService_factory_exports = {}; +__export(StaticMetadataService_factory_exports, { + StaticMetadataService__factory: () => StaticMetadataService__factory +}); +module.exports = __toCommonJS(StaticMetadataService_factory_exports); +var import_interface = require("@ethersproject/abi/lib/interface"); +var import_contracts = require("@ethersproject/contracts"); +const _abi = [ + { + inputs: [ + { + internalType: "string", + name: "_metaDataUri", + type: "string" + } + ], + stateMutability: "nonpayable", + type: "constructor" + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + name: "uri", + outputs: [ + { + internalType: "string", + name: "", + type: "string" + } + ], + stateMutability: "view", + type: "function" + } +]; +class StaticMetadataService__factory { + static createInterface() { + return new import_interface.Interface(_abi); + } + static connect(address, signerOrProvider) { + return new import_contracts.Contract( + address, + _abi, + signerOrProvider + ); + } +} +StaticMetadataService__factory.abi = _abi; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/TLDPublicSuffixList__factory.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/TLDPublicSuffixList__factory.js new file mode 100644 index 000000000..0bfc6dd70 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/TLDPublicSuffixList__factory.js @@ -0,0 +1,55 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var TLDPublicSuffixList_factory_exports = {}; +__export(TLDPublicSuffixList_factory_exports, { + TLDPublicSuffixList__factory: () => TLDPublicSuffixList__factory +}); +module.exports = __toCommonJS(TLDPublicSuffixList_factory_exports); +var import_interface = require("@ethersproject/abi/lib/interface"); +var import_contracts = require("@ethersproject/contracts"); +const _abi = [ + { + inputs: [ + { + internalType: "bytes", + name: "name", + type: "bytes" + } + ], + name: "isPublicSuffix", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + } +]; +class TLDPublicSuffixList__factory { + static createInterface() { + return new import_interface.Interface(_abi); + } + static connect(address, signerOrProvider) { + return new import_contracts.Contract(address, _abi, signerOrProvider); + } +} +TLDPublicSuffixList__factory.abi = _abi; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/UniversalResolver__factory.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/UniversalResolver__factory.js new file mode 100644 index 000000000..224da6513 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/UniversalResolver__factory.js @@ -0,0 +1,563 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var UniversalResolver_factory_exports = {}; +__export(UniversalResolver_factory_exports, { + UniversalResolver__factory: () => UniversalResolver__factory +}); +module.exports = __toCommonJS(UniversalResolver_factory_exports); +var import_interface = require("@ethersproject/abi/lib/interface"); +var import_contracts = require("@ethersproject/contracts"); +const _abi = [ + { + inputs: [ + { + internalType: "address", + name: "_registry", + type: "address" + }, + { + internalType: "string[]", + name: "_urls", + type: "string[]" + } + ], + stateMutability: "nonpayable", + type: "constructor" + }, + { + inputs: [ + { + internalType: "address", + name: "sender", + type: "address" + }, + { + internalType: "string[]", + name: "urls", + type: "string[]" + }, + { + internalType: "bytes", + name: "callData", + type: "bytes" + }, + { + internalType: "bytes4", + name: "callbackFunction", + type: "bytes4" + }, + { + internalType: "bytes", + name: "extraData", + type: "bytes" + } + ], + name: "OffchainLookup", + type: "error" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "previousOwner", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "newOwner", + type: "address" + } + ], + name: "OwnershipTransferred", + type: "event" + }, + { + inputs: [ + { + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + internalType: "bytes", + name: "data", + type: "bytes" + }, + { + internalType: "string[]", + name: "gateways", + type: "string[]" + }, + { + internalType: "bytes4", + name: "callbackFunction", + type: "bytes4" + }, + { + internalType: "bytes", + name: "metaData", + type: "bytes" + } + ], + name: "_resolveSingle", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes" + }, + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + name: "batchGatewayURLs", + outputs: [ + { + internalType: "string", + name: "", + type: "string" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "name", + type: "bytes" + } + ], + name: "findResolver", + outputs: [ + { + internalType: "contract Resolver", + name: "", + type: "address" + }, + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "registry", + outputs: [ + { + internalType: "contract ENS", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "renounceOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + internalType: "bytes", + name: "data", + type: "bytes" + }, + { + internalType: "string[]", + name: "gateways", + type: "string[]" + } + ], + name: "resolve", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes" + }, + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]" + } + ], + name: "resolve", + outputs: [ + { + internalType: "bytes[]", + name: "", + type: "bytes[]" + }, + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]" + }, + { + internalType: "string[]", + name: "gateways", + type: "string[]" + } + ], + name: "resolve", + outputs: [ + { + internalType: "bytes[]", + name: "", + type: "bytes[]" + }, + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + internalType: "bytes", + name: "data", + type: "bytes" + } + ], + name: "resolve", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes" + }, + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "response", + type: "bytes" + }, + { + internalType: "bytes", + name: "extraData", + type: "bytes" + } + ], + name: "resolveCallback", + outputs: [ + { + internalType: "bytes[]", + name: "", + type: "bytes[]" + }, + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "response", + type: "bytes" + }, + { + internalType: "bytes", + name: "extraData", + type: "bytes" + } + ], + name: "resolveSingleCallback", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes" + }, + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "reverseName", + type: "bytes" + }, + { + internalType: "string[]", + name: "gateways", + type: "string[]" + } + ], + name: "reverse", + outputs: [ + { + internalType: "string", + name: "", + type: "string" + }, + { + internalType: "address", + name: "", + type: "address" + }, + { + internalType: "address", + name: "", + type: "address" + }, + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "reverseName", + type: "bytes" + } + ], + name: "reverse", + outputs: [ + { + internalType: "string", + name: "", + type: "string" + }, + { + internalType: "address", + name: "", + type: "address" + }, + { + internalType: "address", + name: "", + type: "address" + }, + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "response", + type: "bytes" + }, + { + internalType: "bytes", + name: "extraData", + type: "bytes" + } + ], + name: "reverseCallback", + outputs: [ + { + internalType: "string", + name: "", + type: "string" + }, + { + internalType: "address", + name: "", + type: "address" + }, + { + internalType: "address", + name: "", + type: "address" + }, + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "string[]", + name: "_urls", + type: "string[]" + } + ], + name: "setGatewayURLs", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes4", + name: "interfaceId", + type: "bytes4" + } + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address" + } + ], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function" + } +]; +class UniversalResolver__factory { + static createInterface() { + return new import_interface.Interface(_abi); + } + static connect(address, signerOrProvider) { + return new import_contracts.Contract(address, _abi, signerOrProvider); + } +} +UniversalResolver__factory.abi = _abi; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/index.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/index.js new file mode 100644 index 000000000..a477ac08f --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/factories/index.js @@ -0,0 +1,64 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var factories_exports = {}; +__export(factories_exports, { + BaseRegistrarImplementation__factory: () => import_BaseRegistrarImplementation_factory.BaseRegistrarImplementation__factory, + BulkRenewal__factory: () => import_BulkRenewal_factory.BulkRenewal__factory, + DNSRegistrar__factory: () => import_DNSRegistrar_factory.DNSRegistrar__factory, + DNSSECImpl__factory: () => import_DNSSECImpl_factory.DNSSECImpl__factory, + DefaultReverseResolver__factory: () => import_DefaultReverseResolver_factory.DefaultReverseResolver__factory, + ENSRegistry__factory: () => import_ENSRegistry_factory.ENSRegistry__factory, + ETHRegistrarController__factory: () => import_ETHRegistrarController_factory.ETHRegistrarController__factory, + Multicall__factory: () => import_Multicall_factory.Multicall__factory, + NameWrapper__factory: () => import_NameWrapper_factory.NameWrapper__factory, + P256SHA256Algorithm__factory: () => import_P256SHA256Algorithm_factory.P256SHA256Algorithm__factory, + PublicResolver__factory: () => import_PublicResolver_factory.PublicResolver__factory, + RSASHA1Algorithm__factory: () => import_RSASHA1Algorithm_factory.RSASHA1Algorithm__factory, + RSASHA256Algorithm__factory: () => import_RSASHA256Algorithm_factory.RSASHA256Algorithm__factory, + ReverseRegistrar__factory: () => import_ReverseRegistrar_factory.ReverseRegistrar__factory, + Root__factory: () => import_Root_factory.Root__factory, + SHA1Digest__factory: () => import_SHA1Digest_factory.SHA1Digest__factory, + SHA1NSEC3Digest__factory: () => import_SHA1NSEC3Digest_factory.SHA1NSEC3Digest__factory, + SHA256Digest__factory: () => import_SHA256Digest_factory.SHA256Digest__factory, + StaticMetadataService__factory: () => import_StaticMetadataService_factory.StaticMetadataService__factory, + TLDPublicSuffixList__factory: () => import_TLDPublicSuffixList_factory.TLDPublicSuffixList__factory, + UniversalResolver__factory: () => import_UniversalResolver_factory.UniversalResolver__factory +}); +module.exports = __toCommonJS(factories_exports); +var import_BaseRegistrarImplementation_factory = require("./BaseRegistrarImplementation__factory"); +var import_BulkRenewal_factory = require("./BulkRenewal__factory"); +var import_DNSRegistrar_factory = require("./DNSRegistrar__factory"); +var import_DNSSECImpl_factory = require("./DNSSECImpl__factory"); +var import_DefaultReverseResolver_factory = require("./DefaultReverseResolver__factory"); +var import_ENSRegistry_factory = require("./ENSRegistry__factory"); +var import_ETHRegistrarController_factory = require("./ETHRegistrarController__factory"); +var import_Multicall_factory = require("./Multicall__factory"); +var import_NameWrapper_factory = require("./NameWrapper__factory"); +var import_P256SHA256Algorithm_factory = require("./P256SHA256Algorithm__factory"); +var import_PublicResolver_factory = require("./PublicResolver__factory"); +var import_RSASHA1Algorithm_factory = require("./RSASHA1Algorithm__factory"); +var import_RSASHA256Algorithm_factory = require("./RSASHA256Algorithm__factory"); +var import_ReverseRegistrar_factory = require("./ReverseRegistrar__factory"); +var import_Root_factory = require("./Root__factory"); +var import_SHA1Digest_factory = require("./SHA1Digest__factory"); +var import_SHA1NSEC3Digest_factory = require("./SHA1NSEC3Digest__factory"); +var import_SHA256Digest_factory = require("./SHA256Digest__factory"); +var import_StaticMetadataService_factory = require("./StaticMetadataService__factory"); +var import_TLDPublicSuffixList_factory = require("./TLDPublicSuffixList__factory"); +var import_UniversalResolver_factory = require("./UniversalResolver__factory"); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/generated/index.js b/.yalc/@ensdomains/ensjs/dist/cjs/generated/index.js new file mode 100644 index 000000000..b5bcb3044 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/generated/index.js @@ -0,0 +1,72 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var generated_exports = {}; +__export(generated_exports, { + BaseRegistrarImplementation__factory: () => import_BaseRegistrarImplementation_factory.BaseRegistrarImplementation__factory, + BulkRenewal__factory: () => import_BulkRenewal_factory.BulkRenewal__factory, + DNSRegistrar__factory: () => import_DNSRegistrar_factory.DNSRegistrar__factory, + DNSSECImpl__factory: () => import_DNSSECImpl_factory.DNSSECImpl__factory, + DefaultReverseResolver__factory: () => import_DefaultReverseResolver_factory.DefaultReverseResolver__factory, + ENSRegistry__factory: () => import_ENSRegistry_factory.ENSRegistry__factory, + ETHRegistrarController__factory: () => import_ETHRegistrarController_factory.ETHRegistrarController__factory, + Multicall__factory: () => import_Multicall_factory.Multicall__factory, + NameWrapper__factory: () => import_NameWrapper_factory.NameWrapper__factory, + P256SHA256Algorithm__factory: () => import_P256SHA256Algorithm_factory.P256SHA256Algorithm__factory, + PublicResolver__factory: () => import_PublicResolver_factory.PublicResolver__factory, + RSASHA1Algorithm__factory: () => import_RSASHA1Algorithm_factory.RSASHA1Algorithm__factory, + RSASHA256Algorithm__factory: () => import_RSASHA256Algorithm_factory.RSASHA256Algorithm__factory, + ReverseRegistrar__factory: () => import_ReverseRegistrar_factory.ReverseRegistrar__factory, + Root__factory: () => import_Root_factory.Root__factory, + SHA1Digest__factory: () => import_SHA1Digest_factory.SHA1Digest__factory, + SHA1NSEC3Digest__factory: () => import_SHA1NSEC3Digest_factory.SHA1NSEC3Digest__factory, + SHA256Digest__factory: () => import_SHA256Digest_factory.SHA256Digest__factory, + StaticMetadataService__factory: () => import_StaticMetadataService_factory.StaticMetadataService__factory, + TLDPublicSuffixList__factory: () => import_TLDPublicSuffixList_factory.TLDPublicSuffixList__factory, + UniversalResolver__factory: () => import_UniversalResolver_factory.UniversalResolver__factory, + factories: () => factories +}); +module.exports = __toCommonJS(generated_exports); +var factories = __toESM(require("./factories")); +var import_BaseRegistrarImplementation_factory = require("./factories/BaseRegistrarImplementation__factory"); +var import_DefaultReverseResolver_factory = require("./factories/DefaultReverseResolver__factory"); +var import_DNSRegistrar_factory = require("./factories/DNSRegistrar__factory"); +var import_DNSSECImpl_factory = require("./factories/DNSSECImpl__factory"); +var import_ENSRegistry_factory = require("./factories/ENSRegistry__factory"); +var import_ETHRegistrarController_factory = require("./factories/ETHRegistrarController__factory"); +var import_P256SHA256Algorithm_factory = require("./factories/P256SHA256Algorithm__factory"); +var import_PublicResolver_factory = require("./factories/PublicResolver__factory"); +var import_ReverseRegistrar_factory = require("./factories/ReverseRegistrar__factory"); +var import_Root_factory = require("./factories/Root__factory"); +var import_RSASHA1Algorithm_factory = require("./factories/RSASHA1Algorithm__factory"); +var import_RSASHA256Algorithm_factory = require("./factories/RSASHA256Algorithm__factory"); +var import_SHA1Digest_factory = require("./factories/SHA1Digest__factory"); +var import_SHA1NSEC3Digest_factory = require("./factories/SHA1NSEC3Digest__factory"); +var import_SHA256Digest_factory = require("./factories/SHA256Digest__factory"); +var import_TLDPublicSuffixList_factory = require("./factories/TLDPublicSuffixList__factory"); +var import_Multicall_factory = require("./factories/Multicall__factory"); +var import_NameWrapper_factory = require("./factories/NameWrapper__factory"); +var import_StaticMetadataService_factory = require("./factories/StaticMetadataService__factory"); +var import_UniversalResolver_factory = require("./factories/UniversalResolver__factory"); +var import_BulkRenewal_factory = require("./factories/BulkRenewal__factory"); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/index.js b/.yalc/@ensdomains/ensjs/dist/cjs/index.js new file mode 100644 index 000000000..1e887b9e1 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/index.js @@ -0,0 +1,332 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var src_exports = {}; +__export(src_exports, { + ENS: () => ENS, + graphURIEndpoints: () => graphURIEndpoints +}); +module.exports = __toCommonJS(src_exports); +var import_getContractAddress = require("./contracts/getContractAddress"); +var import_contracts2 = __toESM(require("./contracts/index")); +var import_GqlManager = __toESM(require("./GqlManager")); +var import_singleCall = __toESM(require("./utils/singleCall")); +var import_writeTx = __toESM(require("./utils/writeTx")); +const graphURIEndpoints = { + 1: "https://api.thegraph.com/subgraphs/name/ensdomains/ens", + 3: "https://api.thegraph.com/subgraphs/name/ensdomains/ensropsten", + 4: "https://api.thegraph.com/subgraphs/name/ensdomains/ensrinkeby", + 5: "https://api.thegraph.com/subgraphs/name/ensdomains/ensgoerli" +}; +class ENS { + constructor(options) { + this.getContractAddress = import_getContractAddress.getContractAddress; + this.gqlInstance = new import_GqlManager.default(); + this.checkInitialProvider = async () => { + if (!this.initialProvider) { + return; + } + await this.setProvider(this.initialProvider); + }; + this.forwardDependenciesFromArray = (dependencies) => Object.fromEntries( + dependencies.map((dep) => [dep, this[dep]]) + ); + this.getModule = async (path, exportName) => { + var _a; + let mod = await import( + /* webpackMode: "lazy", webpackChunkName: "[request]", webpackPreload: true, webpackExclude: /.*\.ts$/ */ + `./functions/${path}` + ); + if ((_a = mod.default) == null ? void 0 : _a[exportName]) { + mod = mod.default; + } + return mod; + }; + this.getFunction = (subFunc, writeable, exportName, mod, _path) => subFunc && !writeable ? mod[exportName][subFunc] : mod[exportName]; + this.importGenerator = (path, dependencies, exportName = "default", subFunc, passthrough) => { + if (subFunc === "batch") { + return (...args) => ({ args, ...passthrough }); + } + const thisRef = this; + const mainFunc = async function(...args) { + var _a; + await thisRef.checkInitialProvider(); + const mod = await thisRef.getModule(path, exportName); + if (subFunc !== "combine") { + const writeable = subFunc === "write" || subFunc === "populateTransaction"; + const func = thisRef.getFunction( + subFunc, + writeable, + exportName, + mod, + path + ); + let dependenciesToForward2 = thisRef.forwardDependenciesFromArray(dependencies); + if (writeable) { + const options = args[1] || {}; + const signer = options.signer || ((_a = thisRef.provider) == null ? void 0 : _a.getSigner(options.addressOrIndex)); + const populate = subFunc === "populateTransaction"; + if (!signer) { + throw new Error("No signer specified"); + } + delete options.addressOrIndex; + delete options.signer; + dependenciesToForward2 = { ...dependenciesToForward2, signer }; + return func(dependenciesToForward2, args[0], options).then( + (0, import_writeTx.default)(signer, populate) + ); + } + return func(dependenciesToForward2, ...args); + } + const dependenciesToForward = thisRef.forwardDependenciesFromArray(dependencies); + return (0, import_singleCall.default)( + thisRef.provider, + dependenciesToForward, + thisRef.getFunction(void 0, void 0, exportName, mod, path), + ...args + ); + }; + if (subFunc === "combine") { + mainFunc.raw = this.importGenerator( + path, + dependencies, + exportName, + "raw" + ); + mainFunc.decode = this.importGenerator( + path, + dependencies, + exportName, + "decode" + ); + mainFunc.batch = this.importGenerator( + path, + dependencies, + exportName, + "batch", + { raw: mainFunc.raw, decode: mainFunc.decode } + ); + } else if (subFunc === "write") { + mainFunc.populateTransaction = this.importGenerator( + path, + dependencies, + exportName, + "populateTransaction" + ); + } + return mainFunc; + }; + this.generateFunction = (path, dependencies, exportName = "default") => this.importGenerator(path, dependencies, exportName); + this.generateWriteFunction = (path, dependencies, exportName = "default") => this.importGenerator( + path, + dependencies, + exportName, + "write" + ); + this.generateRawFunction = (path, dependencies, exportName = "default") => this.importGenerator( + path, + dependencies, + exportName, + "combine" + ); + this.setProvider = async (provider) => { + this.provider = provider; + const network = this.staticNetwork ? this.provider._network.chainId : (await this.provider.getNetwork()).chainId; + if (this.options && this.options.graphURI) { + this.graphURI = this.options.graphURI; + } else { + this.graphURI = graphURIEndpoints[network]; + } + await this.gqlInstance.setUrl(this.graphURI); + this.contracts = new import_contracts2.default( + this.provider, + this.getContractAddress(String(network)) + ); + }; + this.withProvider = (provider) => { + const newENS = new ENS(this.options); + newENS.initialProvider = provider; + return newENS; + }; + this.batch = this.generateRawFunction( + "initialGetters", + ["multicallWrapper"], + "batch" + ); + this.getProfile = this.generateFunction( + "initialGetters", + [ + "contracts", + "gqlInstance", + "getName", + "resolverMulticallWrapper", + "multicallWrapper", + "_getAddr", + "_getContentHash", + "_getText" + ], + "getProfile" + ); + this.getRecords = this.generateFunction( + "initialGetters", + ["getProfile"], + "getRecords" + ); + this.getName = this.generateRawFunction( + "initialGetters", + ["contracts"], + "getName" + ); + this.getResolver = this.generateRawFunction( + "getResolver", + ["contracts"] + ); + this.getWrapperData = this.generateRawFunction("getWrapperData", ["contracts"]); + this.getHistory = this.generateFunction( + "getHistory", + ["gqlInstance"], + "getHistory" + ); + this.getContentHash = this.generateRawFunction("initialGetters", ["contracts", "universalWrapper"], "getContentHash"); + this._getContentHash = this.generateRawFunction("initialGetters", ["contracts"], "_getContentHash"); + this.getAddr = this.generateRawFunction( + "initialGetters", + ["contracts", "universalWrapper"], + "getAddr" + ); + this._getAddr = this.generateRawFunction( + "initialGetters", + ["contracts"], + "_getAddr" + ); + this.getText = this.generateRawFunction( + "initialGetters", + ["contracts", "universalWrapper"], + "getText" + ); + this._getText = this.generateRawFunction( + "initialGetters", + ["contracts"], + "_getText" + ); + this.getABI = this.generateRawFunction( + "initialGetters", + ["contracts", "universalWrapper"], + "getABI" + ); + this._getABI = this.generateRawFunction( + "initialGetters", + ["contracts"], + "_getABI" + ); + this.getOwner = this.generateRawFunction( + "initialGetters", + ["contracts", "multicallWrapper", "gqlInstance"], + "getOwner" + ); + this.getExpiry = this.generateRawFunction( + "initialGetters", + ["contracts", "multicallWrapper"], + "getExpiry" + ); + this.getSubnames = this.generateFunction( + "initialGetters", + ["gqlInstance"], + "getSubnames" + ); + this.getNames = this.generateFunction( + "initialGetters", + ["gqlInstance"], + "getNames" + ); + this.getPrice = this.generateRawFunction( + "initialGetters", + ["contracts", "multicallWrapper"], + "getPrice" + ); + this.getDNSOwner = this.generateFunction( + "getDNSOwner", + [] + ); + this.supportsTLD = this.generateFunction( + "initialGetters", + ["getOwner", "provider"], + "supportsTLD" + ); + this.getAvailable = this.generateRawFunction( + "getAvailable", + ["contracts"] + ); + this.universalWrapper = this.generateRawFunction("initialGetters", ["contracts"], "universalWrapper"); + this.resolverMulticallWrapper = this.generateRawFunction("initialGetters", ["contracts"], "resolverMulticallWrapper"); + this.multicallWrapper = this.generateRawFunction("initialGetters", ["contracts"], "multicallWrapper"); + this.setName = this.generateWriteFunction( + "setName", + ["contracts"] + ); + this.setRecords = this.generateWriteFunction( + "setRecords", + ["contracts", "provider", "getResolver"] + ); + this.setRecord = this.generateWriteFunction( + "setRecord", + ["contracts", "provider", "getResolver"] + ); + this.setResolver = this.generateWriteFunction( + "setResolver", + ["contracts"] + ); + this.transferName = this.generateWriteFunction("transferName", ["contracts"]); + this.transferController = this.generateWriteFunction("transferController", ["contracts"]); + this.wrapName = this.generateWriteFunction( + "wrapName", + ["contracts"] + ); + this.unwrapName = this.generateWriteFunction( + "unwrapName", + ["contracts"] + ); + this.setFuses = this.generateWriteFunction( + "setFuses", + ["contracts"] + ); + this.setChildFuses = this.generateWriteFunction("setFuses", ["contracts"], "setChildFuses"); + this.importDNSSECName = this.generateWriteFunction("importDNSSECName", ["contracts", "provider", "signer"]); + this.createSubname = this.generateWriteFunction("createSubname", ["contracts", "getExpiry"]); + this.deleteSubname = this.generateWriteFunction("deleteSubname", ["contracts"]); + this.transferSubname = this.generateWriteFunction("transferSubname", ["contracts", "getExpiry"]); + this.commitName = this.generateWriteFunction( + "commitName", + ["contracts"] + ); + this.registerName = this.generateWriteFunction("registerName", ["contracts"]); + this.renewNames = this.generateWriteFunction( + "renewNames", + ["contracts"] + ); + this.extendWrappedName = this.generateWriteFunction("renewNames", ["contracts"], "extendWrappedName"); + this.options = options; + this.getContractAddress = (options == null ? void 0 : options.getContractAddress) || import_getContractAddress.getContractAddress; + } +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/static.js b/.yalc/@ensdomains/ensjs/dist/cjs/static.js new file mode 100644 index 000000000..842387898 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/static.js @@ -0,0 +1,85 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var static_exports = {}; +__export(static_exports, { + default: () => static_default +}); +module.exports = __toCommonJS(static_exports); +var import_graphql_request = require("graphql-request"); +var import_language = require("graphql/language"); +var import_traverse = __toESM(require("traverse")); +var import_contracts = __toESM(require("./contracts/index")); +var import_index = require("./index"); +var import_GqlManager = require("./GqlManager"); +class StaticENS extends import_index.ENS { + constructor(provider, { functions, contracts, ...options }) { + super(options); + this.gqlInstance = { + client: { request: () => Promise.resolve(null) }, + setUrl: () => Promise.resolve(), + gql: (query) => query.join() + }; + this.setStaticProvider = (provider) => { + this.provider = provider; + const network = provider.network.chainId; + if (this.options && this.options.graphURI) { + this.graphURI = this.options.graphURI; + } else { + this.graphURI = import_index.graphURIEndpoints[network]; + } + if (this.graphURI) { + const client = new import_graphql_request.GraphQLClient(this.graphURI, { + requestMiddleware: (0, import_GqlManager.requestMiddleware)(import_language.visit, import_language.parse, import_language.print), + responseMiddleware: (0, import_GqlManager.responseMiddleware)(import_traverse.default) + }); + this.gqlInstance = { + client, + setUrl: () => Promise.resolve(), + gql: import_graphql_request.gql + }; + } + this.contracts = new import_contracts.default( + provider, + this.getContractAddress(String(network)), + (name) => Promise.resolve(this.contractsObject[name]) + ); + }; + this.setProvider = async (provider) => { + this.setStaticProvider(provider); + }; + this.getModule = async () => this.functions; + this.getFunction = (subFunc, _writeable, exportName, mod, path) => { + const base = mod[exportName === "default" ? path : exportName]; + if (subFunc === "raw" || subFunc === "decode") { + return base[subFunc]; + } + return base; + }; + this.functions = functions; + this.contractsObject = contracts; + this.setStaticProvider(provider); + } +} +var static_default = StaticENS; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/utils/ccip.js b/.yalc/@ensdomains/ensjs/dist/cjs/utils/ccip.js new file mode 100644 index 000000000..5e5a67431 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/utils/ccip.js @@ -0,0 +1,129 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var ccip_exports = {}; +__export(ccip_exports, { + default: () => ccip_default +}); +module.exports = __toCommonJS(ccip_exports); +var import_bignumber = require("@ethersproject/bignumber/lib/bignumber"); +var import_bytes = require("@ethersproject/bytes"); +var import_utf8 = require("@ethersproject/strings/lib/utf8"); +function bytesPad(value) { + if (value.length % 32 === 0) { + return value; + } + const result = new Uint8Array(Math.ceil(value.length / 32) * 32); + result.set(value); + return result; +} +function numPad(value) { + const result = (0, import_bytes.arrayify)(value); + if (result.length > 32) { + throw new Error("internal; should not happen"); + } + const padded = new Uint8Array(32); + padded.set(result, 32 - result.length); + return padded; +} +function encodeBytes(datas) { + const result = []; + let byteCount = 0; + for (let i = 0; i < datas.length; i += 1) { + result.push(new Uint8Array(0)); + byteCount += 32; + } + for (let i = 0; i < datas.length; i += 1) { + const data = (0, import_bytes.arrayify)(datas[i]); + result[i] = numPad(byteCount); + result.push(numPad(data.length)); + result.push(bytesPad(data)); + byteCount += 32 + Math.ceil(data.length / 32) * 32; + } + return (0, import_bytes.hexConcat)(result); +} +function _parseBytes(result, start) { + if (result === "0x") { + return null; + } + const offset = import_bignumber.BigNumber.from( + (0, import_bytes.hexDataSlice)(result, start, start + 32) + ).toNumber(); + const length = import_bignumber.BigNumber.from( + (0, import_bytes.hexDataSlice)(result, offset, offset + 32) + ).toNumber(); + return (0, import_bytes.hexDataSlice)(result, offset + 32, offset + 32 + length); +} +function _parseString(result, start) { + try { + const bytes = _parseBytes(result, start); + if (bytes == null) + return null; + return (0, import_utf8.toUtf8String)(bytes); + } catch (error) { + } + return null; +} +const ccipLookup = async (provider, transaction, result) => { + const txSender = transaction.to; + try { + const data = (0, import_bytes.hexDataSlice)(result, 4); + const sender = (0, import_bytes.hexDataSlice)(data, 0, 32); + if (!import_bignumber.BigNumber.from(sender).eq(txSender)) { + throw new Error("CCIP Read sender did not match"); + } + const urls = []; + const urlsOffset = import_bignumber.BigNumber.from((0, import_bytes.hexDataSlice)(data, 32, 64)).toNumber(); + const urlsLength = import_bignumber.BigNumber.from( + (0, import_bytes.hexDataSlice)(data, urlsOffset, urlsOffset + 32) + ).toNumber(); + const urlsData = (0, import_bytes.hexDataSlice)(data, urlsOffset + 32); + for (let u = 0; u < urlsLength; u += 1) { + const url = _parseString(urlsData, u * 32); + if (url == null) { + throw new Error("CCIP Read contained corrupt URL string"); + } + urls.push(url); + } + const calldata = _parseBytes(data, 64); + if (!import_bignumber.BigNumber.from((0, import_bytes.hexDataSlice)(data, 100, 128)).isZero()) { + throw new Error("CCIP Read callback selected included junk"); + } + const callbackSelector = (0, import_bytes.hexDataSlice)(data, 96, 100); + const extraData = _parseBytes(data, 128); + const ccipResult = await provider.ccipReadFetch( + transaction, + calldata, + urls + ); + if (ccipResult == null) { + throw new Error("CCIP Read disabled or provided no URLs"); + } + const tx = { + to: sender, + data: (0, import_bytes.hexConcat)([ + callbackSelector, + encodeBytes([ccipResult, extraData]) + ]) + }; + return await provider._call(tx, "latest", 1); + } catch (error) { + console.error(error); + } +}; +var ccip_default = ccipLookup; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/utils/consts.js b/.yalc/@ensdomains/ensjs/dist/cjs/utils/consts.js new file mode 100644 index 000000000..efdd4a220 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/utils/consts.js @@ -0,0 +1,26 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var consts_exports = {}; +__export(consts_exports, { + EMPTY_ADDRESS: () => EMPTY_ADDRESS, + MAX_INT_64: () => MAX_INT_64 +}); +module.exports = __toCommonJS(consts_exports); +const EMPTY_ADDRESS = "0x0000000000000000000000000000000000000000"; +const MAX_INT_64 = 2n ** 64n - 1n; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/utils/contentHash.js b/.yalc/@ensdomains/ensjs/dist/cjs/utils/contentHash.js new file mode 100644 index 000000000..e9e085868 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/utils/contentHash.js @@ -0,0 +1,167 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var contentHash_exports = {}; +__export(contentHash_exports, { + decodeContenthash: () => decodeContenthash, + encodeContenthash: () => encodeContenthash, + getProtocolType: () => getProtocolType, + isValidContenthash: () => isValidContenthash, + validateContent: () => validateContent +}); +module.exports = __toCommonJS(contentHash_exports); +var import_content_hash = __toESM(require("@ensdomains/content-hash")); +var import_bytes = require("@ethersproject/bytes"); +const supportedCodecs = [ + "ipns-ns", + "ipfs-ns", + "swarm-ns", + "onion", + "onion3", + "skynet-ns", + "arweave-ns" +]; +function matchProtocol(text) { + return text.match(/^(ipfs|sia|ipns|bzz|onion|onion3|arweave|ar):\/\/(.*)/) || text.match(/\/(ipfs)\/(.*)/) || text.match(/\/(ipns)\/(.*)/); +} +function decodeContenthash(encoded) { + let decoded; + let protocolType; + let error; + if (!encoded || encoded === "0x") { + return {}; + } + if (encoded.error) { + return { protocolType: null, decoded: encoded.error }; + } + if (encoded === false) { + return { protocolType: null, decoded: "invalid value" }; + } + if (encoded) { + try { + decoded = import_content_hash.default.decode(encoded); + const codec = import_content_hash.default.getCodec(encoded); + if (codec === "ipfs-ns") { + protocolType = "ipfs"; + } else if (codec === "ipns-ns") { + protocolType = "ipns"; + } else if (codec === "swarm-ns") { + protocolType = "bzz"; + } else if (codec === "onion") { + protocolType = "onion"; + } else if (codec === "onion3") { + protocolType = "onion3"; + } else if (codec === "skynet-ns") { + protocolType = "sia"; + } else if (codec === "arweave-ns") { + protocolType = "ar"; + } else { + decoded = encoded; + } + } catch (e) { + error = e.message; + } + } + return { protocolType, decoded, error }; +} +function validateContent(encoded) { + return import_content_hash.default.isHashOfType(encoded, import_content_hash.default.Types.ipfs) || import_content_hash.default.isHashOfType(encoded, import_content_hash.default.Types.swarm); +} +function isValidContenthash(encoded) { + try { + const codec = import_content_hash.default.getCodec(encoded); + return (0, import_bytes.isHexString)(encoded) && supportedCodecs.includes(codec); + } catch (e) { + console.log(e); + } +} +function getProtocolType(encoded) { + let protocolType; + let decoded; + try { + const matched = matchProtocol(encoded); + if (matched) { + ; + [, protocolType, decoded] = matched; + } + return { + protocolType, + decoded + }; + } catch (e) { + console.log(e); + } +} +function encodeContenthash(text) { + let content = text; + let contentType; + let encoded = false; + let error; + if (text) { + const matched = matchProtocol(text); + if (matched) { + ; + [, contentType, content] = matched; + } + try { + if (contentType === "ipfs") { + if (content.length >= 4) { + encoded = `0x${import_content_hash.default.encode("ipfs-ns", content)}`; + } + } else if (contentType === "ipns") { + encoded = `0x${import_content_hash.default.encode("ipns-ns", content)}`; + } else if (contentType === "bzz") { + if (content.length >= 4) { + encoded = `0x${import_content_hash.default.fromSwarm(content)}`; + } + } else if (contentType === "onion") { + if (content.length === 16) { + encoded = `0x${import_content_hash.default.encode("onion", content)}`; + } + } else if (contentType === "onion3") { + if (content.length === 56) { + encoded = `0x${import_content_hash.default.encode("onion3", content)}`; + } + } else if (contentType === "sia") { + if (content.length === 46) { + encoded = `0x${import_content_hash.default.encode("skynet-ns", content)}`; + } + } else if (contentType === "arweave" || contentType === "ar") { + if (content.length === 43) { + encoded = `0x${import_content_hash.default.encode("arweave-ns", content)}`; + } + } else { + console.warn("Unsupported protocol or invalid value", { + contentType, + text + }); + } + } catch (err) { + const errorMessage = "Error encoding content hash"; + console.warn(errorMessage, { text, encoded }); + error = errorMessage; + } + } + return { encoded, error }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/utils/createReverseNode.js b/.yalc/@ensdomains/ensjs/dist/cjs/utils/createReverseNode.js new file mode 100644 index 000000000..824f47f89 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/utils/createReverseNode.js @@ -0,0 +1,24 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var createReverseNode_exports = {}; +__export(createReverseNode_exports, { + default: () => createReverseNode_default +}); +module.exports = __toCommonJS(createReverseNode_exports); +var createReverseNode_default = (address) => `${address.toLowerCase().substring(2)}.addr.reverse`; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/utils/format.js b/.yalc/@ensdomains/ensjs/dist/cjs/utils/format.js new file mode 100644 index 000000000..379a608bc --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/utils/format.js @@ -0,0 +1,28 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var format_exports = {}; +__export(format_exports, { + bracketFormat: () => bracketFormat, + formatHashed: () => formatHashed, + truncateFormat: () => truncateFormat +}); +module.exports = __toCommonJS(format_exports); +const formatHashed = (name) => name.replace(/(\[)(.{64})(\])/g, "0x$2"); +const truncateFormat = (name) => name.replace(/(\[.{3})(.{58})(.{3}\])/g, "$1...$3"); +const bracketFormat = (name) => name.replace(/(0x)(.{64})(?=\.)/g, "[$2]"); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/utils/fuses.js b/.yalc/@ensdomains/ensjs/dist/cjs/utils/fuses.js new file mode 100644 index 000000000..42e71f87c --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/utils/fuses.js @@ -0,0 +1,269 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var fuses_exports = {}; +__export(fuses_exports, { + CHILD_CONTROLLED_FUSES: () => CHILD_CONTROLLED_FUSES, + PARENT_CONTROLLED_FUSES: () => PARENT_CONTROLLED_FUSES, + USER_SETTABLE_FUSES: () => USER_SETTABLE_FUSES, + childFuseEnum: () => childFuseEnum, + childFuseKeys: () => childFuseKeys, + decodeFuses: () => decodeFuses, + default: () => fuses_default, + encodeFuses: () => encodeFuses, + fullFuseEnum: () => fullFuseEnum, + fullParentFuseEnum: () => fullParentFuseEnum, + fullParentFuseKeys: () => fullParentFuseKeys, + parentFuseEnum: () => parentFuseEnum, + parentFuseKeys: () => parentFuseKeys, + unnamedChildFuses: () => unnamedChildFuses, + unnamedParentFuses: () => unnamedParentFuses, + unnamedUserSettableFuses: () => unnamedUserSettableFuses, + userSettableFuseEnum: () => userSettableFuseEnum, + userSettableFuseKeys: () => userSettableFuseKeys +}); +module.exports = __toCommonJS(fuses_exports); +const CANNOT_UNWRAP = 1; +const CANNOT_BURN_FUSES = 2; +const CANNOT_TRANSFER = 4; +const CANNOT_SET_RESOLVER = 8; +const CANNOT_SET_TTL = 16; +const CANNOT_CREATE_SUBDOMAIN = 32; +const PARENT_CANNOT_CONTROL = 65536; +const IS_DOT_ETH = 131072; +const CAN_EXTEND_EXPIRY = 262144; +const CHILD_CONTROLLED_FUSES = 65535; +const PARENT_CONTROLLED_FUSES = 4294901760; +const USER_SETTABLE_FUSES = 4294836223; +const CAN_DO_EVERYTHING = 0; +const childFuseEnum = { + CANNOT_UNWRAP, + CANNOT_BURN_FUSES, + CANNOT_TRANSFER, + CANNOT_SET_RESOLVER, + CANNOT_SET_TTL, + CANNOT_CREATE_SUBDOMAIN +}; +const parentFuseEnum = { + PARENT_CANNOT_CONTROL, + CAN_EXTEND_EXPIRY +}; +const fullParentFuseEnum = { + ...parentFuseEnum, + IS_DOT_ETH +}; +const userSettableFuseEnum = { + ...childFuseEnum, + ...parentFuseEnum +}; +const fullFuseEnum = { + ...userSettableFuseEnum, + CAN_DO_EVERYTHING +}; +const unnamedChildFuses = [ + 64, + 128, + 256, + 512, + 1024, + 2048, + 4096, + 8192, + 16384, + 32768 +]; +const unnamedParentFuses = [ + 524288, + 1048576, + 2097152, + 4194304, + 8388608, + 16777216, + 33554432, + 67108864, + 134217728, + 268435456, + 536870912, + 1073741824, + 2147483648 +]; +const unnamedUserSettableFuses = [ + ...unnamedChildFuses, + ...unnamedParentFuses +]; +const childFuseKeys = Object.keys( + childFuseEnum +); +const parentFuseKeys = Object.keys( + parentFuseEnum +); +const fullParentFuseKeys = Object.keys( + fullParentFuseEnum +); +const userSettableFuseKeys = Object.keys( + userSettableFuseEnum +); +const checkNumber = (fuses) => { + if (fuses > 2 ** 32 || fuses < 1) { + throw new Error( + `Fuse number must be limited to uint32, ${fuses} was too ${fuses < 1 ? "low" : "high"}.` + ); + } else if (fuses % 1 !== 0) { + throw new Error(`Fuse number must be an integer, ${fuses} was not.`); + } else if ((fuses & USER_SETTABLE_FUSES) !== fuses) { + throw new Error( + `Fuse number must be limited to user settable fuses, ${fuses} was not.` + ); + } +}; +function encodeFuses(fuses, restrictTo) { + let encodedFuses = 0; + if (typeof fuses === "number") { + if (restrictTo) { + throw new Error("Cannot specify an exact fuse value when restricted."); + } + checkNumber(fuses); + encodedFuses = fuses; + } else { + let fusesRef = fuses; + let allowedNamed = []; + let allowedUnnamed = []; + let namedArray = []; + let unnamedArray = []; + if (restrictTo) { + if ("parent" in fuses || "child" in fuses) { + throw new Error("Can't specify fuse category when restricted."); + } + allowedNamed = restrictTo === "child" ? childFuseKeys : parentFuseKeys; + allowedUnnamed = restrictTo === "child" ? unnamedChildFuses : unnamedParentFuses; + fusesRef = { [restrictTo]: fuses }; + } else { + allowedNamed = userSettableFuseKeys; + allowedUnnamed = unnamedUserSettableFuses; + } + if ("parent" in fusesRef) { + if ("named" in fusesRef.parent) + namedArray = fusesRef.parent.named; + if ("unnamed" in fusesRef.parent) + unnamedArray = fusesRef.parent.unnamed; + if ("number" in fusesRef.parent) { + if ("named" in fusesRef.parent || "unnamed" in fusesRef.parent) { + throw new Error( + "Cannot specify both a fuse number and named/unnamed fuses." + ); + } + checkNumber(fusesRef.parent.number); + if ((fusesRef.parent.number & PARENT_CONTROLLED_FUSES) !== fusesRef.parent.number) { + throw new Error( + "Cannot specify a fuse value to set that is outside of the parent's control." + ); + } + encodedFuses |= fusesRef.parent.number; + } + } + if ("child" in fusesRef) { + if ("named" in fusesRef.child) + namedArray = [...namedArray, ...fusesRef.child.named]; + if ("unnamed" in fusesRef.child) + unnamedArray = [...unnamedArray, ...fusesRef.child.unnamed]; + if ("number" in fusesRef.child) { + if ("named" in fusesRef.child || "unnamed" in fusesRef.child) { + throw new Error( + "Cannot specify both a fuse number and named/unnamed fuses." + ); + } + checkNumber(fusesRef.child.number); + if ((fusesRef.child.number & CHILD_CONTROLLED_FUSES) !== fusesRef.child.number) { + throw new Error( + "Cannot specify a fuse value to set that is outside of the owner's control." + ); + } + encodedFuses |= fusesRef.child.number; + } + } + if (!namedArray.length && !unnamedArray.length && !encodedFuses) { + throw new Error("Must specify at least one fuse."); + } + for (const fuse of namedArray) { + if (!allowedNamed.includes(fuse)) { + if (!userSettableFuseKeys.includes(fuse)) { + throw new Error(`${fuse} is not a valid named fuse.`); + } + throw new Error(`Fuse ${fuse} is not allowed for this operation.`); + } + encodedFuses |= userSettableFuseEnum[fuse]; + } + for (const fuse of unnamedArray) { + if (!allowedUnnamed.includes(fuse)) { + if (!unnamedUserSettableFuses.includes(fuse)) { + throw new Error( + `${fuse} is not a valid unnamed fuse. If you are trying to set a named fuse, use the named property.` + ); + } + throw new Error(`Fuse ${fuse} is not allowed for this operation.`); + } + encodedFuses |= fuse; + } + } + return encodedFuses; +} +const decodeNamedFuses = (fuses, arr) => { + const fuseObj = Object.fromEntries( + arr.map((fuse) => [ + fuse, + (fuses & userSettableFuseEnum[fuse]) > 0 + ]) + ); + return fuseObj; +}; +const decodeUnnamedFuses = (fuses, arr) => { + const fuseObj = Object.fromEntries( + arr.map((fuse) => [fuse, (fuses & fuse) > 0]) + ); + return fuseObj; +}; +const decodeFuses = (fuses) => { + const parentNamedFuses = decodeNamedFuses( + fuses, + fullParentFuseKeys + ); + const parentUnnamedFuses = decodeUnnamedFuses( + fuses, + unnamedParentFuses + ); + const childNamedFuses = decodeNamedFuses( + fuses, + childFuseKeys + ); + const childUnnamedFuses = decodeUnnamedFuses( + fuses, + unnamedChildFuses + ); + return { + parent: { + ...parentNamedFuses, + unnamed: parentUnnamedFuses + }, + child: { + ...childNamedFuses, + CAN_DO_EVERYTHING: (fuses & CHILD_CONTROLLED_FUSES) === 0, + unnamed: childUnnamedFuses + } + }; +}; +var fuses_default = fullFuseEnum; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/utils/hexEncodedName.js b/.yalc/@ensdomains/ensjs/dist/cjs/utils/hexEncodedName.js new file mode 100644 index 000000000..e3155a6ac --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/utils/hexEncodedName.js @@ -0,0 +1,31 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var hexEncodedName_exports = {}; +__export(hexEncodedName_exports, { + hexEncodeName: () => hexEncodeName +}); +module.exports = __toCommonJS(hexEncodedName_exports); +var import_dns_packet = __toESM(require("dns-packet")); +const hexEncodeName = (name) => `0x${import_dns_packet.default.name.encode(name).toString("hex")}`; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/utils/labels.js b/.yalc/@ensdomains/ensjs/dist/cjs/utils/labels.js new file mode 100644 index 000000000..45b79c23e --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/utils/labels.js @@ -0,0 +1,128 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var labels_exports = {}; +__export(labels_exports, { + checkIsDecrypted: () => checkIsDecrypted, + checkLabel: () => checkLabel, + checkLocalStorageSize: () => checkLocalStorageSize, + decodeLabelhash: () => decodeLabelhash, + decryptName: () => decryptName, + encodeLabel: () => encodeLabel, + encodeLabelhash: () => encodeLabelhash, + isEncodedLabelhash: () => isEncodedLabelhash, + keccakFromString: () => keccakFromString, + labelhash: () => labelhash, + parseName: () => parseName, + saveLabel: () => saveLabel, + saveName: () => saveName, + truncateUndecryptedName: () => truncateUndecryptedName +}); +module.exports = __toCommonJS(labels_exports); +var import_solidity = require("@ethersproject/solidity"); +var import_format = require("./format"); +const hasLocalStorage = typeof localStorage !== "undefined"; +const labelhash = (input) => (0, import_solidity.keccak256)(["string"], [input]); +const keccakFromString = (input) => labelhash(input); +function decodeLabelhash(hash) { + if (!(hash.startsWith("[") && hash.endsWith("]"))) { + throw Error( + "Expected encoded labelhash to start and end with square brackets" + ); + } + if (hash.length !== 66) { + throw Error("Expected encoded labelhash to have a length of 66"); + } + return `0x${hash.slice(1, -1)}`; +} +function encodeLabelhash(hash) { + if (!hash.startsWith("0x")) { + throw new Error("Expected label hash to start with 0x"); + } + if (hash.length !== 66) { + throw new Error("Expected label hash to have a length of 66"); + } + return `[${hash.slice(2)}]`; +} +function isEncodedLabelhash(hash) { + return hash.startsWith("[") && hash.endsWith("]") && hash.length === 66; +} +function getLabels() { + return hasLocalStorage ? JSON.parse(localStorage.getItem("ensjs:labels")) || {} : {}; +} +function _saveLabel(hash, label) { + if (!hasLocalStorage) + return hash; + const labels = getLabels(); + localStorage.setItem( + "ensjs:labels", + JSON.stringify({ + ...labels, + [hash]: label + }) + ); + return hash; +} +function saveLabel(label) { + const hash = `${labelhash(label.toLowerCase())}`; + return _saveLabel(hash, label); +} +function saveName(name) { + const nameArray = name.split("."); + nameArray.forEach((label) => { + saveLabel(label); + }); +} +function checkLabel(hash) { + const labels = getLabels(); + if (isEncodedLabelhash(hash)) { + return labels[decodeLabelhash(hash)]; + } + if (hash.startsWith("0x")) { + return labels[`${hash.slice(2)}`]; + } +} +function encodeLabel(label) { + try { + return encodeLabelhash(label); + } catch { + return label; + } +} +function parseName(name) { + const nameArray = name.split("."); + return nameArray.map((label) => encodeLabel(label)).join("."); +} +function checkIsDecrypted(string) { + return !(string == null ? void 0 : string.includes("[")); +} +function decryptName(name) { + return name.split(".").map((label) => checkLabel(label) || label).join("."); +} +const truncateUndecryptedName = (name) => (0, import_format.truncateFormat)(name); +function checkLocalStorageSize() { + if (!hasLocalStorage) + return "Empty (0 KB)"; + let allStrings = ""; + for (const key in window.localStorage) { + if (Object.prototype.hasOwnProperty.call(window.localStorage, key)) { + allStrings += window.localStorage[key]; + } + } + return allStrings ? `${3 + allStrings.length * 16 / (8 * 1024)} KB` : "Empty (0 KB)"; +} diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/utils/makeHashIndexes.js b/.yalc/@ensdomains/ensjs/dist/cjs/utils/makeHashIndexes.js new file mode 100644 index 000000000..625908b9f --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/utils/makeHashIndexes.js @@ -0,0 +1,29 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var makeHashIndexes_exports = {}; +__export(makeHashIndexes_exports, { + makeNamehashIndexes: () => makeNamehashIndexes, + makeOtherIndexes: () => makeOtherIndexes +}); +module.exports = __toCommonJS(makeHashIndexes_exports); +var import_normalise = require("./normalise"); +const makeOtherIndexes = (data, findStr) => Array.from(data.matchAll(findStr)).map((x) => x.index / 2 - 1); +const makeNamehashIndexes = (data, name) => Array.from(data.matchAll((0, import_normalise.namehash)(name).substring(2))).map( + (x) => x.index / 2 - 1 +); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/utils/normalise.js b/.yalc/@ensdomains/ensjs/dist/cjs/utils/normalise.js new file mode 100644 index 000000000..83fbafd34 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/utils/normalise.js @@ -0,0 +1,57 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var normalise_exports = {}; +__export(normalise_exports, { + namehash: () => namehash, + normalise: () => normalise +}); +module.exports = __toCommonJS(normalise_exports); +var import_bytes = require("@ethersproject/bytes"); +var import_keccak256 = require("@ethersproject/keccak256"); +var import_utf8 = require("@ethersproject/strings/lib/utf8"); +var import_uts46bundle = __toESM(require("idna-uts46-hx/uts46bundle.js")); +var import_labels = require("./labels"); +const zeros = new Uint8Array(32); +zeros.fill(0); +const normalise = (name) => name ? import_uts46bundle.default.toUnicode(name, { useStd3ASCII: true }) : name; +const namehash = (name) => { + let result = zeros; + if (name) { + const labels = name.split("."); + for (let i = labels.length - 1; i >= 0; i -= 1) { + let labelSha; + if ((0, import_labels.isEncodedLabelhash)(labels[i])) { + labelSha = (0, import_labels.decodeLabelhash)(labels[i]); + } else { + const normalised = normalise(labels[i]); + labelSha = (0, import_keccak256.keccak256)((0, import_utf8.toUtf8Bytes)(normalised)); + } + result = (0, import_keccak256.keccak256)((0, import_bytes.concat)([result, labelSha])); + } + } else { + result = (0, import_bytes.hexlify)(zeros); + } + return result; +}; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/utils/recordHelpers.js b/.yalc/@ensdomains/ensjs/dist/cjs/utils/recordHelpers.js new file mode 100644 index 000000000..16b046179 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/utils/recordHelpers.js @@ -0,0 +1,148 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var recordHelpers_exports = {}; +__export(recordHelpers_exports, { + generateABIInput: () => generateABIInput, + generateRecordCallArray: () => generateRecordCallArray, + generateSetAddr: () => generateSetAddr, + generateSingleRecordCall: () => generateSingleRecordCall +}); +module.exports = __toCommonJS(recordHelpers_exports); +var import_address_encoder = require("@ensdomains/address-encoder"); +var import_utils = require("ethers/lib/utils"); +var import_contentHash = require("./contentHash"); +const generateSetAddr = (namehash, coinType, address, resolver) => { + let coinTypeInstance; + if (!Number.isNaN(parseInt(coinType))) { + coinTypeInstance = import_address_encoder.formatsByCoinType[parseInt(coinType)]; + } else { + coinTypeInstance = import_address_encoder.formatsByName[coinType.toUpperCase()]; + } + const inputCoinType = coinTypeInstance.coinType; + const encodedAddress = coinTypeInstance.decoder(address); + return resolver == null ? void 0 : resolver.interface.encodeFunctionData( + "setAddr(bytes32,uint256,bytes)", + [namehash, inputCoinType, encodedAddress] + ); +}; +const generateABIInput = async (encodeAs, data) => { + let contentType; + let encodedData; + switch (encodeAs) { + case "json": + contentType = 1; + encodedData = JSON.stringify(data); + break; + case "zlib": { + contentType = 2; + const { deflate } = await import("pako/dist/pako_deflate.min.js"); + encodedData = deflate(JSON.stringify(data)); + break; + } + case "cbor": { + contentType = 4; + const { encode } = await import("cbor"); + encodedData = encode(data); + break; + } + default: { + contentType = 8; + encodedData = data; + break; + } + } + return { contentType, data: encodedData }; +}; +function generateSingleRecordCall(namehash, resolver, type) { + if (type === "contentHash") { + return (_r) => { + const record = _r; + let _contentHash = ""; + if (record !== _contentHash) { + const encoded = (0, import_contentHash.encodeContenthash)(record); + if (encoded.error) + throw new Error(encoded.error); + _contentHash = encoded.encoded; + } + return resolver.interface.encodeFunctionData("setContenthash", [ + namehash, + _contentHash + ]); + }; + } + if (type === "abi") { + return (_r) => { + const record = _r; + const { contentType = 1, data } = record; + let encodedData = data; + if (!(0, import_utils.isBytesLike)(encodedData)) { + if (typeof encodedData === "object") { + encodedData = JSON.stringify(encodedData); + } + encodedData = (0, import_utils.toUtf8Bytes)(encodedData); + } + return resolver.interface.encodeFunctionData("setABI", [ + namehash, + contentType, + encodedData + ]); + }; + } + return (_r) => { + const record = _r; + if (type === "text") { + return resolver.interface.encodeFunctionData("setText", [ + namehash, + record.key, + record.value + ]); + } + return generateSetAddr(namehash, record.key, record.value, resolver); + }; +} +const generateRecordCallArray = (namehash, records, resolver) => { + const calls = []; + if (records.clearRecords) { + calls.push( + resolver.interface.encodeFunctionData("clearRecords", [namehash]) + ); + } + if (records.contentHash) { + const data = generateSingleRecordCall( + namehash, + resolver, + "contentHash" + )(records.contentHash); + if (data) + calls.push(data); + } + if (records.texts && records.texts.length > 0) { + records.texts.map(generateSingleRecordCall(namehash, resolver, "text")).forEach((call) => calls.push(call)); + } + if (records.coinTypes && records.coinTypes.length > 0) { + records.coinTypes.map(generateSingleRecordCall(namehash, resolver, "addr")).forEach((call) => calls.push(call)); + } + return calls; +}; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/utils/registerHelpers.js b/.yalc/@ensdomains/ensjs/dist/cjs/utils/registerHelpers.js new file mode 100644 index 000000000..89ba38940 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/utils/registerHelpers.js @@ -0,0 +1,110 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var registerHelpers_exports = {}; +__export(registerHelpers_exports, { + _makeCommitment: () => _makeCommitment, + makeCommitment: () => makeCommitment, + makeCommitmentData: () => makeCommitmentData, + makeRegistrationData: () => makeRegistrationData, + randomSecret: () => randomSecret +}); +module.exports = __toCommonJS(registerHelpers_exports); +var import_abi_coder = require("@ethersproject/abi/lib/abi-coder"); +var import_keccak256 = require("@ethersproject/keccak256"); +var import_fuses = require("./fuses"); +var import_labels = require("./labels"); +var import_normalise = require("./normalise"); +var import_recordHelpers = require("./recordHelpers"); +const randomSecret = () => { + const bytes = Buffer.allocUnsafe(32); + return `0x${crypto.getRandomValues(bytes).toString("hex")}`; +}; +const makeCommitmentData = ({ + name, + owner, + duration, + resolver, + records, + reverseRecord, + fuses, + secret +}) => { + var _a; + const labelHash = (0, import_labels.labelhash)(name.split(".")[0]); + const hash = (0, import_normalise.namehash)(name); + const resolverAddress = resolver.address; + const fuseData = fuses ? (0, import_fuses.encodeFuses)(fuses, "child") : 0; + if (reverseRecord) { + if (!records) { + records = { coinTypes: [{ key: "ETH", value: owner }] }; + } else if (!((_a = records.coinTypes) == null ? void 0 : _a.find((c) => c.key === "ETH"))) { + if (!records.coinTypes) + records.coinTypes = []; + records.coinTypes.push({ key: "ETH", value: owner }); + } + } + const data = records ? (0, import_recordHelpers.generateRecordCallArray)(hash, records, resolver) : []; + return [ + labelHash, + owner, + duration, + secret, + resolverAddress, + data, + !!reverseRecord, + fuseData + ]; +}; +const makeRegistrationData = (params) => { + const commitmentData = makeCommitmentData(params); + const label = params.name.split(".")[0]; + commitmentData[0] = label; + return commitmentData; +}; +const _makeCommitment = (params) => { + return (0, import_keccak256.keccak256)( + import_abi_coder.defaultAbiCoder.encode( + [ + "bytes32", + "address", + "uint256", + "bytes32", + "address", + "bytes[]", + "bool", + "uint16" + ], + params + ) + ); +}; +const makeCommitment = ({ + secret = randomSecret(), + ...inputParams +}) => { + const generatedParams = makeCommitmentData({ + ...inputParams, + secret + }); + const commitment = _makeCommitment(generatedParams); + return { + secret, + commitment + }; +}; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/utils/singleCall.js b/.yalc/@ensdomains/ensjs/dist/cjs/utils/singleCall.js new file mode 100644 index 000000000..1a2fca756 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/utils/singleCall.js @@ -0,0 +1,24 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var singleCall_exports = {}; +__export(singleCall_exports, { + default: () => singleCall_default +}); +module.exports = __toCommonJS(singleCall_exports); +var singleCall_default = async (provider, ensData, func, ...data) => func.raw(ensData, ...data).then((rawData) => provider.call({ ...rawData, ccipReadEnabled: true })).catch(() => null).then((ret) => func.decode(ensData, ret, ...data)); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/utils/subgraph-types.js b/.yalc/@ensdomains/ensjs/dist/cjs/utils/subgraph-types.js new file mode 100644 index 000000000..b21c405f8 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/utils/subgraph-types.js @@ -0,0 +1,16 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var subgraph_types_exports = {}; +module.exports = __toCommonJS(subgraph_types_exports); diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/utils/validation.js b/.yalc/@ensdomains/ensjs/dist/cjs/utils/validation.js new file mode 100644 index 000000000..b1bae869f --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/utils/validation.js @@ -0,0 +1,86 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var validation_exports = {}; +__export(validation_exports, { + parseInputType: () => parseInputType, + validateName: () => validateName, + validateTLD: () => validateTLD +}); +module.exports = __toCommonJS(validation_exports); +var import_address = require("@ethersproject/address"); +var import_labels = require("./labels"); +var import_normalise = require("./normalise"); +const validateName = (name) => { + const nameArray = name.split("."); + const hasEmptyLabels = nameArray.some((label) => label.length === 0); + if (hasEmptyLabels) + throw new Error("Name cannot have empty labels"); + const normalizedArray = nameArray.map((label) => { + if (label === "[root]") { + return label; + } + return (0, import_labels.isEncodedLabelhash)(label) ? label : (0, import_normalise.normalise)(label); + }); + const normalizedName = normalizedArray.join("."); + (0, import_labels.saveName)(normalizedName); + return normalizedName; +}; +const validateTLD = (name) => { + const labels = name.split("."); + return validateName(labels[labels.length - 1]); +}; +const parseInputType = (input) => { + const validTLD = validateTLD(input); + const regex = /[^.]+$/; + try { + validateName(input); + } catch (e) { + return { + type: "unknown" + }; + } + if (input.indexOf(".") !== -1) { + const termArray = input.split("."); + const tld = input.match(regex) ? input.match(regex)[0] : ""; + if (validTLD) { + if (tld === "eth" && [...termArray[termArray.length - 2]].length < 3) { + return { + type: "name", + info: "short" + }; + } + return { + type: "name", + info: "supported" + }; + } + return { + type: "name", + info: "unsupported" + }; + } + if ((0, import_address.isAddress)(input)) { + return { + type: "address" + }; + } + return { + type: "label" + }; +}; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/utils/wrapper.js b/.yalc/@ensdomains/ensjs/dist/cjs/utils/wrapper.js new file mode 100644 index 000000000..94ee4e8bd --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/utils/wrapper.js @@ -0,0 +1,51 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var wrapper_exports = {}; +__export(wrapper_exports, { + MAX_EXPIRY: () => MAX_EXPIRY, + makeExpiry: () => makeExpiry, + wrappedLabelLengthCheck: () => wrappedLabelLengthCheck +}); +module.exports = __toCommonJS(wrapper_exports); +var import_bignumber = require("@ethersproject/bignumber/lib/bignumber"); +var import_utf8 = require("@ethersproject/strings/lib/utf8"); +const MAX_EXPIRY = import_bignumber.BigNumber.from(2).pow(64).sub(1); +const makeExpiry = async ({ getExpiry }, name, expiry) => { + if (expiry) { + if (expiry instanceof Date) { + return import_bignumber.BigNumber.from(expiry.getTime() / 1e3); + } + if (expiry instanceof import_bignumber.BigNumber) { + return expiry; + } + return import_bignumber.BigNumber.from(expiry); + } + if (name.endsWith(".eth")) { + const expResponse = await getExpiry(name); + if (!(expResponse == null ? void 0 : expResponse.expiry)) + throw new Error("Couldn't get expiry for name, please provide one."); + return import_bignumber.BigNumber.from(expResponse.expiry.getTime() / 1e3); + } + return MAX_EXPIRY; +}; +const wrappedLabelLengthCheck = (label) => { + const bytes = (0, import_utf8.toUtf8Bytes)(label); + if (bytes.byteLength > 255) + throw new Error("Label can't be longer than 255 bytes"); +}; diff --git a/.yalc/@ensdomains/ensjs/dist/cjs/utils/writeTx.js b/.yalc/@ensdomains/ensjs/dist/cjs/utils/writeTx.js new file mode 100644 index 000000000..5d5387b6b --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/cjs/utils/writeTx.js @@ -0,0 +1,25 @@ +"use strict"; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); +var writeTx_exports = {}; +__export(writeTx_exports, { + default: () => writeTx_default +}); +module.exports = __toCommonJS(writeTx_exports); +const withCustomData = (tx, customData) => customData ? { ...tx, customData } : tx; +var writeTx_default = (signer, populate) => ({ customData, ...tx }) => populate ? withCustomData(tx, customData) : signer.sendTransaction(tx).then((r) => withCustomData(r, customData)); diff --git a/.yalc/@ensdomains/ensjs/dist/esm/GqlManager.mjs b/.yalc/@ensdomains/ensjs/dist/esm/GqlManager.mjs new file mode 100644 index 000000000..62e0c4342 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/GqlManager.mjs @@ -0,0 +1,88 @@ +// src/GqlManager.ts +import { namehash } from "./utils/normalise.mjs"; +var generateSelection = (selection) => ({ + kind: "Field", + name: { + kind: "Name", + value: selection + }, + arguments: [], + directives: [], + alias: void 0, + selectionSet: void 0 +}); +var enter = (node) => { + let hasName = false; + let hasId = false; + for (const selection of node.selections) { + if ("name" in selection) { + if (selection.name.value === "name") + hasName = true; + else if (selection.name.value === "id") + hasId = true; + } + } + if (hasName && !hasId) { + node.selections = [...node.selections, generateSelection("id")]; + return node; + } +}; +var requestMiddleware = (visit, parse, print) => (request) => { + const requestBody = JSON.parse(request.body); + const rawQuery = requestBody.query; + const parsedQuery = parse(rawQuery); + const updatedQuery = visit(parsedQuery, { + SelectionSet: { + enter + } + }); + return { + ...request, + body: JSON.stringify({ ...requestBody, query: print(updatedQuery) }) + }; +}; +var responseMiddleware = (traverse) => (response) => { + traverse(response).forEach(function(responseItem) { + if (responseItem instanceof Object && responseItem.name) { + if (responseItem.name && responseItem.name.includes("[")) { + return; + } + const hashedName = namehash(responseItem.name); + if (responseItem.id !== hashedName) { + this.update({ ...responseItem, name: hashedName, invalidName: true }); + } + } + }); + return response; +}; +var GqlManager = class { + gql = (query) => query.join(); + client = { + request: () => Promise.resolve(null) + }; + setUrl = async (url) => { + if (url) { + const [imported, traverse, { visit, parse, print }] = await Promise.all([ + import("graphql-request"), + import("traverse"), + import("graphql/language") + ]); + this.client = new imported.GraphQLClient(url, { + requestMiddleware: requestMiddleware(visit, parse, print), + responseMiddleware: responseMiddleware(traverse.default) + }); + this.gql = imported.gql; + } else { + this.client = { + request: () => Promise.resolve(null) + }; + this.gql = (query) => query.join(); + } + }; +}; +export { + GqlManager as default, + enter, + requestMiddleware, + responseMiddleware +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/contracts/baseRegistrar.mjs b/.yalc/@ensdomains/ensjs/dist/esm/contracts/baseRegistrar.mjs new file mode 100644 index 000000000..a82856740 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/contracts/baseRegistrar.mjs @@ -0,0 +1,6 @@ +// src/contracts/baseRegistrar.ts +import { BaseRegistrarImplementation__factory } from "../generated/factories/BaseRegistrarImplementation__factory.mjs"; +var baseRegistrar_default = (provider, address) => BaseRegistrarImplementation__factory.connect(address, provider); +export { + baseRegistrar_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/contracts/bulkRenewal.mjs b/.yalc/@ensdomains/ensjs/dist/esm/contracts/bulkRenewal.mjs new file mode 100644 index 000000000..42200ceee --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/contracts/bulkRenewal.mjs @@ -0,0 +1,6 @@ +// src/contracts/bulkRenewal.ts +import { BulkRenewal__factory } from "../generated/factories/BulkRenewal__factory.mjs"; +var bulkRenewal_default = (provider, address) => BulkRenewal__factory.connect(address, provider); +export { + bulkRenewal_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/contracts/dnsRegistrar.mjs b/.yalc/@ensdomains/ensjs/dist/esm/contracts/dnsRegistrar.mjs new file mode 100644 index 000000000..7c58cb9e8 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/contracts/dnsRegistrar.mjs @@ -0,0 +1,6 @@ +// src/contracts/dnsRegistrar.ts +import { DNSRegistrar__factory } from "../generated/factories/DNSRegistrar__factory.mjs"; +var dnsRegistrar_default = (provider, address) => DNSRegistrar__factory.connect(address, provider); +export { + dnsRegistrar_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/contracts/ethRegistrarController.mjs b/.yalc/@ensdomains/ensjs/dist/esm/contracts/ethRegistrarController.mjs new file mode 100644 index 000000000..6132b2b62 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/contracts/ethRegistrarController.mjs @@ -0,0 +1,6 @@ +// src/contracts/ethRegistrarController.ts +import { ETHRegistrarController__factory } from "../generated/factories/ETHRegistrarController__factory.mjs"; +var ethRegistrarController_default = (provider, address) => ETHRegistrarController__factory.connect(address, provider); +export { + ethRegistrarController_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/contracts/factories.mjs b/.yalc/@ensdomains/ensjs/dist/esm/contracts/factories.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/contracts/getContractAddress.mjs b/.yalc/@ensdomains/ensjs/dist/esm/contracts/getContractAddress.mjs new file mode 100644 index 000000000..93cfd29aa --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/contracts/getContractAddress.mjs @@ -0,0 +1,66 @@ +// src/contracts/getContractAddress.ts +var addresses = { + BaseRegistrarImplementation: { + "1": "0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85", + "3": "0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85", + "4": "0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85", + "5": "0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85" + }, + DNSRegistrar: { + "1": "0x58774Bb8acD458A640aF0B88238369A167546ef2", + "3": "0xdB328BA5FEcb432AF325Ca59E3778441eF5aa14F", + "5": "0x8edc487D26F6c8Fa76e032066A3D4F87E273515d" + }, + ETHRegistrarController: { + "1": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", + "3": "0xa5627AB7Ae47063B533622C34FEBDb52d3281dF8", + "4": "0x283af0b28c62c092c9727f1ee09c02ca627eb7f5", + "5": "0xb7A1f9e633fdeaAa2ec44bE00a61a7Db9a733D70" + }, + Multicall: "0xcA11bde05977b3631167028862bE2a173976CA11", + NameWrapper: { + "1": "0x0000000000000000000000000000000000000000", + "3": "0xF82155e2a43Be0871821E9654Fc8Ae894FB8307C", + "4": "0x0000000000000000000000000000000000000000", + "5": "0xEe1F756aCde7E81B2D8cC6aB3c8A1E2cE6db0F39" + }, + PublicResolver: { + "1": "0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41", + "3": "0x13F0659Ee6bb7484C884FEeFb7F75C93951ef837", + "5": "0x2800Ec5BAB9CE9226d19E0ad5BC607e3cfC4347E" + }, + ENSRegistry: { + "1": "0x00000000000c2e074ec69a0dfb2997ba6c7d2e1e", + "3": "0x00000000000c2e074ec69a0dfb2997ba6c7d2e1e", + "4": "0x00000000000c2e074ec69a0dfb2997ba6c7d2e1e", + "5": "0x00000000000c2e074ec69a0dfb2997ba6c7d2e1e" + }, + ReverseRegistrar: { + "1": "0x084b1c3C81545d370f3634392De611CaaBFf8148", + "3": "0x806246b52f8cB61655d3038c58D2f63Aa55d4edE", + "5": "0x9a879320A9F7ad2BBb02063d67baF5551D6BD8B0" + }, + UniversalResolver: { + "1": "0x74E20Bd2A1fE0cdbe45b9A1d89cb7e0a45b36376", + "3": "0x74e20bd2a1fe0cdbe45b9a1d89cb7e0a45b36376", + "4": "0x74e20bd2a1fe0cdbe45b9a1d89cb7e0a45b36376", + "5": "0x687c30Cc44bFA39A1449e86E172BF002E7b3f0b0" + }, + BulkRenewal: { + "1": "0xfF252725f6122A92551A5FA9a6b6bf10eb0Be035", + "3": "0x051b02245D826757EfaF5C6209D4D79FB39FBC45", + "5": "0xa9e1df95a79C768aA435805b28E1B54Bb5ead063" + } +}; +var getContractAddress = (networkId) => (contractName) => { + try { + return typeof addresses[contractName] === "string" ? addresses[contractName] : addresses[contractName][networkId]; + } catch { + throw new Error( + `No address for contract ${contractName} on network ${networkId}` + ); + } +}; +export { + getContractAddress +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/contracts/index.mjs b/.yalc/@ensdomains/ensjs/dist/esm/contracts/index.mjs new file mode 100644 index 000000000..131288aa8 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/contracts/index.mjs @@ -0,0 +1,44 @@ +// src/contracts/index.ts +var ContractManager = class { + provider; + fetchAddress; + getModule = async (name) => { + const mod = await import( + /* webpackMode: "lazy", webpackChunkName: "[request]", webpackPreload: true, webpackExclude: /.*\.ts$/ */ + `../generated/factories/${name}__factory` + ); + return mod[`${name}__factory`]; + }; + constructor(provider, fetchAddress, getModule) { + this.provider = provider; + this.fetchAddress = fetchAddress; + if (getModule) { + this.getModule = getModule; + } + } + generateContractGetter = (name) => { + return async (passedProvider, address) => { + const mod = await this.getModule(name); + const inputAddress = address || this.fetchAddress(name); + const provider = passedProvider || this.provider; + return mod.connect(inputAddress, provider); + }; + }; + getPublicResolver = this.generateContractGetter("PublicResolver"); + getUniversalResolver = this.generateContractGetter("UniversalResolver"); + getRegistry = this.generateContractGetter("ENSRegistry"); + getReverseRegistrar = this.generateContractGetter("ReverseRegistrar"); + getNameWrapper = this.generateContractGetter("NameWrapper"); + getDNSRegistrar = this.generateContractGetter("DNSRegistrar"); + getBaseRegistrar = this.generateContractGetter( + "BaseRegistrarImplementation" + ); + getEthRegistrarController = this.generateContractGetter( + "ETHRegistrarController" + ); + getMulticall = this.generateContractGetter("Multicall"); + getBulkRenewal = this.generateContractGetter("BulkRenewal"); +}; +export { + ContractManager as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/contracts/multicall.mjs b/.yalc/@ensdomains/ensjs/dist/esm/contracts/multicall.mjs new file mode 100644 index 000000000..49b459989 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/contracts/multicall.mjs @@ -0,0 +1,6 @@ +// src/contracts/multicall.ts +import { Multicall__factory } from "../generated/factories/Multicall__factory.mjs"; +var multicall_default = (provider, address) => Multicall__factory.connect(address, provider); +export { + multicall_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/contracts/nameWrapper.mjs b/.yalc/@ensdomains/ensjs/dist/esm/contracts/nameWrapper.mjs new file mode 100644 index 000000000..03501cc88 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/contracts/nameWrapper.mjs @@ -0,0 +1,6 @@ +// src/contracts/nameWrapper.ts +import { NameWrapper__factory } from "../generated/factories/NameWrapper__factory.mjs"; +var nameWrapper_default = (provider, address) => NameWrapper__factory.connect(address, provider); +export { + nameWrapper_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/contracts/publicResolver.mjs b/.yalc/@ensdomains/ensjs/dist/esm/contracts/publicResolver.mjs new file mode 100644 index 000000000..2fde9cedc --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/contracts/publicResolver.mjs @@ -0,0 +1,6 @@ +// src/contracts/publicResolver.ts +import { PublicResolver__factory } from "../generated/factories/PublicResolver__factory.mjs"; +var publicResolver_default = (provider, address) => PublicResolver__factory.connect(address, provider); +export { + publicResolver_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/contracts/registry.mjs b/.yalc/@ensdomains/ensjs/dist/esm/contracts/registry.mjs new file mode 100644 index 000000000..47536830c --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/contracts/registry.mjs @@ -0,0 +1,6 @@ +// src/contracts/registry.ts +import { ENSRegistry__factory } from "../generated/factories/ENSRegistry__factory.mjs"; +var registry_default = (provider, address) => ENSRegistry__factory.connect(address, provider); +export { + registry_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/contracts/reverseRegistrar.mjs b/.yalc/@ensdomains/ensjs/dist/esm/contracts/reverseRegistrar.mjs new file mode 100644 index 000000000..a0258944d --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/contracts/reverseRegistrar.mjs @@ -0,0 +1,6 @@ +// src/contracts/reverseRegistrar.ts +import { ReverseRegistrar__factory } from "../generated/factories/ReverseRegistrar__factory.mjs"; +var reverseRegistrar_default = (provider, address) => ReverseRegistrar__factory.connect(address, provider); +export { + reverseRegistrar_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/contracts/types.mjs b/.yalc/@ensdomains/ensjs/dist/esm/contracts/types.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/contracts/universalResolver.mjs b/.yalc/@ensdomains/ensjs/dist/esm/contracts/universalResolver.mjs new file mode 100644 index 000000000..acd85cbcc --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/contracts/universalResolver.mjs @@ -0,0 +1,6 @@ +// src/contracts/universalResolver.ts +import { UniversalResolver__factory } from "../generated/factories/UniversalResolver__factory.mjs"; +var universalResolver_default = (provider, address) => UniversalResolver__factory.connect(address, provider); +export { + universalResolver_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/batch.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/batch.mjs new file mode 100644 index 000000000..19a2ead28 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/batch.mjs @@ -0,0 +1,29 @@ +// src/functions/batch.ts +var raw = async ({ multicallWrapper }, ...items) => { + const rawDataArr = await Promise.all( + items.map(({ args, raw: rawRef }, i) => { + if (!rawRef) { + throw new Error(`Function ${i} is not batchable`); + } + return rawRef(...args); + }) + ); + return multicallWrapper.raw(rawDataArr); +}; +var decode = async ({ multicallWrapper }, data, ...items) => { + const response = await multicallWrapper.decode(data); + if (!response) + return; + return Promise.all( + response.map( + (ret, i) => items[i].decode(ret.returnData, ...items[i].args) + ) + ); +}; +var batch_default = { + raw, + decode +}; +export { + batch_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/batchWrappers.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/batchWrappers.mjs new file mode 100644 index 000000000..ef55984be --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/batchWrappers.mjs @@ -0,0 +1,109 @@ +// src/functions/batchWrappers.ts +import ccipLookup from "../utils/ccip.mjs"; +import { hexEncodeName } from "../utils/hexEncodedName.mjs"; +var universalWrapper = { + raw: async ({ contracts }, name, data) => { + const universalResolver = await contracts?.getUniversalResolver(); + return { + to: universalResolver.address, + data: universalResolver.interface.encodeFunctionData( + "resolve(bytes,bytes)", + [hexEncodeName(name), data] + ) + }; + }, + decode: async ({ contracts }, data) => { + const universalResolver = await contracts?.getUniversalResolver(); + const response = universalResolver.interface.decodeFunctionResult( + "resolve(bytes,bytes)", + data + ); + if (!response || !response[0]) { + return; + } + return { data: response[0], resolver: response[1] }; + } +}; +var resolverMulticallWrapper = { + raw: async ({ contracts }, data) => { + const publicResolver = await contracts?.getPublicResolver(); + const formattedDataArr = data.map((item) => item.data); + return { + to: publicResolver.address, + data: publicResolver.interface.encodeFunctionData("multicall", [ + formattedDataArr + ]) + }; + }, + decode: async ({ contracts }, data) => { + const publicResolver = await contracts?.getPublicResolver(); + const response = publicResolver.interface.decodeFunctionResult( + "multicall", + data + ); + if (!response) { + return; + } + return response; + } +}; +var multicallWrapper = { + async raw({ contracts }, transactions, requireSuccess = false) { + const multicall = await contracts?.getMulticall(); + return { + to: multicall.address, + data: multicall.interface.encodeFunctionData("tryAggregate", [ + requireSuccess, + transactions.map((tx) => ({ + target: tx.to, + callData: tx.data + })) + ]) + }; + }, + async decode({ contracts, provider }, data, transactions) { + if (!data) + return; + const multicall = await contracts?.getMulticall(); + try { + const [result] = multicall.interface.decodeFunctionResult( + "tryAggregate", + data + ); + const ccipChecked = await Promise.all( + result.map( + async ([success, returnData], i) => { + let newArr = [success, returnData]; + if (!success && returnData.startsWith("0x556f1830")) { + try { + const newData = await ccipLookup( + provider, + transactions[i], + returnData + ); + if (newData) { + newArr = [true, newData]; + } + } catch { + } + } + return { + ...newArr, + success: newArr[0], + returnData: newArr[1] + }; + } + ) + ); + return ccipChecked; + } catch (e) { + console.error(e); + return; + } + } +}; +export { + multicallWrapper, + resolverMulticallWrapper, + universalWrapper +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/commitName.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/commitName.mjs new file mode 100644 index 000000000..0662a2e8d --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/commitName.mjs @@ -0,0 +1,29 @@ +// src/functions/commitName.ts +import { makeCommitment } from "../utils/registerHelpers.mjs"; +import { wrappedLabelLengthCheck } from "../utils/wrapper.mjs"; +async function commitName_default({ contracts }, name, { resolverAddress, ...params }) { + const labels = name.split("."); + if (labels.length !== 2 || labels[1] !== "eth") + throw new Error("Currently only .eth TLD registrations are supported"); + wrappedLabelLengthCheck(labels[0]); + const controller = await contracts.getEthRegistrarController(); + const resolver = await contracts.getPublicResolver( + void 0, + resolverAddress + ); + const { secret, commitment } = makeCommitment({ + name, + resolver, + ...params + }); + return { + ...await controller.populateTransaction.commit(commitment), + customData: { + secret, + commitment + } + }; +} +export { + commitName_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/createSubname.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/createSubname.mjs new file mode 100644 index 000000000..216325766 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/createSubname.mjs @@ -0,0 +1,61 @@ +// src/functions/createSubname.ts +import { keccak256 as solidityKeccak256 } from "@ethersproject/solidity"; +import { encodeFuses } from "../utils/fuses.mjs"; +import { namehash } from "../utils/normalise.mjs"; +import { makeExpiry, wrappedLabelLengthCheck } from "../utils/wrapper.mjs"; +async function createSubname_default({ + contracts, + signer, + getExpiry +}, name, { owner, resolverAddress, contract, ...wrapperArgs }) { + const labels = name.split("."); + if (labels.length === 1) { + throw new Error("Subnames in ENS.js can only be created for 2LDs, not TLDs"); + } + if ("fuses" in wrapperArgs && contract === "registry") { + throw new Error("Fuses can only be set on a wrapped name"); + } + if (!resolverAddress) { + resolverAddress = (await contracts?.getPublicResolver()).address; + } + const label = labels.shift(); + const labelhash = solidityKeccak256(["string"], [label]); + const parentNodehash = namehash(labels.join(".")); + switch (contract) { + case "registry": { + const registry = (await contracts.getRegistry()).connect(signer); + return registry.populateTransaction.setSubnodeRecord( + parentNodehash, + labelhash, + owner, + resolverAddress, + 0 + ); + } + case "nameWrapper": { + wrappedLabelLengthCheck(label); + const nameWrapper = (await contracts.getNameWrapper()).connect(signer); + const expiry = await makeExpiry( + { getExpiry }, + name, + "expiry" in wrapperArgs ? wrapperArgs.expiry : void 0 + ); + const generatedFuses = "fuses" in wrapperArgs && wrapperArgs.fuses ? encodeFuses(wrapperArgs.fuses) : 0; + return nameWrapper.populateTransaction.setSubnodeRecord( + parentNodehash, + label, + owner, + resolverAddress, + 0, + generatedFuses, + expiry + ); + } + default: { + throw new Error(`Unknown contract: ${contract}`); + } + } +} +export { + createSubname_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/deleteSubname.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/deleteSubname.mjs new file mode 100644 index 000000000..4340f591f --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/deleteSubname.mjs @@ -0,0 +1,42 @@ +// src/functions/deleteSubname.ts +import { keccak256 as solidityKeccak256 } from "@ethersproject/solidity"; +import { namehash } from "../utils/normalise.mjs"; +async function deleteSubname_default({ contracts, signer }, name, { contract }) { + const labels = name.split("."); + if (labels.length < 3) { + throw new Error(`${name} is not a valid subname`); + } + const label = labels.shift(); + const labelhash = solidityKeccak256(["string"], [label]); + const parentNodehash = namehash(labels.join(".")); + switch (contract) { + case "registry": { + const registry = (await contracts.getRegistry()).connect(signer); + return registry.populateTransaction.setSubnodeRecord( + parentNodehash, + labelhash, + "0x0000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000", + 0 + ); + } + case "nameWrapper": { + const nameWrapper = (await contracts.getNameWrapper()).connect(signer); + return nameWrapper.populateTransaction.setSubnodeRecord( + parentNodehash, + label, + "0x0000000000000000000000000000000000000000", + "0x0000000000000000000000000000000000000000", + 0, + 0, + 0 + ); + } + default: { + throw new Error(`Unknown contract: ${contract}`); + } + } +} +export { + deleteSubname_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/getAvailable.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/getAvailable.mjs new file mode 100644 index 000000000..e7254d922 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/getAvailable.mjs @@ -0,0 +1,36 @@ +// src/functions/getAvailable.ts +import { labelhash } from "../utils/labels.mjs"; +var raw = async ({ contracts }, name) => { + const baseRegistrar = await contracts?.getBaseRegistrar(); + const labels = name.split("."); + if (labels.length !== 2 || labels[1] !== "eth") { + throw new Error("Currently only .eth names can be checked for availability"); + } + return { + to: baseRegistrar.address, + data: baseRegistrar.interface.encodeFunctionData("available", [ + labelhash(labels[0]) + ]) + }; +}; +var decode = async ({ contracts }, data) => { + if (data === null) + return; + const baseRegistrar = await contracts?.getBaseRegistrar(); + try { + const result = baseRegistrar.interface.decodeFunctionResult( + "available", + data + ); + return result["0"]; + } catch { + return; + } +}; +var getAvailable_default = { + raw, + decode +}; +export { + getAvailable_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/getDNSOwner.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/getDNSOwner.mjs new file mode 100644 index 000000000..7e28de823 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/getDNSOwner.mjs @@ -0,0 +1,60 @@ +// src/functions/getDNSOwner.ts +import { _fetchData } from "@ethersproject/web"; +import * as packet from "dns-packet"; +function encodeURLParams(p) { + return Object.entries(p).map((kv) => kv.map(encodeURIComponent).join("=")).join("&"); +} +var getDNS = async (q) => { + const url = `https://cloudflare-dns.com/dns-query?${encodeURLParams({ + ct: "application/dns-udpwireformat", + dns: packet.encode(q)?.toString("base64"), + ts: Date.now().toString() + })}`; + const response = await _fetchData(url, void 0); + const arrayBuffer = response.buffer.slice( + response.byteOffset, + response.byteLength + response.byteOffset + ); + const fromArrayBuffer = Buffer.from(arrayBuffer); + return packet.decode(fromArrayBuffer); +}; +var dnsQuery = async (qtype, qname) => { + const query = { + type: "query", + id: 1, + flags: packet.RECURSION_DESIRED, + questions: [ + { + type: qtype, + class: "IN", + name: qname + } + ], + additionals: [ + { + type: "OPT", + class: "IN", + name: ".", + udpPayloadSize: 4096, + flags: packet.DNSSEC_OK + } + ], + answers: [] + }; + const response = await getDNS(query); + if (response.rcode !== "NOERROR") { + throw new Error(`DNS query failed: ${response.rcode}`); + } + return response; +}; +async function getDNSOwner_default(_, dnsName) { + const result = await dnsQuery("TXT", `_ens.${dnsName}`); + const address = result?.answers?.[0]?.data?.[0]?.toString()?.split("=")?.[1]; + return address; +} +export { + getDNSOwner_default as default, + dnsQuery, + encodeURLParams, + getDNS +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/getExpiry.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/getExpiry.mjs new file mode 100644 index 000000000..0acc8bcee --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/getExpiry.mjs @@ -0,0 +1,95 @@ +// src/functions/getExpiry.ts +import { keccak256 as solidityKeccak256 } from "@ethersproject/solidity"; +import { namehash } from "../utils/normalise.mjs"; +var getRegistrarExpiry = async ({ contracts, multicallWrapper }, labels) => { + if (labels.length > 2 || labels[1] !== "eth") { + throw new Error("Only .eth names have expiry dates on the registrar"); + } + const baseRegistrar = await contracts?.getBaseRegistrar(); + const expiryCall = baseRegistrar.interface.encodeFunctionData("nameExpires", [ + solidityKeccak256(["string"], [labels[0]]) + ]); + const gracePeriodCall = baseRegistrar.interface.encodeFunctionData("GRACE_PERIOD"); + return multicallWrapper.raw([ + { + to: baseRegistrar.address, + data: expiryCall + }, + { + to: baseRegistrar.address, + data: gracePeriodCall + } + ]); +}; +var getWrapperExpiry = async ({ contracts }, labels) => { + const nameWrapper = await contracts?.getNameWrapper(); + const expiryCall = nameWrapper.interface.encodeFunctionData("getData", [ + namehash(labels.join(".")) + ]); + return { + to: nameWrapper.address, + data: expiryCall + }; +}; +var getContractToUse = (contract, labels) => { + if (contract) + return contract; + if (labels.length === 2 && labels[1] === "eth") { + return "registrar"; + } + return "nameWrapper"; +}; +var raw = async (ensArgs, name, { contract } = {}) => { + const labels = name.split("."); + const contractToUse = getContractToUse(contract, labels); + return contractToUse === "nameWrapper" ? getWrapperExpiry(ensArgs, labels) : getRegistrarExpiry(ensArgs, labels); +}; +var decodeRegistrarExpiry = async ({ contracts, multicallWrapper }, data) => { + const result = await multicallWrapper.decode(data); + const baseRegistrar = await contracts?.getBaseRegistrar(); + try { + const [nameExpires] = baseRegistrar.interface.decodeFunctionResult( + "nameExpires", + result[0].returnData + ); + const [gracePeriod] = baseRegistrar.interface.decodeFunctionResult( + "GRACE_PERIOD", + result[1].returnData + ); + return { + expiry: nameExpires > 0 ? new Date(nameExpires * 1e3) : null, + gracePeriod: gracePeriod.toNumber() * 1e3 + }; + } catch { + return; + } +}; +var decodeWrapperExpiry = async ({ contracts }, data) => { + const nameWrapper = await contracts?.getNameWrapper(); + try { + const [, , expiry] = nameWrapper.interface.decodeFunctionResult( + "getData", + data + ); + return { + expiry: new Date(expiry * 1e3), + gracePeriod: null + }; + } catch { + return; + } +}; +var decode = async (ensArgs, data, name, { contract } = {}) => { + if (data === null) + return; + const labels = name.split("."); + const contractToUse = getContractToUse(contract, labels); + return contractToUse === "nameWrapper" ? decodeWrapperExpiry(ensArgs, data) : decodeRegistrarExpiry(ensArgs, data); +}; +var getExpiry_default = { + raw, + decode +}; +export { + getExpiry_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/getHistory.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/getHistory.mjs new file mode 100644 index 000000000..de72125eb --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/getHistory.mjs @@ -0,0 +1,238 @@ +// src/functions/getHistory.ts +import { formatsByCoinType } from "@ensdomains/address-encoder"; +import { hexStripZeros } from "@ethersproject/bytes"; +import { decodeContenthash } from "../utils/contentHash.mjs"; +import { labelhash } from "../utils/labels.mjs"; +import { namehash } from "../utils/normalise.mjs"; +var eventFormat = { + Domain: { + NewOwner: (args) => ({ owner: args.owner.id }), + NewResolver: (args) => ({ + resolver: args.resolver.id.split("-")[0] + }), + Transfer: (args) => ({ owner: args.owner.id }), + NewTTL: (args) => ({ ttl: args.ttl }), + WrappedTransfer: (args) => ({ owner: args.owner.id }), + NameWrapped: (args) => ({ + fuses: args.fuses, + owner: args.owner.id, + expiryDate: args.expiryDate + }), + NameUnwrapped: (args) => ({ owner: args.owner.id }), + FusesSet: (args) => ({ fuses: args.fuses }), + ExpiryExtended: (args) => ({ expiryDate: args.expiryDate }) + }, + Registration: { + NameRegistered: (args) => ({ + registrant: args.registrant.id, + expiryDate: args.expiryDate + }), + NameRenewed: (args) => ({ expiryDate: args.expiryDate }), + NameTransferred: (args) => ({ owner: args.newOwner.id }) + }, + Resolver: { + AddrChanged: (args) => ({ addr: args.addr.id }), + MulticoinAddrChanged: (args) => { + const format = formatsByCoinType[parseInt(args.coinType)]; + if (!format) { + return { + coinType: args.coinType, + rawAddr: args.multiaddr + }; + } + if (hexStripZeros(args.multiaddr) === "0x") { + return { + coinType: args.coinType, + coinName: format.name, + rawAddr: "0x" + }; + } + return { + coinType: args.coinType, + coinName: format.name, + addr: format.encoder(Buffer.from(args.multiaddr.slice(2), "hex")) + }; + }, + NameChanged: (args) => ({ name: args.name }), + AbiChanged: (args) => ({ contentType: args.contentType }), + PubkeyChanged: (args) => ({ x: args.x, y: args.y }), + TextChanged: (args) => ({ key: args.key, value: args.value }), + ContenthashChanged: (args) => ({ + hash: decodeContenthash(args.hash) + }), + InterfaceChanged: (args) => ({ + interfaceId: args.interfaceID, + implementer: args.implementer + }), + AuthorisationChanged: (args) => ({ + owner: args.owner, + target: args.target, + isAuthorized: args.isAuthorized + }), + VersionChanged: (args) => ({ version: args.version }) + } +}; +var mapEvents = (eventArray, type) => eventArray.map( + (event) => ({ + type: event.__typename, + blockNumber: event.blockNumber, + transactionHash: event.transactionID, + id: event.id, + data: eventFormat[type][event.__typename](event) + }) +); +async function getHistory({ gqlInstance }, name) { + const { client } = gqlInstance; + const query = gqlInstance.gql` + query getHistory($namehash: String!, $labelhash: String!) { + domain(id: $namehash) { + events { + id + blockNumber + transactionID + __typename + ...on Transfer { + owner { + id + } + } + ...on NewOwner { + owner { + id + } + } + ...on NewResolver { + resolver { + id + } + } + ...on NewTTL { + ttl + } + ...on WrappedTransfer { + owner { + id + } + } + ...on NameWrapped { + fuses + expiryDate + owner { + id + } + } + ...on NameUnwrapped { + owner { + id + } + } + ...on FusesSet { + fuses + } + ...on ExpiryExtended { + expiryDate + } + } + registration { + events { + id + blockNumber + transactionID + __typename + ...on NameRegistered { + registrant { + id + } + expiryDate + } + ...on NameRenewed { + expiryDate + } + ...on NameTransferred { + newOwner { + id + } + } + } + } + resolver { + events { + id + blockNumber + transactionID + __typename + ...on AddrChanged { + addr { + id + } + } + ...on MulticoinAddrChanged { + coinType + multiaddr: addr + } + ...on NameChanged { + name + } + ...on AbiChanged { + contentType + } + ...on PubkeyChanged { + x + y + } + ...on TextChanged { + key + value + } + ...on ContenthashChanged { + hash + } + ...on InterfaceChanged { + interfaceID + implementer + } + ...on AuthorisationChanged { + owner + target + isAuthorized + } + ...on VersionChanged { + version + } + } + } + } + } + `; + const label = name.split(".")[0]; + const nameHash = namehash(name); + const labelHash = labelhash(label); + const response = await client.request(query, { + namehash: nameHash, + labelhash: labelHash + }); + const domain = response?.domain; + if (!domain) + return; + const { + events: domainEvents, + registration: { events: registrationEvents }, + resolver: { events: resolverEvents } + } = domain; + const domainHistory = mapEvents(domainEvents, "Domain"); + const registrationHistory = mapEvents(registrationEvents, "Registration"); + const resolverHistory = mapEvents( + resolverEvents.filter( + (event) => !event.coinType || event.coinType !== "60" + ), + "Resolver" + ); + return { + domain: domainHistory, + registration: registrationHistory, + resolver: resolverHistory + }; +} +export { + getHistory +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/getName.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/getName.mjs new file mode 100644 index 000000000..81c1406d7 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/getName.mjs @@ -0,0 +1,38 @@ +// src/functions/getName.ts +import { hexEncodeName } from "../utils/hexEncodedName.mjs"; +var raw = async ({ contracts }, address) => { + const universalResolver = await contracts?.getUniversalResolver(); + const reverseNode = `${address.toLowerCase().substring(2)}.addr.reverse`; + return { + to: universalResolver.address, + data: universalResolver.interface.encodeFunctionData("reverse(bytes)", [ + hexEncodeName(reverseNode) + ]) + }; +}; +var decode = async ({ contracts }, data, address) => { + if (data === null) + return; + const universalResolver = await contracts?.getUniversalResolver(); + try { + const result = universalResolver.interface.decodeFunctionResult( + "reverse(bytes)", + data + ); + return { + name: result["0"], + match: result["1"].toLowerCase() === address.toLowerCase(), + reverseResolverAddress: result["2"], + resolverAddress: result["3"] + }; + } catch { + return { name: void 0 }; + } +}; +var getName_default = { + raw, + decode +}; +export { + getName_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/getNames.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/getNames.mjs new file mode 100644 index 000000000..31da636fb --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/getNames.mjs @@ -0,0 +1,316 @@ +// src/functions/getNames.ts +import { truncateFormat } from "../utils/format.mjs"; +import { decodeFuses } from "../utils/fuses.mjs"; +import { decryptName } from "../utils/labels.mjs"; +var mapDomain = ({ name, ...domain }) => { + const decrypted = name ? decryptName(name) : void 0; + return { + ...domain, + name: decrypted, + truncatedName: decrypted ? truncateFormat(decrypted) : void 0, + createdAt: new Date(parseInt(domain.createdAt) * 1e3), + type: "domain" + }; +}; +var mapWrappedDomain = (wrappedDomain) => { + const domain = mapDomain(wrappedDomain.domain); + if (domain.registration) { + domain.registration = { + expiryDate: new Date( + parseInt(domain.registration.expiryDate) * 1e3 + ), + registrationDate: new Date( + parseInt(domain.registration.registrationDate) * 1e3 + ) + }; + } + return { + expiryDate: new Date(parseInt(wrappedDomain.expiryDate) * 1e3), + fuses: decodeFuses(wrappedDomain.fuses), + ...domain, + type: "wrappedDomain" + }; +}; +var mapRegistration = (registration) => { + const decrypted = decryptName(registration.domain.name); + return { + expiryDate: new Date(parseInt(registration.expiryDate) * 1e3), + registrationDate: new Date(parseInt(registration.registrationDate) * 1e3), + ...registration.domain, + name: decrypted, + truncatedName: truncateFormat(decrypted), + type: "registration" + }; +}; +var getNames = async ({ gqlInstance }, { + address: _address, + type, + page, + pageSize = 10, + orderDirection, + orderBy = "labelName" +}) => { + const address = _address.toLowerCase(); + const client = gqlInstance.client; + const domainQueryData = ` + id + labelName + labelhash + name + isMigrated + parent { + name + } + `; + let queryVars = {}; + let finalQuery = ""; + if (type === "all") { + finalQuery = gqlInstance.gql` + query getNames( + $id: ID! + $expiryDate: Int + ) { + account(id: $id) { + registrations( + first: 1000 + where: { expiryDate_gt: $expiryDate } + ) { + registrationDate + expiryDate + domain { + ${domainQueryData} + } + } + domains(first: 1000) { + ${domainQueryData} + createdAt + } + wrappedDomains(first: 1000) { + expiryDate + fuses + domain { + ${domainQueryData} + registration { + registrationDate + expiryDate + } + } + } + } + } + `; + queryVars = { + id: address, + expiryDate: Math.floor(Date.now() / 1e3) - 90 * 24 * 60 * 60 + }; + } else if (type === "owner") { + if (typeof page !== "number") { + finalQuery = gqlInstance.gql` + query getNames( + $id: ID! + $orderBy: Domain_orderBy + $orderDirection: OrderDirection + ) { + account(id: $id) { + domains(orderBy: $orderBy, orderDirection: $orderDirection) { + ${domainQueryData} + createdAt + } + } + } + `; + queryVars = { + id: address, + orderBy, + orderDirection + }; + } else { + finalQuery = gqlInstance.gql` + query getNames( + $id: ID! + $first: Int + $skip: Int + $orderBy: Domain_orderBy + $orderDirection: OrderDirection + ) { + account(id: $id) { + domains( + first: $first + skip: $skip + orderBy: $orderBy + orderDirection: $orderDirection + ) { + ${domainQueryData} + createdAt + } + } + } + `; + queryVars = { + id: address, + first: pageSize, + skip: (page || 0) * pageSize, + orderBy, + orderDirection + }; + } + } else if (type === "wrappedOwner") { + if (typeof page !== "number") { + finalQuery = gqlInstance.gql` + query getNames( + $id: ID! + $orderBy: WrappedDomain_orderBy + $orderDirection: OrderDirection + $expiryDate: Int + ) { + account(id: $id) { + wrappedDomains( + orderBy: $orderBy + orderDirection: $orderDirection + where: { expiryDate_gt: $expiryDate } + ) { + expiryDate + fuses + domain { + ${domainQueryData} + createdAt + } + } + } + } + `; + queryVars = { + id: address, + expiryDate: Math.floor(Date.now() / 1e3) - 90 * 24 * 60 * 60 + }; + } else { + finalQuery = gqlInstance.gql` + query getNames( + $id: ID! + $first: Int + $skip: Int + $orderBy: WrappedDomain_orderBy + $orderDirection: OrderDirection + ) { + account(id: $id) { + wrappedDomains( + first: $first + skip: $skip + orderBy: $orderBy + orderDirection: $orderDirection + ) { + expiryDate + fuses + domain { + ${domainQueryData} + createdAt + } + } + } + } + `; + queryVars = { + id: address, + first: pageSize, + skip: (page || 0) * pageSize, + orderBy: orderBy === "labelName" ? "name" : orderBy, + orderDirection + }; + } + } else if (typeof page !== "number") { + finalQuery = gqlInstance.gql` + query getNames( + $id: ID! + $orderBy: Registration_orderBy + $orderDirection: OrderDirection + $expiryDate: Int + ) { + account(id: $id) { + registrations( + orderBy: $orderBy + orderDirection: $orderDirection + where: { expiryDate_gt: $expiryDate } + ) { + registrationDate + expiryDate + domain { + ${domainQueryData} + } + } + } + } + `; + queryVars = { + id: address, + orderBy, + orderDirection, + expiryDate: Math.floor(Date.now() / 1e3) - 90 * 24 * 60 * 60 + }; + } else { + finalQuery = gqlInstance.gql` + query getNames( + $id: ID! + $first: Int + $skip: Int + $orderBy: Registration_orderBy + $orderDirection: OrderDirection + $expiryDate: Int + ) { + account(id: $id) { + registrations( + first: $first + skip: $skip + orderBy: $orderBy + orderDirection: $orderDirection + where: { expiryDate_gt: $expiryDate } + ) { + registrationDate + expiryDate + domain { + ${domainQueryData} + } + } + } + } + `; + queryVars = { + id: address, + first: pageSize, + skip: (page || 0) * pageSize, + orderBy, + orderDirection, + expiryDate: Math.floor(Date.now() / 1e3) - 90 * 24 * 60 * 60 + }; + } + const response = await client.request(finalQuery, queryVars); + const account = response?.account; + if (type === "all") { + return [ + ...account?.domains.map(mapDomain) || [], + ...account?.registrations.map(mapRegistration) || [], + ...account?.wrappedDomains.map(mapWrappedDomain) || [] + ].sort((a, b) => { + if (orderDirection === "desc") { + if (orderBy === "labelName") { + return b.name.localeCompare(a.name); + } + return b.createdAt.getTime() - a.createdAt.getTime(); + } + if (orderBy === "labelName") { + return a.name.localeCompare(b.name); + } + return a.createdAt.getTime() - b.createdAt.getTime(); + }); + } + if (type === "owner") { + return account?.domains.map(mapDomain) || []; + } + if (type === "wrappedOwner") { + return account?.wrappedDomains.map(mapWrappedDomain) || []; + } + return account?.registrations.map(mapRegistration) || []; +}; +var getNames_default = getNames; +export { + getNames_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/getOwner.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/getOwner.mjs new file mode 100644 index 000000000..1ca9637c4 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/getOwner.mjs @@ -0,0 +1,188 @@ +// src/functions/getOwner.ts +import { defaultAbiCoder } from "@ethersproject/abi/lib.esm/abi-coder.js"; +import { hexStripZeros } from "@ethersproject/bytes"; +import { labelhash } from "../utils/labels.mjs"; +import { namehash as makeNamehash } from "../utils/normalise.mjs"; +var singleContractOwnerRaw = async ({ contracts }, contract, namehash, labels) => { + switch (contract) { + case "nameWrapper": { + const nameWrapper = await contracts?.getNameWrapper(); + return { + to: nameWrapper.address, + data: nameWrapper.interface.encodeFunctionData("ownerOf", [namehash]) + }; + } + case "registry": { + const registry = await contracts?.getRegistry(); + return { + to: registry.address, + data: registry.interface.encodeFunctionData("owner", [namehash]) + }; + } + case "registrar": { + const registrar = await contracts?.getBaseRegistrar(); + return { + to: registrar.address, + data: registrar.interface.encodeFunctionData("ownerOf", [ + labelhash(labels[0]) + ]) + }; + } + } +}; +var raw = async ({ contracts, multicallWrapper }, name, contract) => { + const namehash = makeNamehash(name); + const labels = name.split("."); + if (contract || labels.length === 1) { + return singleContractOwnerRaw( + { contracts }, + contract || "registry", + namehash, + labels + ); + } + const registryData = await singleContractOwnerRaw( + { contracts }, + "registry", + namehash, + labels + ); + const nameWrapperData = await singleContractOwnerRaw( + { contracts }, + "nameWrapper", + namehash, + labels + ); + const registrarData = await singleContractOwnerRaw( + { contracts }, + "registrar", + namehash, + labels + ); + const data = [registryData, nameWrapperData]; + if (labels.length === 2 && labels[1] === "eth") { + data.push(registrarData); + } + return multicallWrapper.raw(data); +}; +var registrantQuery = ` + query GetRegistrant($namehash: String!) { + domain(id: $namehash) { + registration { + registrant { + id + } + } + } + } +`; +var singleContractOwnerDecode = (data) => defaultAbiCoder.decode(["address"], data)[0]; +var decode = async ({ + contracts, + multicallWrapper, + gqlInstance +}, data, name, contract) => { + if (!data) + return; + const labels = name.split("."); + if (contract || labels.length === 1) { + const singleOwner = singleContractOwnerDecode(data); + const obj = { + ownershipLevel: contract || "registry" + }; + if (contract === "registrar") { + return { + ...obj, + registrant: singleOwner + }; + } + return { + ...obj, + owner: singleOwner + }; + } + const result = await multicallWrapper.decode(data); + if (!result) + return; + const nameWrapper = await contracts?.getNameWrapper(); + const decodedData = [result[0][1], result[1][1], result[2]?.[1]].map( + (ret) => ret && ret !== "0x" && defaultAbiCoder.decode(["address"], ret) + ); + const registryOwner = decodedData[0][0]; + const nameWrapperOwner = decodedData[1][0]; + let registrarOwner = decodedData[2]?.[0]; + let baseReturnObject = {}; + if (labels[labels.length - 1] === "eth") { + if (labels.length === 2) { + if (!registrarOwner) { + const graphRegistrantResult = await gqlInstance.client.request( + registrantQuery, + { + namehash: makeNamehash(name) + } + ); + registrarOwner = graphRegistrantResult.domain?.registration?.registrant?.id; + baseReturnObject = { + expired: true + }; + } else { + baseReturnObject = { + expired: false + }; + } + } + if (registrarOwner?.toLowerCase() === nameWrapper.address.toLowerCase()) { + return { + owner: nameWrapperOwner, + ownershipLevel: "nameWrapper", + ...baseReturnObject + }; + } + if (registrarOwner) { + return { + registrant: registrarOwner, + owner: registryOwner, + ownershipLevel: "registrar", + ...baseReturnObject + }; + } + if (hexStripZeros(registryOwner) !== "0x") { + if (labels.length === 2) { + return { + registrant: void 0, + owner: registryOwner, + ownershipLevel: "registrar", + expired: true + }; + } + if (registryOwner === nameWrapper.address && nameWrapperOwner && hexStripZeros(nameWrapperOwner) !== "0x") { + return { + owner: nameWrapperOwner, + ownershipLevel: "nameWrapper" + }; + } + return { + owner: registryOwner, + ownershipLevel: "registry" + }; + } + return; + } + if (registryOwner === nameWrapper.address && nameWrapperOwner && hexStripZeros(nameWrapperOwner) !== "0x") { + return { + owner: nameWrapperOwner, + ownershipLevel: "nameWrapper" + }; + } + if (hexStripZeros(registryOwner) !== "0x") { + return { + owner: registryOwner, + ownershipLevel: "registry" + }; + } + return; +}; +var getOwner_default = { raw, decode }; +export { + getOwner_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/getPrice.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/getPrice.mjs new file mode 100644 index 000000000..b979fb863 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/getPrice.mjs @@ -0,0 +1,107 @@ +// src/functions/getPrice.ts +import { defaultAbiCoder } from "@ethersproject/abi/lib.esm/abi-coder.js"; +import { BigNumber } from "@ethersproject/bignumber/lib.esm/bignumber.js"; +var raw = async ({ contracts, multicallWrapper }, nameOrNames, duration, legacy) => { + const names = Array.isArray(nameOrNames) ? nameOrNames : [nameOrNames]; + if (names.length > 1) { + const bulkRenewal = await contracts?.getBulkRenewal(); + const baseCall2 = { + to: bulkRenewal.address, + data: bulkRenewal.interface.encodeFunctionData("rentPrice", [ + names, + duration + ]) + }; + if (legacy) { + return multicallWrapper.raw([ + baseCall2, + { + to: bulkRenewal.address, + data: bulkRenewal.interface.encodeFunctionData("rentPrice", [ + names, + 0 + ]) + } + ]); + } + return baseCall2; + } + const controller = await contracts?.getEthRegistrarController(); + const baseCall = { + to: controller.address, + data: controller.interface.encodeFunctionData("rentPrice", [ + names[0], + duration + ]) + }; + if (legacy) { + return multicallWrapper.raw([ + baseCall, + { + to: controller.address, + data: controller.interface.encodeFunctionData("rentPrice", [ + names[0], + 0 + ]) + } + ]); + } + return baseCall; +}; +var decode = async ({ contracts, multicallWrapper }, data, _nameOrNames, _duration, legacy) => { + if (data === null) + return; + try { + let base; + let premium; + const isBulkRenewal = Array.isArray(_nameOrNames) && _nameOrNames.length > 1; + if (isBulkRenewal && legacy) { + const result = await multicallWrapper.decode(data); + const [price] = defaultAbiCoder.decode( + ["uint256"], + result[0].returnData + ); + [premium] = defaultAbiCoder.decode( + ["uint256"], + result[1].returnData + ); + base = price.sub(premium); + } else if (isBulkRenewal) { + const bulkRenewal = await contracts?.getBulkRenewal(); + const result = bulkRenewal.interface.decodeFunctionResult( + "rentPrice", + data + ); + [base] = result; + premium = BigNumber.from(0); + } else if (!isBulkRenewal && legacy) { + const result = await multicallWrapper.decode(data); + const [price] = defaultAbiCoder.decode( + ["uint256"], + result[0].returnData + ); + [premium] = defaultAbiCoder.decode( + ["uint256"], + result[1].returnData + ); + base = price.sub(premium); + } else { + const controller = await contracts?.getEthRegistrarController(); + const result = controller.interface.decodeFunctionResult( + "rentPrice", + data + ); + [base, premium] = result[0]; + } + return { + base, + premium + }; + } catch { + return; + } +}; +var getPrice_default = { raw, decode }; +export { + getPrice_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/getProfile.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/getProfile.mjs new file mode 100644 index 000000000..10a7c5b18 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/getProfile.mjs @@ -0,0 +1,479 @@ +// src/functions/getProfile.ts +import { formatsByName } from "@ensdomains/address-encoder"; +import { defaultAbiCoder } from "@ethersproject/abi/lib.esm/abi-coder.js"; +import { hexStripZeros, isBytesLike } from "@ethersproject/bytes"; +import { decodeContenthash } from "../utils/contentHash.mjs"; +import { hexEncodeName } from "../utils/hexEncodedName.mjs"; +import { namehash } from "../utils/normalise.mjs"; +import { parseInputType } from "../utils/validation.mjs"; +var makeMulticallData = async ({ + _getAddr, + _getContentHash, + _getText +}, name, options) => { + let calls = []; + if (options.texts) + calls = [ + ...calls, + ...await Promise.all( + options.texts.map(async (x) => ({ + key: x, + data: await _getText.raw(name, x), + type: "text" + })) + ) + ]; + if (options.coinTypes) + calls = [ + ...calls, + ...await Promise.all( + options.coinTypes.map(async (x) => ({ + key: x, + data: await _getAddr.raw(name, x, true), + type: "addr" + })) + ) + ]; + if (typeof options.contentHash === "boolean" && options.contentHash) { + calls.push({ + key: "contentHash", + data: await _getContentHash.raw(name), + type: "contentHash" + }); + } + if (!calls.find((x) => x.key === "60")) { + calls.push({ + key: "60", + data: await _getAddr.raw(name, "60", true), + type: "addr" + }); + } + return { data: calls.map((x) => x.data.data), calls }; +}; +var fetchWithoutResolverMulticall = async ({ multicallWrapper }, calls, resolverAddress) => { + const callsWithResolver = calls.map((call) => ({ + to: resolverAddress, + data: call.data.data + })); + const results = await multicallWrapper(callsWithResolver); + if (!results || !results.length) + return []; + return results.map((x) => x[1]); +}; +var formatRecords = async ({ + _getText, + _getAddr, + _getContentHash +}, data, calls, options) => { + const returnedRecords = (await Promise.all( + data.map(async (item, i) => { + let decodedFromAbi; + let itemRet = { + key: calls[i].key, + type: calls[i].type + }; + if (itemRet.type === "contentHash") { + ; + [decodedFromAbi] = defaultAbiCoder.decode(["bytes"], item); + if (hexStripZeros(decodedFromAbi) === "0x") { + return; + } + } + switch (calls[i].type) { + case "text": + itemRet = { + ...itemRet, + value: await _getText.decode(item) + }; + if (itemRet.value === "" || itemRet.value === void 0) + return; + break; + case "addr": + try { + const addr = await _getAddr.decode(item, "", calls[i].key); + if (addr) { + itemRet = { + ...itemRet, + ...addr + }; + break; + } else { + return; + } + } catch { + return; + } + case "contentHash": + try { + itemRet = { + ...itemRet, + value: await _getContentHash.decode(item) + }; + break; + } catch { + return; + } + } + return itemRet; + }) + )).filter((x) => { + return typeof x === "object"; + }).filter((x) => x); + const returnedResponse = {}; + if (typeof options.contentHash === "string" || typeof options.contentHash === "object") { + if (typeof options.contentHash === "string" && hexStripZeros(options.contentHash) === "0x") { + returnedResponse.contentHash = null; + } else if (isBytesLike(options.contentHash.decoded) && hexStripZeros(options.contentHash.decoded) === "0x") { + returnedResponse.contentHash = null; + } else { + returnedResponse.contentHash = options.contentHash; + } + } else if (options.contentHash) { + const foundRecord = returnedRecords.find( + (item) => item.type === "contentHash" + ); + returnedResponse.contentHash = foundRecord ? foundRecord.value : null; + } + if (options.texts) { + returnedResponse.texts = returnedRecords.filter( + (x) => x.type === "text" + ); + } + if (options.coinTypes) { + returnedResponse.coinTypes = returnedRecords.filter( + (x) => x.type === "addr" + ); + } + return returnedResponse; +}; +var getDataForName = async ({ + contracts, + _getAddr, + _getContentHash, + _getText, + multicallWrapper +}, name, options, specificResolver) => { + const universalResolver = await contracts?.getUniversalResolver(); + const { data, calls } = await makeMulticallData( + { _getAddr, _getContentHash, _getText }, + name, + options + ); + let recordData; + let resolverAddress = specificResolver; + if (specificResolver) { + try { + const publicResolver = await contracts?.getPublicResolver( + void 0, + specificResolver + ); + recordData = await publicResolver?.callStatic.multicall(data); + } catch (e) { + console.error("getProfile error:", e); + recordData = await fetchWithoutResolverMulticall( + { multicallWrapper }, + calls, + resolverAddress + ); + } + } else { + try { + const resolvedData = await universalResolver["resolve(bytes,bytes[])"]( + hexEncodeName(name), + data, + { + ccipReadEnabled: true + } + ); + recordData = [...resolvedData["0"]]; + resolverAddress = resolvedData["1"]; + for (let i = 0; i < recordData.length; i += 1) { + if (recordData[i].startsWith("0x0d1947a9")) { + calls[i] = null; + recordData[i] = null; + } + } + } catch { + const registryContract = await contracts?.getRegistry(); + resolverAddress = await registryContract?.resolver(namehash(name)); + return { + address: void 0, + records: {}, + resolverAddress, + isInvalidResolverAddress: true + }; + } + } + if (!resolverAddress || !recordData || hexStripZeros(resolverAddress) === "0x") { + return { + address: void 0, + records: {}, + resolverAddress: void 0 + }; + } + const filteredCalls = calls.filter((x) => x); + const filteredRecordData = recordData.filter((x) => x); + const matchAddress = filteredRecordData[filteredCalls.findIndex((x) => x.key === "60")]; + return { + address: matchAddress && await _getAddr.decode(matchAddress).catch(() => false), + records: await formatRecords( + { _getAddr, _getContentHash, _getText }, + filteredRecordData, + filteredCalls, + options + ), + resolverAddress + }; +}; +var graphFetch = async ({ gqlInstance }, name, wantedRecords, resolverAddress) => { + const query = gqlInstance.gql` + query getRecords($id: String!) { + domain(id: $id) { + isMigrated + createdAt + resolver { + texts + coinTypes + contentHash + addr { + id + } + } + } + } + `; + const customResolverQuery = gqlInstance.gql` + query getRecordsWithCustomResolver($id: String!, $resolverId: String!) { + domain(id: $id) { + isMigrated + createdAt + } + resolver(id: $resolverId) { + texts + coinTypes + contentHash + addr { + id + } + } + } + `; + const { client } = gqlInstance; + const id = namehash(name); + let domain; + let resolverResponse; + if (!resolverAddress) { + const response = await client.request(query, { id }); + domain = response?.domain; + resolverResponse = domain?.resolver; + } else { + const resolverId = `${resolverAddress.toLowerCase()}-${id}`; + const response = await client.request(customResolverQuery, { + id, + resolverId + }); + resolverResponse = response?.resolver; + domain = response?.domain; + } + if (!domain) + return; + const { isMigrated, createdAt } = domain; + const returnedRecords = {}; + if (!resolverResponse || !wantedRecords) + return { isMigrated, createdAt }; + Object.keys(wantedRecords).forEach((key) => { + const data = wantedRecords[key]; + if (typeof data === "boolean" && data) { + if (key === "contentHash") { + returnedRecords[key] = decodeContenthash(resolverResponse.contentHash); + } else { + returnedRecords[key] = resolverResponse[key]; + } + } + }); + return { + ...returnedRecords, + isMigrated, + createdAt + }; +}; +var getProfileFromName = async ({ + contracts, + gqlInstance, + _getAddr, + _getContentHash, + _getText, + resolverMulticallWrapper, + multicallWrapper +}, name, options) => { + const { resolverAddress, fallback, ..._options } = options || {}; + const optsLength = Object.keys(_options).length; + let usingOptions; + if (!optsLength || _options?.texts === true || _options?.coinTypes === true) { + if (optsLength) + usingOptions = _options; + else + usingOptions = { contentHash: true, texts: true, coinTypes: true }; + } + const graphResult = await graphFetch( + { gqlInstance }, + name, + usingOptions, + resolverAddress + ); + let isMigrated = null; + let createdAt = null; + let result = null; + if (!graphResult) { + if (!fallback) + return; + result = await getDataForName( + { + contracts, + _getAddr, + _getContentHash, + _getText, + resolverMulticallWrapper, + multicallWrapper + }, + name, + fallback, + void 0 + ); + } else { + const { + isMigrated: _isMigrated, + createdAt: _createdAt, + ...wantedRecords + } = graphResult; + isMigrated = _isMigrated; + createdAt = _createdAt; + let recordsWithFallback = usingOptions ? wantedRecords : _options; + if ((Object.keys(recordsWithFallback).length === 0 || !recordsWithFallback.coinTypes && !recordsWithFallback.texts && Object.keys(recordsWithFallback.contentHash || {}).length === 0) && fallback) { + recordsWithFallback = fallback; + } + result = await getDataForName( + { + contracts, + _getAddr, + _getContentHash, + _getText, + resolverMulticallWrapper, + multicallWrapper + }, + name, + recordsWithFallback, + options?.resolverAddress + ); + } + if (!result?.resolverAddress) + return { + isMigrated, + createdAt, + message: !result ? "Records fetch didn't complete" : "Name doesn't have a resolver" + }; + return { ...result, isMigrated, createdAt, message: void 0 }; +}; +var getProfileFromAddress = async ({ + contracts, + gqlInstance, + getName, + _getAddr, + _getContentHash, + _getText, + resolverMulticallWrapper, + multicallWrapper +}, address, options) => { + let name; + try { + name = await getName(address); + } catch (e) { + return; + } + if (!name || !name.name || name.name === "") + return; + if (!name.match) + return { ...name, isMigrated: null, createdAt: null }; + const result = await getProfileFromName( + { + contracts, + gqlInstance, + _getAddr, + _getContentHash, + _getText, + resolverMulticallWrapper, + multicallWrapper + }, + name.name, + options + ); + if (!result || result.message) + return; + delete result.address; + return { + ...result, + ...name, + message: void 0 + }; +}; +var mapCoinTypes = (coin) => { + if (!Number.isNaN(parseInt(coin))) { + return coin; + } + return `${formatsByName[coin.toUpperCase()].coinType}`; +}; +async function getProfile_default({ + contracts, + gqlInstance, + getName, + _getAddr, + _getContentHash, + _getText, + resolverMulticallWrapper, + multicallWrapper +}, nameOrAddress, options) { + if (options) { + if (options.coinTypes && typeof options.coinTypes !== "boolean") { + options.coinTypes = options.coinTypes.map(mapCoinTypes); + } + if (options.fallback && options.fallback.coinTypes) { + options.fallback.coinTypes = options.fallback.coinTypes.map(mapCoinTypes); + } + } + const inputType = parseInputType(nameOrAddress); + if (inputType.type === "unknown" || inputType.info === "unsupported") { + throw new Error("Invalid input type"); + } + if (inputType.type === "address") { + return getProfileFromAddress( + { + contracts, + gqlInstance, + getName, + _getAddr, + _getContentHash, + _getText, + resolverMulticallWrapper, + multicallWrapper + }, + nameOrAddress, + options + ); + } + return getProfileFromName( + { + contracts, + gqlInstance, + _getAddr, + _getContentHash, + _getText, + resolverMulticallWrapper, + multicallWrapper + }, + nameOrAddress, + options + ); +} +export { + getProfile_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/getRecords.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/getRecords.mjs new file mode 100644 index 000000000..59bb94b77 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/getRecords.mjs @@ -0,0 +1,12 @@ +// src/functions/getRecords.ts +import { parseInputType } from "../utils/validation.mjs"; +async function getRecords_default({ getProfile }, name, options) { + const inputType = parseInputType(name); + if (inputType.type !== "name" && inputType.type !== "label") { + throw new Error("Input must be an ENS name"); + } + return getProfile(name, options); +} +export { + getRecords_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/getResolver.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/getResolver.mjs new file mode 100644 index 000000000..70f8c6818 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/getResolver.mjs @@ -0,0 +1,27 @@ +// src/functions/getResolver.ts +import { hexStripZeros } from "@ethersproject/bytes"; +import { hexEncodeName } from "../utils/hexEncodedName.mjs"; +var raw = async ({ contracts }, name) => { + const universalResolver = await contracts?.getUniversalResolver(); + return { + to: universalResolver.address, + data: universalResolver.interface.encodeFunctionData("findResolver", [ + hexEncodeName(name) + ]) + }; +}; +var decode = async ({ contracts }, data) => { + const universalResolver = await contracts?.getUniversalResolver(); + const response = universalResolver.interface.decodeFunctionResult( + "findResolver", + data + ); + if (!response || !response[0] || hexStripZeros(response[0]) === "0x") { + return; + } + return response[0]; +}; +var getResolver_default = { raw, decode }; +export { + getResolver_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/getSpecificRecord.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/getSpecificRecord.mjs new file mode 100644 index 000000000..d40417eca --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/getSpecificRecord.mjs @@ -0,0 +1,253 @@ +// src/functions/getSpecificRecord.ts +import { formatsByCoinType, formatsByName } from "@ensdomains/address-encoder"; +import { arrayify, hexStripZeros, isBytesLike } from "@ethersproject/bytes"; +import { toUtf8String } from "@ethersproject/strings"; +import { decodeContenthash } from "../utils/contentHash.mjs"; +import { namehash } from "../utils/normalise.mjs"; +var _getContentHash = { + raw: async ({ contracts }, name) => { + const publicResolver = await contracts?.getPublicResolver(); + return { + to: "0x0000000000000000000000000000000000000000", + data: publicResolver.interface.encodeFunctionData("contenthash", [ + namehash(name) + ]) + }; + }, + decode: async ({ contracts }, data) => { + let response; + const publicResolver = await contracts?.getPublicResolver(); + try { + ; + [response] = publicResolver.interface.decodeFunctionResult( + "contenthash", + data + ); + } catch { + return; + } + if (!response) { + return; + } + const decodedContent = decodeContenthash(response); + if (!decodedContent || isBytesLike(decodedContent.decoded) && hexStripZeros(decodedContent.decoded) === "0x" || Object.keys(decodedContent).length === 0) { + return; + } + return decodedContent; + } +}; +var getContentHash = { + raw: async ({ contracts, universalWrapper }, name) => { + const prData = await _getContentHash.raw({ contracts }, name); + return universalWrapper.raw(name, prData.data); + }, + decode: async ({ contracts, universalWrapper }, data) => { + const urData = await universalWrapper.decode(data); + if (!urData) + return; + return _getContentHash.decode({ contracts }, urData.data); + } +}; +var _getText = { + raw: async ({ contracts }, name, key) => { + const publicResolver = await contracts?.getPublicResolver(); + return { + to: "0x0000000000000000000000000000000000000000", + data: publicResolver.interface.encodeFunctionData("text", [ + namehash(name), + key + ]) + }; + }, + decode: async ({ contracts }, data) => { + const publicResolver = await contracts?.getPublicResolver(); + const [response] = publicResolver.interface.decodeFunctionResult( + "text", + data + ); + if (!response) { + return; + } + return response; + } +}; +var getText = { + raw: async ({ contracts, universalWrapper }, name, key) => { + const prData = await _getText.raw({ contracts }, name, key); + return universalWrapper.raw(name, prData.data); + }, + decode: async ({ contracts, universalWrapper }, data) => { + const urData = await universalWrapper.decode(data); + if (!urData) + return; + return _getText.decode({ contracts }, urData.data); + } +}; +var _getAddr = { + raw: async ({ contracts }, name, coinType, bypassFormat) => { + if (!coinType) { + coinType = 60; + } + const publicResolver = await contracts?.getPublicResolver(); + if (coinType === 60 || coinType === "60") { + return { + to: "0x0000000000000000000000000000000000000000", + data: publicResolver.interface.encodeFunctionData("addr(bytes32)", [ + namehash(name) + ]) + }; + } + if (bypassFormat) { + return { + to: "0x0000000000000000000000000000000000000000", + data: publicResolver.interface.encodeFunctionData( + "addr(bytes32,uint256)", + [namehash(name), coinType] + ) + }; + } + const formatter = typeof coinType === "string" && Number.isNaN(parseInt(coinType)) ? formatsByName[coinType] : formatsByCoinType[typeof coinType === "number" ? coinType : parseInt(coinType)]; + if (!formatter) { + throw new Error(`No formatter found for coin: ${coinType}`); + } + return { + to: "0x0000000000000000000000000000000000000000", + data: publicResolver.interface.encodeFunctionData( + "addr(bytes32,uint256)", + [namehash(name), formatter.coinType] + ) + }; + }, + decode: async ({ contracts }, data, _name, coinType) => { + let returnCoinType = true; + if (!coinType) { + coinType = 60; + returnCoinType = false; + } + const publicResolver = await contracts?.getPublicResolver(); + const formatter = typeof coinType === "string" && Number.isNaN(parseInt(coinType)) ? formatsByName[coinType] : formatsByCoinType[typeof coinType === "number" ? coinType : parseInt(coinType)]; + let response; + if (coinType === 60 || coinType === "60") { + ; + [response] = publicResolver.interface.decodeFunctionResult( + "addr(bytes32)", + data + ); + } else { + ; + [response] = publicResolver.interface.decodeFunctionResult( + "addr(bytes32,uint256)", + data + ); + } + if (!response) + return; + if (hexStripZeros(response) === "0x") { + return; + } + const decodedAddr = formatter.encoder(Buffer.from(response.slice(2), "hex")); + if (!decodedAddr) { + return; + } + if (!returnCoinType) { + return decodedAddr; + } + return { coin: formatter.name, addr: decodedAddr }; + } +}; +var getAddr = { + raw: async ({ contracts, universalWrapper }, name, coinType) => { + const prData = await _getAddr.raw({ contracts }, name, coinType); + return universalWrapper.raw(name, prData.data); + }, + decode: async ({ contracts, universalWrapper }, data, _name, coinType) => { + const urData = await universalWrapper.decode(data); + if (!urData) + return; + return _getAddr.decode({ contracts }, urData.data, _name, coinType); + } +}; +var supportedContentTypes = "0xf"; +var _getABI = { + raw: async ({ contracts }, name) => { + const publicResolver = await contracts?.getPublicResolver(); + return { + to: "0x0000000000000000000000000000000000000000", + data: publicResolver.interface.encodeFunctionData("ABI", [ + namehash(name), + supportedContentTypes + ]) + }; + }, + decode: async ({ contracts }, data) => { + const publicResolver = await contracts?.getPublicResolver(); + const [bnContentType, encodedABIData] = publicResolver.interface.decodeFunctionResult("ABI", data); + if (!bnContentType || !data) { + return; + } + const contentType = bnContentType.toNumber(); + if (!contentType) { + return; + } + let abiData; + let decoded = false; + switch (contentType) { + case 1: + abiData = JSON.parse(toUtf8String(encodedABIData)); + decoded = true; + break; + case 2: { + const { inflate } = await import("pako/dist/pako_inflate.min.js"); + abiData = JSON.parse( + inflate(arrayify(encodedABIData), { to: "string" }) + ); + decoded = true; + break; + } + case 4: { + const { decodeFirst } = await import("cbor"); + abiData = await decodeFirst(arrayify(encodedABIData)); + decoded = true; + break; + } + case 8: + abiData = toUtf8String(encodedABIData); + decoded = false; + break; + default: + try { + abiData = toUtf8String(encodedABIData); + } catch { + abiData = encodedABIData; + } + decoded = false; + } + return { + contentType, + decoded, + abi: abiData + }; + } +}; +var getABI = { + raw: async ({ contracts, universalWrapper }, name) => { + const prData = await _getABI.raw({ contracts }, name); + return universalWrapper.raw(name, prData.data); + }, + decode: async ({ contracts, universalWrapper }, data) => { + const urData = await universalWrapper.decode(data); + if (!urData) + return; + return _getABI.decode({ contracts }, urData.data); + } +}; +export { + _getABI, + _getAddr, + _getContentHash, + _getText, + getABI, + getAddr, + getContentHash, + getText +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/getSubnames.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/getSubnames.mjs new file mode 100644 index 000000000..2eb8232bf --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/getSubnames.mjs @@ -0,0 +1,92 @@ +// src/functions/getSubnames.ts +import { truncateFormat } from "../utils/format.mjs"; +import { decryptName } from "../utils/labels.mjs"; +import { namehash } from "../utils/normalise.mjs"; +var largeQuery = async ({ gqlInstance }, { + name, + pageSize = 10, + orderDirection, + orderBy, + lastSubnames = [], + search = "" +}) => { + const { client } = gqlInstance; + const lastSubname = lastSubnames?.[lastSubnames.length - 1]; + const lastCreatedAt = lastSubname?.createdAt; + const lastLabelName = lastSubname?.labelName; + let whereFilter = ""; + if (orderBy === "createdAt" && lastCreatedAt) { + whereFilter += orderDirection === "asc" ? "createdAt_gt: $lastCreatedAt" : "createdAt_lt: $lastCreatedAt"; + } else if (orderBy === "labelName" && lastLabelName) { + whereFilter += orderDirection === "asc" ? "labelName_gt: $lastLabelName" : "labelName_lt: $lastLabelName"; + } + if (search) { + whereFilter += " labelName_contains: $search"; + } + const finalQuery = gqlInstance.gql` + query getSubnames( + $id: ID! + $first: Int + $lastCreatedAt: BigInt + $lastLabelName: String + $orderBy: Domain_orderBy + $orderDirection: OrderDirection + $search: String + ) { + domain( + id: $id + ) { + subdomainCount + subdomains( + first: $first + orderBy: $orderBy + orderDirection: $orderDirection + where: { + ${whereFilter} + } + ) { + id + labelName + labelhash + isMigrated + name + subdomainCount + createdAt + owner { + id + } + } + } + } + `; + const queryVars = { + id: namehash(name), + first: pageSize, + lastCreatedAt, + lastLabelName, + orderBy, + orderDirection, + search: search?.toLowerCase() + }; + const response = await client.request(finalQuery, queryVars); + const domain = response?.domain; + const subdomains = domain.subdomains.map((subname) => { + const decrypted = decryptName(subname.name); + return { + ...subname, + name: decrypted, + truncatedName: truncateFormat(decrypted) + }; + }); + return { + subnames: subdomains, + subnameCount: domain.subdomainCount + }; +}; +var getSubnames = (injected, functionArgs) => { + return largeQuery(injected, functionArgs); +}; +var getSubnames_default = getSubnames; +export { + getSubnames_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/getWrapperData.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/getWrapperData.mjs new file mode 100644 index 000000000..96d8d37e2 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/getWrapperData.mjs @@ -0,0 +1,37 @@ +// src/functions/getWrapperData.ts +import { decodeFuses } from "../utils/fuses.mjs"; +import { namehash } from "../utils/normalise.mjs"; +var raw = async ({ contracts }, name) => { + const nameWrapper = await contracts?.getNameWrapper(); + return { + to: nameWrapper.address, + data: nameWrapper.interface.encodeFunctionData("getData", [namehash(name)]) + }; +}; +var decode = async ({ contracts }, data) => { + const nameWrapper = await contracts?.getNameWrapper(); + try { + const [owner, fuses, expiry] = nameWrapper.interface.decodeFunctionResult( + "getData", + data + ); + const fuseObj = decodeFuses(fuses); + const expiryDate = expiry.gt(0) ? new Date(expiry.toNumber() * 1e3) : void 0; + return { + ...fuseObj, + expiryDate, + rawFuses: fuses, + owner + }; + } catch (e) { + console.error("Error decoding wrapper data: ", e); + return; + } +}; +var getWrapperData_default = { + raw, + decode +}; +export { + getWrapperData_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/importDNSSECName.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/importDNSSECName.mjs new file mode 100644 index 000000000..000825265 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/importDNSSECName.mjs @@ -0,0 +1,40 @@ +// src/functions/importDNSSECName.ts +import { Oracle as NewOracle } from "@ensdomains/dnssecoraclejs"; +import packet from "dns-packet"; +import { EMPTY_ADDRESS } from "../utils/consts.mjs"; +var DNS_OVER_HTTP_ENDPOINT = "https://1.1.1.1/dns-query"; +async function importDNSSECName_default({ contracts, provider }, name, { address, proverResult }) { + const dnsRegistrarContract = await contracts?.getDNSRegistrar(); + const resolverContract = await contracts?.getPublicResolver(); + const registrarOracle = await dnsRegistrarContract?.oracle(); + if (!registrarOracle) { + throw new Error("No oracle found"); + } + const oracle = new NewOracle(registrarOracle, provider); + const proofData = await oracle.getProofData(proverResult); + const encodedName = `0x${packet.name.encode(name).toString("hex")}`; + const data = proofData.rrsets.map( + (x) => Object.values(x) + ); + const { proof } = proofData; + if (address === EMPTY_ADDRESS) { + return dnsRegistrarContract?.populateTransaction.proveAndClaim( + encodedName, + data, + proof + ); + } + if (address) { + return dnsRegistrarContract?.populateTransaction.proveAndClaimWithResolver( + encodedName, + data, + proof, + resolverContract.address, + address + ); + } +} +export { + DNS_OVER_HTTP_ENDPOINT, + importDNSSECName_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/initialGetters.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/initialGetters.mjs new file mode 100644 index 000000000..2901efa22 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/initialGetters.mjs @@ -0,0 +1,25 @@ +// src/functions/initialGetters.ts +import { default as default2 } from "./batch.mjs"; +export * from "./batchWrappers.mjs"; +import { default as default3 } from "./getExpiry.mjs"; +import { default as default4 } from "./getName.mjs"; +import { default as default5 } from "./getNames.mjs"; +import { default as default6 } from "./getOwner.mjs"; +import { default as default7 } from "./getPrice.mjs"; +import { default as default8 } from "./getProfile.mjs"; +import { default as default9 } from "./getRecords.mjs"; +export * from "./getSpecificRecord.mjs"; +import { default as default10 } from "./getSubnames.mjs"; +import { default as default11 } from "./supportsTLD.mjs"; +export { + default2 as batch, + default3 as getExpiry, + default4 as getName, + default5 as getNames, + default6 as getOwner, + default7 as getPrice, + default8 as getProfile, + default9 as getRecords, + default10 as getSubnames, + default11 as supportsTLD +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/registerName.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/registerName.mjs new file mode 100644 index 000000000..da4c6d2c3 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/registerName.mjs @@ -0,0 +1,27 @@ +// src/functions/registerName.ts +import { + makeRegistrationData +} from "../utils/registerHelpers.mjs"; +import { wrappedLabelLengthCheck } from "../utils/wrapper.mjs"; +async function registerName_default({ contracts }, name, { resolverAddress, value, ...params }) { + const labels = name.split("."); + if (labels.length !== 2 || labels[1] !== "eth") + throw new Error("Currently only .eth TLD registrations are supported"); + wrappedLabelLengthCheck(labels[0]); + const controller = await contracts.getEthRegistrarController(); + const _resolver = await contracts.getPublicResolver( + void 0, + resolverAddress + ); + const generatedParams = makeRegistrationData({ + name, + resolver: _resolver, + ...params + }); + return controller.populateTransaction.register(...generatedParams, { + value + }); +} +export { + registerName_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/renewNames.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/renewNames.mjs new file mode 100644 index 000000000..16b1e1003 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/renewNames.mjs @@ -0,0 +1,36 @@ +// src/functions/renewNames.ts +import { MAX_INT_64 } from "../utils/consts.mjs"; +import { labelhash } from "../utils/labels.mjs"; +import { namehash } from "../utils/normalise.mjs"; +async function extendWrappedName({ contracts }, name, options) { + const expiry = options?.duration || MAX_INT_64; + const labels = name.split("."); + const labelHash = labelhash(labels.shift()); + const parentNode = namehash(labels.join(".")); + const nameWrapper = await contracts.getNameWrapper(); + return nameWrapper.populateTransaction.extendExpiry( + parentNode, + labelHash, + expiry + ); +} +async function renewNames_default({ contracts }, nameOrNames, { duration, value }) { + const names = Array.isArray(nameOrNames) ? nameOrNames : [nameOrNames]; + const labels = names.map((name) => { + const label = name.split("."); + if (label.length !== 2 || label[1] !== "eth") { + throw new Error("Currently only .eth TLD renewals are supported"); + } + return label[0]; + }); + if (labels.length === 1) { + const controller = await contracts.getEthRegistrarController(); + return controller.populateTransaction.renew(labels[0], duration, { value }); + } + const bulkRenewal = await contracts.getBulkRenewal(); + return bulkRenewal.populateTransaction.renewAll(labels, duration, { value }); +} +export { + renewNames_default as default, + extendWrappedName +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/setFuses.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/setFuses.mjs new file mode 100644 index 000000000..fbbdda3a8 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/setFuses.mjs @@ -0,0 +1,30 @@ +// src/functions/setFuses.ts +import { encodeFuses } from "../utils/fuses.mjs"; +import { labelhash } from "../utils/labels.mjs"; +import { namehash } from "../utils/normalise.mjs"; +async function setChildFuses({ contracts, signer }, name, { + fuses, + expiry = 0 +}) { + const encodedFuses = encodeFuses(fuses); + const labels = name.split("."); + const labelHash = labelhash(labels.shift()); + const parentNode = namehash(labels.join(".")); + const nameWrapper = (await contracts.getNameWrapper()).connect(signer); + return nameWrapper.populateTransaction.setChildFuses( + parentNode, + labelHash, + encodedFuses, + expiry + ); +} +async function setFuses_default({ contracts, signer }, name, props) { + const encodedFuses = encodeFuses(props, "child"); + const nameWrapper = (await contracts.getNameWrapper()).connect(signer); + const hash = namehash(name); + return nameWrapper.populateTransaction.setFuses(hash, encodedFuses); +} +export { + setFuses_default as default, + setChildFuses +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/setName.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/setName.mjs new file mode 100644 index 000000000..68e840f77 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/setName.mjs @@ -0,0 +1,23 @@ +// src/functions/setName.ts +async function setName_default({ contracts, signer }, name, { + address, + resolver +} = {}) { + const signerAddress = await signer.getAddress(); + const reverseRegistrar = (await contracts?.getReverseRegistrar())?.connect( + signer + ); + if (address) { + const publicResolver = await contracts?.getPublicResolver(); + return reverseRegistrar.populateTransaction.setNameForAddr( + address, + signerAddress, + resolver || publicResolver.address, + name + ); + } + return reverseRegistrar.populateTransaction.setName(name); +} +export { + setName_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/setRecord.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/setRecord.mjs new file mode 100644 index 000000000..6ce9ed641 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/setRecord.mjs @@ -0,0 +1,36 @@ +// src/functions/setRecord.ts +import { namehash } from "../utils/normalise.mjs"; +import { generateSingleRecordCall } from "../utils/recordHelpers.mjs"; +async function setRecord_default({ + contracts, + provider, + getResolver, + signer +}, name, { + record, + type, + resolverAddress +}) { + if (!name.includes(".")) { + throw new Error("Input is not an ENS name"); + } + let resolverToUse; + if (resolverAddress) { + resolverToUse = resolverAddress; + } else { + resolverToUse = await getResolver(name); + } + if (!resolverToUse) { + throw new Error("No resolver found for input address"); + } + const resolver = (await contracts?.getPublicResolver(provider, resolverToUse))?.connect(signer); + const hash = namehash(name); + const call = generateSingleRecordCall(hash, resolver, type)(record); + return { + to: resolver.address, + data: call + }; +} +export { + setRecord_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/setRecords.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/setRecords.mjs new file mode 100644 index 000000000..138baee63 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/setRecords.mjs @@ -0,0 +1,32 @@ +// src/functions/setRecords.ts +import { namehash } from "../utils/normalise.mjs"; +import { generateRecordCallArray } from "../utils/recordHelpers.mjs"; +async function setRecords_default({ + contracts, + provider, + getResolver, + signer +}, name, { + records, + resolverAddress +}) { + if (!name.includes(".")) { + throw new Error("Input is not an ENS name"); + } + let resolverToUse; + if (resolverAddress) { + resolverToUse = resolverAddress; + } else { + resolverToUse = await getResolver(name); + } + if (!resolverToUse) { + throw new Error("No resolver found for input address"); + } + const resolver = (await contracts?.getPublicResolver(provider, resolverToUse))?.connect(signer); + const hash = namehash(name); + const calls = generateRecordCallArray(hash, records, resolver); + return resolver.populateTransaction.multicall(calls); +} +export { + setRecords_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/setResolver.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/setResolver.mjs new file mode 100644 index 000000000..6b003d035 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/setResolver.mjs @@ -0,0 +1,29 @@ +// src/functions/setResolver.ts +import { namehash } from "../utils/normalise.mjs"; +async function setResolver_default({ contracts, signer }, name, { + contract, + resolver +}) { + if (!resolver) { + resolver = (await contracts.getPublicResolver()).address; + } + switch (contract) { + case "registry": { + const registry = (await contracts?.getRegistry()).connect(signer); + return registry.populateTransaction.setResolver(namehash(name), resolver); + } + case "nameWrapper": { + const nameWrapper = (await contracts?.getNameWrapper()).connect(signer); + return nameWrapper.populateTransaction.setResolver( + namehash(name), + resolver + ); + } + default: { + throw new Error(`Unknown contract: ${contract}`); + } + } +} +export { + setResolver_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/supportsTLD.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/supportsTLD.mjs new file mode 100644 index 000000000..c0249d48d --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/supportsTLD.mjs @@ -0,0 +1,29 @@ +// src/functions/supportsTLD.ts +import { DNSRegistrar__factory } from "../generated/factories/DNSRegistrar__factory.mjs"; +var DNSSEC_CLAIM_INTERFACE_IDS = ["0x2f435428", "0x17d8f49b", "0x1aa2e641"]; +async function supportsTLD_default({ getOwner, provider }, name) { + try { + const labels = name.split("."); + const tld = labels[labels.length - 1]; + if (tld === "eth") + return true; + const tldOwner = await getOwner(tld, "registry"); + if (!tldOwner?.owner) + return false; + const dnsRegistrar = DNSRegistrar__factory.connect( + tldOwner.owner, + provider + ); + const supports = await Promise.all( + DNSSEC_CLAIM_INTERFACE_IDS.map( + (interfaceId) => dnsRegistrar.supportsInterface(interfaceId) + ) + ); + return supports.some((s) => !!s); + } catch { + return false; + } +} +export { + supportsTLD_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/transferController.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/transferController.mjs new file mode 100644 index 000000000..f92828299 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/transferController.mjs @@ -0,0 +1,23 @@ +// src/functions/transferController.ts +import { keccak256 as solidityKeccak256 } from "@ethersproject/solidity"; +async function transferController_default({ contracts, signer }, name, { + newOwner, + isOwner +}) { + const baseRegistrar = (await contracts?.getBaseRegistrar()).connect(signer); + const registry = (await contracts?.getRegistry()).connect(signer); + const labels = name.split("."); + if (isOwner) { + return registry.populateTransaction.setOwner( + solidityKeccak256(["string"], [labels[0]]), + newOwner + ); + } + return baseRegistrar.populateTransaction.reclaim( + solidityKeccak256(["string"], [labels[0]]), + newOwner + ); +} +export { + transferController_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/transferName.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/transferName.mjs new file mode 100644 index 000000000..18a4fa413 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/transferName.mjs @@ -0,0 +1,46 @@ +// src/functions/transferName.ts +import { keccak256 as solidityKeccak256 } from "@ethersproject/solidity"; +import { namehash } from "../utils/normalise.mjs"; +async function transferName_default({ contracts, signer }, name, { + newOwner, + contract, + reclaim +}) { + const address = await signer.getAddress(); + switch (contract) { + case "registry": { + const registry = (await contracts?.getRegistry()).connect(signer); + return registry.populateTransaction.setOwner(namehash(name), newOwner); + } + case "baseRegistrar": { + const baseRegistrar = (await contracts?.getBaseRegistrar()).connect( + signer + ); + const labels = name.split("."); + if (labels.length > 2 || labels[labels.length - 1] !== "eth") { + throw new Error("Invalid name for baseRegistrar"); + } + const tokenId = solidityKeccak256(["string"], [labels[0]]); + if (reclaim) { + return baseRegistrar.populateTransaction.reclaim(tokenId, newOwner); + } + return baseRegistrar.populateTransaction["safeTransferFrom(address,address,uint256)"](address, newOwner, tokenId); + } + case "nameWrapper": { + const nameWrapper = (await contracts?.getNameWrapper()).connect(signer); + return nameWrapper.populateTransaction.safeTransferFrom( + address, + newOwner, + namehash(name), + 1, + "0x" + ); + } + default: { + throw new Error(`Unknown contract: ${contract}`); + } + } +} +export { + transferName_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/transferSubname.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/transferSubname.mjs new file mode 100644 index 000000000..f2910cb85 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/transferSubname.mjs @@ -0,0 +1,45 @@ +// src/functions/transferSubname.ts +import { keccak256 as solidityKeccak256 } from "@ethersproject/solidity"; +import { namehash } from "../utils/normalise.mjs"; +import { makeExpiry } from "../utils/wrapper.mjs"; +async function transferSubname_default({ + contracts, + signer, + getExpiry +}, name, { contract, owner, resolverAddress, ...wrapperArgs }) { + const labels = name.split("."); + const label = labels.shift(); + const labelhash = solidityKeccak256(["string"], [label]); + const parentNodehash = namehash(labels.join(".")); + switch (contract) { + case "registry": { + const registry = (await contracts.getRegistry()).connect(signer); + return registry.populateTransaction.setSubnodeOwner( + parentNodehash, + labelhash, + owner + ); + } + case "nameWrapper": { + const nameWrapper = (await contracts.getNameWrapper()).connect(signer); + const expiry = await makeExpiry( + { getExpiry }, + labels.join("."), + "expiry" in wrapperArgs ? wrapperArgs.expiry : void 0 + ); + return nameWrapper.populateTransaction.setSubnodeOwner( + parentNodehash, + label, + owner, + "0", + expiry + ); + } + default: { + throw new Error(`Unknown contract: ${contract}`); + } + } +} +export { + transferSubname_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/types.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/types.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/unwrapName.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/unwrapName.mjs new file mode 100644 index 000000000..ebb0cbee9 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/unwrapName.mjs @@ -0,0 +1,33 @@ +// src/functions/unwrapName.ts +import { keccak256 as solidityKeccak256 } from "@ethersproject/solidity"; +import { namehash } from "../utils/normalise.mjs"; +async function unwrapName_default({ contracts, signer }, name, { + newController, + newRegistrant +}) { + const labels = name.split("."); + const labelhash = solidityKeccak256(["string"], [labels[0]]); + const parentNodehash = namehash(labels.slice(1).join(".")); + const nameWrapper = (await contracts.getNameWrapper()).connect(signer); + if (labels.length === 2 && labels[1] === "eth") { + if (!newRegistrant) { + throw new Error("newRegistrant must be specified for .eth names"); + } + return nameWrapper.populateTransaction.unwrapETH2LD( + labelhash, + newRegistrant, + newController + ); + } + if (newRegistrant) { + throw new Error("newRegistrant can only be specified for .eth names"); + } + return nameWrapper.populateTransaction.unwrap( + parentNodehash, + labelhash, + newController + ); +} +export { + unwrapName_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/functions/wrapName.mjs b/.yalc/@ensdomains/ensjs/dist/esm/functions/wrapName.mjs new file mode 100644 index 000000000..9d07182bb --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/functions/wrapName.mjs @@ -0,0 +1,95 @@ +// src/functions/wrapName.ts +import { defaultAbiCoder } from "@ethersproject/abi/lib.esm/abi-coder.js"; +import { keccak256 as solidityKeccak256 } from "@ethersproject/solidity"; +import { encodeFuses } from "../utils/fuses.mjs"; +import { hexEncodeName } from "../utils/hexEncodedName.mjs"; +import { wrappedLabelLengthCheck } from "../utils/wrapper.mjs"; +async function wrapETH({ contracts }, labels, wrappedOwner, decodedFuses, resolverAddress, signer, address) { + const nameWrapper = await contracts?.getNameWrapper(); + const baseRegistrar = (await contracts.getBaseRegistrar()).connect(signer); + const labelhash = solidityKeccak256(["string"], [labels[0]]); + const data = defaultAbiCoder.encode( + ["string", "address", "uint16", "address"], + [labels[0], wrappedOwner, decodedFuses, resolverAddress] + ); + return baseRegistrar.populateTransaction["safeTransferFrom(address,address,uint256,bytes)"](address, nameWrapper.address, labelhash, data); +} +async function wrapOther({ contracts }, name, wrappedOwner, resolverAddress, address, signer) { + const nameWrapper = (await contracts.getNameWrapper()).connect(signer); + const registry = await contracts?.getRegistry(); + const hasApproval = await registry.isApprovedForAll( + address, + nameWrapper.address + ); + if (!hasApproval) { + throw new Error( + "NameWrapper must have approval to wrap a name from this address." + ); + } + return nameWrapper.populateTransaction.wrap( + hexEncodeName(name), + wrappedOwner, + resolverAddress + ); +} +async function wrapName_default({ contracts, signer }, name, { + wrappedOwner, + fuseOptions, + expiry, + resolverAddress +}) { + const address = await signer.getAddress(); + let decodedFuses; + const publicResolver = await contracts?.getPublicResolver(); + if (!resolverAddress) + resolverAddress = publicResolver.address; + const labels = name.split("."); + wrappedLabelLengthCheck(labels[0]); + if (labels.length === 2 && labels[1] === "eth") { + switch (typeof fuseOptions) { + case "object": { + decodedFuses = encodeFuses(fuseOptions); + break; + } + case "number": { + decodedFuses = fuseOptions; + break; + } + case "undefined": { + decodedFuses = 0; + break; + } + default: { + throw new Error(`Invalid fuseOptions type: ${typeof fuseOptions}`); + } + } + return wrapETH( + { contracts }, + labels, + wrappedOwner, + decodedFuses, + resolverAddress, + signer, + address + ); + } + if (fuseOptions) + throw new Error( + "Fuses can not be initially set when wrapping a non .eth name" + ); + if (expiry) + throw new Error( + "Expiry can not be initially set when wrapping a non .eth name" + ); + return wrapOther( + { contracts }, + name, + wrappedOwner, + resolverAddress, + address, + signer + ); +} +export { + wrapName_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/BaseRegistrarImplementation.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/BaseRegistrarImplementation.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/BulkRenewal.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/BulkRenewal.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/DNSRegistrar.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/DNSRegistrar.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/DNSSECImpl.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/DNSSECImpl.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/DefaultReverseResolver.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/DefaultReverseResolver.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/ENSRegistry.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/ENSRegistry.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/ETHRegistrarController.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/ETHRegistrarController.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/Multicall.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/Multicall.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/NameWrapper.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/NameWrapper.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/P256SHA256Algorithm.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/P256SHA256Algorithm.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/PublicResolver.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/PublicResolver.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/RSASHA1Algorithm.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/RSASHA1Algorithm.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/RSASHA256Algorithm.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/RSASHA256Algorithm.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/ReverseRegistrar.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/ReverseRegistrar.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/Root.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/Root.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/SHA1Digest.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/SHA1Digest.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/SHA1NSEC3Digest.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/SHA1NSEC3Digest.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/SHA256Digest.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/SHA256Digest.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/StaticMetadataService.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/StaticMetadataService.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/TLDPublicSuffixList.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/TLDPublicSuffixList.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/UniversalResolver.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/UniversalResolver.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/common.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/common.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/BaseRegistrarImplementation__factory.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/BaseRegistrarImplementation__factory.mjs new file mode 100644 index 000000000..522534a08 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/BaseRegistrarImplementation__factory.mjs @@ -0,0 +1,779 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; + +// src/generated/factories/BaseRegistrarImplementation__factory.ts +import { Interface } from "@ethersproject/abi/lib.esm/interface.js"; +import { Contract } from "@ethersproject/contracts"; +var _abi = [ + { + inputs: [ + { + internalType: "contract ENS", + name: "_ens", + type: "address" + }, + { + internalType: "bytes32", + name: "_baseNode", + type: "bytes32" + } + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "approved", + type: "address" + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256" + } + ], + name: "Approval", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address" + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool" + } + ], + name: "ApprovalForAll", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "controller", + type: "address" + } + ], + name: "ControllerAdded", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "controller", + type: "address" + } + ], + name: "ControllerRemoved", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "id", + type: "uint256" + }, + { + indexed: true, + internalType: "address", + name: "owner", + type: "address" + }, + { + indexed: false, + internalType: "uint256", + name: "expires", + type: "uint256" + } + ], + name: "NameMigrated", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "id", + type: "uint256" + }, + { + indexed: true, + internalType: "address", + name: "owner", + type: "address" + }, + { + indexed: false, + internalType: "uint256", + name: "expires", + type: "uint256" + } + ], + name: "NameRegistered", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "uint256", + name: "id", + type: "uint256" + }, + { + indexed: false, + internalType: "uint256", + name: "expires", + type: "uint256" + } + ], + name: "NameRenewed", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "previousOwner", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "newOwner", + type: "address" + } + ], + name: "OwnershipTransferred", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "from", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address" + }, + { + indexed: true, + internalType: "uint256", + name: "tokenId", + type: "uint256" + } + ], + name: "Transfer", + type: "event" + }, + { + constant: true, + inputs: [], + name: "GRACE_PERIOD", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "controller", + type: "address" + } + ], + name: "addController", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "to", + type: "address" + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256" + } + ], + name: "approve", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "uint256", + name: "id", + type: "uint256" + } + ], + name: "available", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "owner", + type: "address" + } + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [], + name: "baseNode", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + name: "controllers", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [], + name: "ens", + outputs: [ + { + internalType: "contract ENS", + name: "", + type: "address" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256" + } + ], + name: "getApproved", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "address", + name: "operator", + type: "address" + } + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [], + name: "isOwner", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "uint256", + name: "id", + type: "uint256" + } + ], + name: "nameExpires", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256" + } + ], + name: "ownerOf", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "id", + type: "uint256" + }, + { + internalType: "address", + name: "owner", + type: "address" + } + ], + name: "reclaim", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "id", + type: "uint256" + }, + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "uint256", + name: "duration", + type: "uint256" + } + ], + name: "register", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "id", + type: "uint256" + }, + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "uint256", + name: "duration", + type: "uint256" + } + ], + name: "registerOnly", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "controller", + type: "address" + } + ], + name: "removeController", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "uint256", + name: "id", + type: "uint256" + }, + { + internalType: "uint256", + name: "duration", + type: "uint256" + } + ], + name: "renew", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [], + name: "renounceOwnership", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "from", + type: "address" + }, + { + internalType: "address", + name: "to", + type: "address" + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256" + } + ], + name: "safeTransferFrom", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "from", + type: "address" + }, + { + internalType: "address", + name: "to", + type: "address" + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256" + }, + { + internalType: "bytes", + name: "_data", + type: "bytes" + } + ], + name: "safeTransferFrom", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "to", + type: "address" + }, + { + internalType: "bool", + name: "approved", + type: "bool" + } + ], + name: "setApprovalForAll", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "resolver", + type: "address" + } + ], + name: "setResolver", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "bytes4", + name: "interfaceID", + type: "bytes4" + } + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "from", + type: "address" + }, + { + internalType: "address", + name: "to", + type: "address" + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256" + } + ], + name: "transferFrom", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address" + } + ], + name: "transferOwnership", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + } +]; +var BaseRegistrarImplementation__factory = class { + static createInterface() { + return new Interface(_abi); + } + static connect(address, signerOrProvider) { + return new Contract( + address, + _abi, + signerOrProvider + ); + } +}; +__publicField(BaseRegistrarImplementation__factory, "abi", _abi); +export { + BaseRegistrarImplementation__factory +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/BulkRenewal__factory.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/BulkRenewal__factory.mjs new file mode 100644 index 000000000..7ef01043d --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/BulkRenewal__factory.mjs @@ -0,0 +1,109 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; + +// src/generated/factories/BulkRenewal__factory.ts +import { Interface } from "@ethersproject/abi/lib.esm/interface.js"; +import { Contract } from "@ethersproject/contracts"; +var _abi = [ + { + inputs: [ + { + internalType: "contract ENS", + name: "_ens", + type: "address" + } + ], + stateMutability: "nonpayable", + type: "constructor" + }, + { + inputs: [], + name: "ens", + outputs: [ + { + internalType: "contract ENS", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "string[]", + name: "names", + type: "string[]" + }, + { + internalType: "uint256", + name: "duration", + type: "uint256" + } + ], + name: "renewAll", + outputs: [], + stateMutability: "payable", + type: "function" + }, + { + inputs: [ + { + internalType: "string[]", + name: "names", + type: "string[]" + }, + { + internalType: "uint256", + name: "duration", + type: "uint256" + } + ], + name: "rentPrice", + outputs: [ + { + internalType: "uint256", + name: "total", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes4", + name: "interfaceID", + type: "bytes4" + } + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "pure", + type: "function" + } +]; +var BulkRenewal__factory = class { + static createInterface() { + return new Interface(_abi); + } + static connect(address, signerOrProvider) { + return new Contract(address, _abi, signerOrProvider); + } +}; +__publicField(BulkRenewal__factory, "abi", _abi); +export { + BulkRenewal__factory +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/DNSRegistrar__factory.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/DNSRegistrar__factory.mjs new file mode 100644 index 000000000..f1eab79ba --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/DNSRegistrar__factory.mjs @@ -0,0 +1,278 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; + +// src/generated/factories/DNSRegistrar__factory.ts +import { Interface } from "@ethersproject/abi/lib.esm/interface.js"; +import { Contract } from "@ethersproject/contracts"; +var _abi = [ + { + inputs: [ + { + internalType: "contract DNSSEC", + name: "_dnssec", + type: "address" + }, + { + internalType: "contract PublicSuffixList", + name: "_suffixes", + type: "address" + }, + { + internalType: "contract ENS", + name: "_ens", + type: "address" + } + ], + stateMutability: "nonpayable", + type: "constructor" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: true, + internalType: "address", + name: "owner", + type: "address" + }, + { + indexed: false, + internalType: "bytes", + name: "dnsname", + type: "bytes" + } + ], + name: "Claim", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "oracle", + type: "address" + } + ], + name: "NewOracle", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "suffixes", + type: "address" + } + ], + name: "NewPublicSuffixList", + type: "event" + }, + { + inputs: [ + { + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + internalType: "bytes", + name: "proof", + type: "bytes" + } + ], + name: "claim", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [], + name: "ens", + outputs: [ + { + internalType: "contract ENS", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "oracle", + outputs: [ + { + internalType: "contract DNSSEC", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + components: [ + { + internalType: "bytes", + name: "rrset", + type: "bytes" + }, + { + internalType: "bytes", + name: "sig", + type: "bytes" + } + ], + internalType: "struct DNSSEC.RRSetWithSignature[]", + name: "input", + type: "tuple[]" + }, + { + internalType: "bytes", + name: "proof", + type: "bytes" + } + ], + name: "proveAndClaim", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + components: [ + { + internalType: "bytes", + name: "rrset", + type: "bytes" + }, + { + internalType: "bytes", + name: "sig", + type: "bytes" + } + ], + internalType: "struct DNSSEC.RRSetWithSignature[]", + name: "input", + type: "tuple[]" + }, + { + internalType: "bytes", + name: "proof", + type: "bytes" + }, + { + internalType: "address", + name: "resolver", + type: "address" + }, + { + internalType: "address", + name: "addr", + type: "address" + } + ], + name: "proveAndClaimWithResolver", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "contract DNSSEC", + name: "_dnssec", + type: "address" + } + ], + name: "setOracle", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "contract PublicSuffixList", + name: "_suffixes", + type: "address" + } + ], + name: "setPublicSuffixList", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [], + name: "suffixes", + outputs: [ + { + internalType: "contract PublicSuffixList", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes4", + name: "interfaceID", + type: "bytes4" + } + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "pure", + type: "function" + } +]; +var DNSRegistrar__factory = class { + static createInterface() { + return new Interface(_abi); + } + static connect(address, signerOrProvider) { + return new Contract(address, _abi, signerOrProvider); + } +}; +__publicField(DNSRegistrar__factory, "abi", _abi); +export { + DNSRegistrar__factory +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/DNSSECImpl__factory.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/DNSSECImpl__factory.mjs new file mode 100644 index 000000000..5cdcb3e88 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/DNSSECImpl__factory.mjs @@ -0,0 +1,483 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; + +// src/generated/factories/DNSSECImpl__factory.ts +import { Interface } from "@ethersproject/abi/lib.esm/interface.js"; +import { Contract } from "@ethersproject/contracts"; +var _abi = [ + { + inputs: [ + { + internalType: "bytes", + name: "_anchors", + type: "bytes" + } + ], + stateMutability: "nonpayable", + type: "constructor" + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint8", + name: "id", + type: "uint8" + }, + { + indexed: false, + internalType: "address", + name: "addr", + type: "address" + } + ], + name: "AlgorithmUpdated", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint8", + name: "id", + type: "uint8" + }, + { + indexed: false, + internalType: "address", + name: "addr", + type: "address" + } + ], + name: "DigestUpdated", + type: "event" + }, + { + anonymous: false, + inputs: [], + name: "Marker", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint8", + name: "id", + type: "uint8" + }, + { + indexed: false, + internalType: "address", + name: "addr", + type: "address" + } + ], + name: "NSEC3DigestUpdated", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + indexed: false, + internalType: "bytes", + name: "rrset", + type: "bytes" + } + ], + name: "RRSetUpdated", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "t", + type: "uint256" + } + ], + name: "Test", + type: "event" + }, + { + inputs: [ + { + internalType: "uint8", + name: "", + type: "uint8" + } + ], + name: "algorithms", + outputs: [ + { + internalType: "contract Algorithm", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "anchors", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "uint16", + name: "deleteType", + type: "uint16" + }, + { + internalType: "bytes", + name: "deleteName", + type: "bytes" + }, + { + components: [ + { + internalType: "bytes", + name: "rrset", + type: "bytes" + }, + { + internalType: "bytes", + name: "sig", + type: "bytes" + } + ], + internalType: "struct DNSSEC.RRSetWithSignature", + name: "nsec", + type: "tuple" + }, + { + internalType: "bytes", + name: "proof", + type: "bytes" + } + ], + name: "deleteRRSet", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "uint16", + name: "deleteType", + type: "uint16" + }, + { + internalType: "bytes", + name: "deleteName", + type: "bytes" + }, + { + components: [ + { + internalType: "bytes", + name: "rrset", + type: "bytes" + }, + { + internalType: "bytes", + name: "sig", + type: "bytes" + } + ], + internalType: "struct DNSSEC.RRSetWithSignature", + name: "closestEncloser", + type: "tuple" + }, + { + components: [ + { + internalType: "bytes", + name: "rrset", + type: "bytes" + }, + { + internalType: "bytes", + name: "sig", + type: "bytes" + } + ], + internalType: "struct DNSSEC.RRSetWithSignature", + name: "nextClosest", + type: "tuple" + }, + { + internalType: "bytes", + name: "dnskey", + type: "bytes" + } + ], + name: "deleteRRSetNSEC3", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "uint8", + name: "", + type: "uint8" + } + ], + name: "digests", + outputs: [ + { + internalType: "contract Digest", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "uint8", + name: "", + type: "uint8" + } + ], + name: "nsec3Digests", + outputs: [ + { + internalType: "contract NSEC3Digest", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "uint16", + name: "dnstype", + type: "uint16" + }, + { + internalType: "bytes", + name: "name", + type: "bytes" + } + ], + name: "rrdata", + outputs: [ + { + internalType: "uint32", + name: "", + type: "uint32" + }, + { + internalType: "uint32", + name: "", + type: "uint32" + }, + { + internalType: "bytes20", + name: "", + type: "bytes20" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "uint8", + name: "id", + type: "uint8" + }, + { + internalType: "contract Algorithm", + name: "algo", + type: "address" + } + ], + name: "setAlgorithm", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "uint8", + name: "id", + type: "uint8" + }, + { + internalType: "contract Digest", + name: "digest", + type: "address" + } + ], + name: "setDigest", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "uint8", + name: "id", + type: "uint8" + }, + { + internalType: "contract NSEC3Digest", + name: "digest", + type: "address" + } + ], + name: "setNSEC3Digest", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address" + } + ], + name: "setOwner", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + components: [ + { + internalType: "bytes", + name: "rrset", + type: "bytes" + }, + { + internalType: "bytes", + name: "sig", + type: "bytes" + } + ], + internalType: "struct DNSSEC.RRSetWithSignature", + name: "input", + type: "tuple" + }, + { + internalType: "bytes", + name: "proof", + type: "bytes" + } + ], + name: "submitRRSet", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + components: [ + { + internalType: "bytes", + name: "rrset", + type: "bytes" + }, + { + internalType: "bytes", + name: "sig", + type: "bytes" + } + ], + internalType: "struct DNSSEC.RRSetWithSignature[]", + name: "input", + type: "tuple[]" + }, + { + internalType: "bytes", + name: "_proof", + type: "bytes" + } + ], + name: "submitRRSets", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes" + } + ], + stateMutability: "nonpayable", + type: "function" + } +]; +var DNSSECImpl__factory = class { + static createInterface() { + return new Interface(_abi); + } + static connect(address, signerOrProvider) { + return new Contract(address, _abi, signerOrProvider); + } +}; +__publicField(DNSSECImpl__factory, "abi", _abi); +export { + DNSSECImpl__factory +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/DefaultReverseResolver__factory.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/DefaultReverseResolver__factory.mjs new file mode 100644 index 000000000..078004478 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/DefaultReverseResolver__factory.mjs @@ -0,0 +1,96 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; + +// src/generated/factories/DefaultReverseResolver__factory.ts +import { Interface } from "@ethersproject/abi/lib.esm/interface.js"; +import { Contract } from "@ethersproject/contracts"; +var _abi = [ + { + inputs: [ + { + internalType: "contract ENS", + name: "ensAddr", + type: "address" + } + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor" + }, + { + constant: true, + inputs: [], + name: "ens", + outputs: [ + { + internalType: "contract ENS", + name: "", + type: "address" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + name: "name", + outputs: [ + { + internalType: "string", + name: "", + type: "string" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "string", + name: "_name", + type: "string" + } + ], + name: "setName", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + } +]; +var DefaultReverseResolver__factory = class { + static createInterface() { + return new Interface(_abi); + } + static connect(address, signerOrProvider) { + return new Contract( + address, + _abi, + signerOrProvider + ); + } +}; +__publicField(DefaultReverseResolver__factory, "abi", _abi); +export { + DefaultReverseResolver__factory +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/ENSRegistry__factory.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/ENSRegistry__factory.mjs new file mode 100644 index 000000000..c25020fd3 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/ENSRegistry__factory.mjs @@ -0,0 +1,444 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; + +// src/generated/factories/ENSRegistry__factory.ts +import { Interface } from "@ethersproject/abi/lib.esm/interface.js"; +import { Contract } from "@ethersproject/contracts"; +var _abi = [ + { + inputs: [ + { + internalType: "contract ENS", + name: "_old", + type: "address" + } + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address" + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool" + } + ], + name: "ApprovalForAll", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: true, + internalType: "bytes32", + name: "label", + type: "bytes32" + }, + { + indexed: false, + internalType: "address", + name: "owner", + type: "address" + } + ], + name: "NewOwner", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "address", + name: "resolver", + type: "address" + } + ], + name: "NewResolver", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "uint64", + name: "ttl", + type: "uint64" + } + ], + name: "NewTTL", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "address", + name: "owner", + type: "address" + } + ], + name: "Transfer", + type: "event" + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "address", + name: "operator", + type: "address" + } + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [], + name: "old", + outputs: [ + { + internalType: "contract ENS", + name: "", + type: "address" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "recordExists", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "resolver", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "operator", + type: "address" + }, + { + internalType: "bool", + name: "approved", + type: "bool" + } + ], + name: "setApprovalForAll", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "address", + name: "owner", + type: "address" + } + ], + name: "setOwner", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "address", + name: "resolver", + type: "address" + }, + { + internalType: "uint64", + name: "ttl", + type: "uint64" + } + ], + name: "setRecord", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "address", + name: "resolver", + type: "address" + } + ], + name: "setResolver", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "bytes32", + name: "label", + type: "bytes32" + }, + { + internalType: "address", + name: "owner", + type: "address" + } + ], + name: "setSubnodeOwner", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "bytes32", + name: "label", + type: "bytes32" + }, + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "address", + name: "resolver", + type: "address" + }, + { + internalType: "uint64", + name: "ttl", + type: "uint64" + } + ], + name: "setSubnodeRecord", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "uint64", + name: "ttl", + type: "uint64" + } + ], + name: "setTTL", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "ttl", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64" + } + ], + payable: false, + stateMutability: "view", + type: "function" + } +]; +var ENSRegistry__factory = class { + static createInterface() { + return new Interface(_abi); + } + static connect(address, signerOrProvider) { + return new Contract(address, _abi, signerOrProvider); + } +}; +__publicField(ENSRegistry__factory, "abi", _abi); +export { + ENSRegistry__factory +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/ETHRegistrarController__factory.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/ETHRegistrarController__factory.mjs new file mode 100644 index 000000000..8943b6bd6 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/ETHRegistrarController__factory.mjs @@ -0,0 +1,618 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; + +// src/generated/factories/ETHRegistrarController__factory.ts +import { Interface } from "@ethersproject/abi/lib.esm/interface.js"; +import { Contract } from "@ethersproject/contracts"; +var _abi = [ + { + inputs: [ + { + internalType: "contract BaseRegistrarImplementation", + name: "_base", + type: "address" + }, + { + internalType: "contract IPriceOracle", + name: "_prices", + type: "address" + }, + { + internalType: "uint256", + name: "_minCommitmentAge", + type: "uint256" + }, + { + internalType: "uint256", + name: "_maxCommitmentAge", + type: "uint256" + }, + { + internalType: "contract ReverseRegistrar", + name: "_reverseRegistrar", + type: "address" + }, + { + internalType: "contract INameWrapper", + name: "_nameWrapper", + type: "address" + } + ], + stateMutability: "nonpayable", + type: "constructor" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "commitment", + type: "bytes32" + } + ], + name: "CommitmentTooNew", + type: "error" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "commitment", + type: "bytes32" + } + ], + name: "CommitmentTooOld", + type: "error" + }, + { + inputs: [ + { + internalType: "uint256", + name: "duration", + type: "uint256" + } + ], + name: "DurationTooShort", + type: "error" + }, + { + inputs: [], + name: "InsufficientValue", + type: "error" + }, + { + inputs: [], + name: "MaxCommitmentAgeTooHigh", + type: "error" + }, + { + inputs: [], + name: "MaxCommitmentAgeTooLow", + type: "error" + }, + { + inputs: [ + { + internalType: "string", + name: "name", + type: "string" + } + ], + name: "NameNotAvailable", + type: "error" + }, + { + inputs: [], + name: "ResolverRequiredWhenDataSupplied", + type: "error" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "commitment", + type: "bytes32" + } + ], + name: "UnexpiredCommitmentExists", + type: "error" + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "string", + name: "name", + type: "string" + }, + { + indexed: true, + internalType: "bytes32", + name: "label", + type: "bytes32" + }, + { + indexed: true, + internalType: "address", + name: "owner", + type: "address" + }, + { + indexed: false, + internalType: "uint256", + name: "baseCost", + type: "uint256" + }, + { + indexed: false, + internalType: "uint256", + name: "premium", + type: "uint256" + }, + { + indexed: false, + internalType: "uint256", + name: "expires", + type: "uint256" + } + ], + name: "NameRegistered", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "string", + name: "name", + type: "string" + }, + { + indexed: true, + internalType: "bytes32", + name: "label", + type: "bytes32" + }, + { + indexed: false, + internalType: "uint256", + name: "cost", + type: "uint256" + }, + { + indexed: false, + internalType: "uint256", + name: "expires", + type: "uint256" + } + ], + name: "NameRenewed", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "previousOwner", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "newOwner", + type: "address" + } + ], + name: "OwnershipTransferred", + type: "event" + }, + { + inputs: [], + name: "MIN_REGISTRATION_DURATION", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "string", + name: "name", + type: "string" + } + ], + name: "available", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "commitment", + type: "bytes32" + } + ], + name: "commit", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + name: "commitments", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "string", + name: "name", + type: "string" + }, + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "uint256", + name: "duration", + type: "uint256" + }, + { + internalType: "bytes32", + name: "secret", + type: "bytes32" + }, + { + internalType: "address", + name: "resolver", + type: "address" + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]" + }, + { + internalType: "bool", + name: "reverseRecord", + type: "bool" + }, + { + internalType: "uint16", + name: "ownerControlledFuses", + type: "uint16" + } + ], + name: "makeCommitment", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + stateMutability: "pure", + type: "function" + }, + { + inputs: [], + name: "maxCommitmentAge", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "minCommitmentAge", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "nameWrapper", + outputs: [ + { + internalType: "contract INameWrapper", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "prices", + outputs: [ + { + internalType: "contract IPriceOracle", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "_token", + type: "address" + }, + { + internalType: "address", + name: "_to", + type: "address" + }, + { + internalType: "uint256", + name: "_amount", + type: "uint256" + } + ], + name: "recoverFunds", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "string", + name: "name", + type: "string" + }, + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "uint256", + name: "duration", + type: "uint256" + }, + { + internalType: "bytes32", + name: "secret", + type: "bytes32" + }, + { + internalType: "address", + name: "resolver", + type: "address" + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]" + }, + { + internalType: "bool", + name: "reverseRecord", + type: "bool" + }, + { + internalType: "uint16", + name: "ownerControlledFuses", + type: "uint16" + } + ], + name: "register", + outputs: [], + stateMutability: "payable", + type: "function" + }, + { + inputs: [ + { + internalType: "string", + name: "name", + type: "string" + }, + { + internalType: "uint256", + name: "duration", + type: "uint256" + } + ], + name: "renew", + outputs: [], + stateMutability: "payable", + type: "function" + }, + { + inputs: [], + name: "renounceOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "string", + name: "name", + type: "string" + }, + { + internalType: "uint256", + name: "duration", + type: "uint256" + } + ], + name: "rentPrice", + outputs: [ + { + components: [ + { + internalType: "uint256", + name: "base", + type: "uint256" + }, + { + internalType: "uint256", + name: "premium", + type: "uint256" + } + ], + internalType: "struct IPriceOracle.Price", + name: "price", + type: "tuple" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "reverseRegistrar", + outputs: [ + { + internalType: "contract ReverseRegistrar", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes4", + name: "interfaceID", + type: "bytes4" + } + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "pure", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address" + } + ], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "string", + name: "name", + type: "string" + } + ], + name: "valid", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "pure", + type: "function" + }, + { + inputs: [], + name: "withdraw", + outputs: [], + stateMutability: "nonpayable", + type: "function" + } +]; +var ETHRegistrarController__factory = class { + static createInterface() { + return new Interface(_abi); + } + static connect(address, signerOrProvider) { + return new Contract( + address, + _abi, + signerOrProvider + ); + } +}; +__publicField(ETHRegistrarController__factory, "abi", _abi); +export { + ETHRegistrarController__factory +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/Multicall__factory.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/Multicall__factory.mjs new file mode 100644 index 000000000..c634dd9dc --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/Multicall__factory.mjs @@ -0,0 +1,462 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; + +// src/generated/factories/Multicall__factory.ts +import { Interface } from "@ethersproject/abi/lib.esm/interface.js"; +import { Contract } from "@ethersproject/contracts"; +var _abi = [ + { + inputs: [ + { + components: [ + { + internalType: "address", + name: "target", + type: "address" + }, + { + internalType: "bytes", + name: "callData", + type: "bytes" + } + ], + internalType: "struct Multicall3.Call[]", + name: "calls", + type: "tuple[]" + } + ], + name: "aggregate", + outputs: [ + { + internalType: "uint256", + name: "blockNumber", + type: "uint256" + }, + { + internalType: "bytes[]", + name: "returnData", + type: "bytes[]" + } + ], + stateMutability: "payable", + type: "function" + }, + { + inputs: [ + { + components: [ + { + internalType: "address", + name: "target", + type: "address" + }, + { + internalType: "bool", + name: "allowFailure", + type: "bool" + }, + { + internalType: "bytes", + name: "callData", + type: "bytes" + } + ], + internalType: "struct Multicall3.Call3[]", + name: "calls", + type: "tuple[]" + } + ], + name: "aggregate3", + outputs: [ + { + components: [ + { + internalType: "bool", + name: "success", + type: "bool" + }, + { + internalType: "bytes", + name: "returnData", + type: "bytes" + } + ], + internalType: "struct Multicall3.Result[]", + name: "returnData", + type: "tuple[]" + } + ], + stateMutability: "payable", + type: "function" + }, + { + inputs: [ + { + components: [ + { + internalType: "address", + name: "target", + type: "address" + }, + { + internalType: "bool", + name: "allowFailure", + type: "bool" + }, + { + internalType: "uint256", + name: "value", + type: "uint256" + }, + { + internalType: "bytes", + name: "callData", + type: "bytes" + } + ], + internalType: "struct Multicall3.Call3Value[]", + name: "calls", + type: "tuple[]" + } + ], + name: "aggregate3Value", + outputs: [ + { + components: [ + { + internalType: "bool", + name: "success", + type: "bool" + }, + { + internalType: "bytes", + name: "returnData", + type: "bytes" + } + ], + internalType: "struct Multicall3.Result[]", + name: "returnData", + type: "tuple[]" + } + ], + stateMutability: "payable", + type: "function" + }, + { + inputs: [ + { + components: [ + { + internalType: "address", + name: "target", + type: "address" + }, + { + internalType: "bytes", + name: "callData", + type: "bytes" + } + ], + internalType: "struct Multicall3.Call[]", + name: "calls", + type: "tuple[]" + } + ], + name: "blockAndAggregate", + outputs: [ + { + internalType: "uint256", + name: "blockNumber", + type: "uint256" + }, + { + internalType: "bytes32", + name: "blockHash", + type: "bytes32" + }, + { + components: [ + { + internalType: "bool", + name: "success", + type: "bool" + }, + { + internalType: "bytes", + name: "returnData", + type: "bytes" + } + ], + internalType: "struct Multicall3.Result[]", + name: "returnData", + type: "tuple[]" + } + ], + stateMutability: "payable", + type: "function" + }, + { + inputs: [], + name: "getBasefee", + outputs: [ + { + internalType: "uint256", + name: "basefee", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "uint256", + name: "blockNumber", + type: "uint256" + } + ], + name: "getBlockHash", + outputs: [ + { + internalType: "bytes32", + name: "blockHash", + type: "bytes32" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "getBlockNumber", + outputs: [ + { + internalType: "uint256", + name: "blockNumber", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "getChainId", + outputs: [ + { + internalType: "uint256", + name: "chainid", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "getCurrentBlockCoinbase", + outputs: [ + { + internalType: "address", + name: "coinbase", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "getCurrentBlockDifficulty", + outputs: [ + { + internalType: "uint256", + name: "difficulty", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "getCurrentBlockGasLimit", + outputs: [ + { + internalType: "uint256", + name: "gaslimit", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "getCurrentBlockTimestamp", + outputs: [ + { + internalType: "uint256", + name: "timestamp", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "addr", + type: "address" + } + ], + name: "getEthBalance", + outputs: [ + { + internalType: "uint256", + name: "balance", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "getLastBlockHash", + outputs: [ + { + internalType: "bytes32", + name: "blockHash", + type: "bytes32" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bool", + name: "requireSuccess", + type: "bool" + }, + { + components: [ + { + internalType: "address", + name: "target", + type: "address" + }, + { + internalType: "bytes", + name: "callData", + type: "bytes" + } + ], + internalType: "struct Multicall3.Call[]", + name: "calls", + type: "tuple[]" + } + ], + name: "tryAggregate", + outputs: [ + { + components: [ + { + internalType: "bool", + name: "success", + type: "bool" + }, + { + internalType: "bytes", + name: "returnData", + type: "bytes" + } + ], + internalType: "struct Multicall3.Result[]", + name: "returnData", + type: "tuple[]" + } + ], + stateMutability: "payable", + type: "function" + }, + { + inputs: [ + { + internalType: "bool", + name: "requireSuccess", + type: "bool" + }, + { + components: [ + { + internalType: "address", + name: "target", + type: "address" + }, + { + internalType: "bytes", + name: "callData", + type: "bytes" + } + ], + internalType: "struct Multicall3.Call[]", + name: "calls", + type: "tuple[]" + } + ], + name: "tryBlockAndAggregate", + outputs: [ + { + internalType: "uint256", + name: "blockNumber", + type: "uint256" + }, + { + internalType: "bytes32", + name: "blockHash", + type: "bytes32" + }, + { + components: [ + { + internalType: "bool", + name: "success", + type: "bool" + }, + { + internalType: "bytes", + name: "returnData", + type: "bytes" + } + ], + internalType: "struct Multicall3.Result[]", + name: "returnData", + type: "tuple[]" + } + ], + stateMutability: "payable", + type: "function" + } +]; +var Multicall__factory = class { + static createInterface() { + return new Interface(_abi); + } + static connect(address, signerOrProvider) { + return new Contract(address, _abi, signerOrProvider); + } +}; +__publicField(Multicall__factory, "abi", _abi); +export { + Multicall__factory +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/NameWrapper__factory.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/NameWrapper__factory.mjs new file mode 100644 index 000000000..0e70e5b4a --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/NameWrapper__factory.mjs @@ -0,0 +1,1394 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; + +// src/generated/factories/NameWrapper__factory.ts +import { Interface } from "@ethersproject/abi/lib.esm/interface.js"; +import { Contract } from "@ethersproject/contracts"; +var _abi = [ + { + inputs: [ + { + internalType: "contract ENS", + name: "_ens", + type: "address" + }, + { + internalType: "contract IBaseRegistrar", + name: "_registrar", + type: "address" + }, + { + internalType: "contract IMetadataService", + name: "_metadataService", + type: "address" + } + ], + stateMutability: "nonpayable", + type: "constructor" + }, + { + inputs: [], + name: "CannotUpgrade", + type: "error" + }, + { + inputs: [], + name: "IncompatibleParent", + type: "error" + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address" + } + ], + name: "IncorrectTargetOwner", + type: "error" + }, + { + inputs: [], + name: "IncorrectTokenType", + type: "error" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "labelHash", + type: "bytes32" + }, + { + internalType: "bytes32", + name: "expectedLabelhash", + type: "bytes32" + } + ], + name: "LabelMismatch", + type: "error" + }, + { + inputs: [ + { + internalType: "string", + name: "label", + type: "string" + } + ], + name: "LabelTooLong", + type: "error" + }, + { + inputs: [], + name: "LabelTooShort", + type: "error" + }, + { + inputs: [], + name: "NameIsNotWrapped", + type: "error" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "OperationProhibited", + type: "error" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "address", + name: "addr", + type: "address" + } + ], + name: "Unauthorised", + type: "error" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "account", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address" + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool" + } + ], + name: "ApprovalForAll", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "controller", + type: "address" + }, + { + indexed: false, + internalType: "bool", + name: "active", + type: "bool" + } + ], + name: "ControllerChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "uint64", + name: "expiry", + type: "uint64" + } + ], + name: "ExpiryExtended", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "uint32", + name: "fuses", + type: "uint32" + } + ], + name: "FusesSet", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "address", + name: "owner", + type: "address" + } + ], + name: "NameUnwrapped", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + indexed: false, + internalType: "address", + name: "owner", + type: "address" + }, + { + indexed: false, + internalType: "uint32", + name: "fuses", + type: "uint32" + }, + { + indexed: false, + internalType: "uint64", + name: "expiry", + type: "uint64" + } + ], + name: "NameWrapped", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "previousOwner", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "newOwner", + type: "address" + } + ], + name: "OwnershipTransferred", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "operator", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "from", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address" + }, + { + indexed: false, + internalType: "uint256[]", + name: "ids", + type: "uint256[]" + }, + { + indexed: false, + internalType: "uint256[]", + name: "values", + type: "uint256[]" + } + ], + name: "TransferBatch", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "operator", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "from", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "to", + type: "address" + }, + { + indexed: false, + internalType: "uint256", + name: "id", + type: "uint256" + }, + { + indexed: false, + internalType: "uint256", + name: "value", + type: "uint256" + } + ], + name: "TransferSingle", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "string", + name: "value", + type: "string" + }, + { + indexed: true, + internalType: "uint256", + name: "id", + type: "uint256" + } + ], + name: "URI", + type: "event" + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + name: "_tokens", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "uint32", + name: "fuseMask", + type: "uint32" + } + ], + name: "allFusesBurned", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address" + }, + { + internalType: "uint256", + name: "id", + type: "uint256" + } + ], + name: "balanceOf", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address[]", + name: "accounts", + type: "address[]" + }, + { + internalType: "uint256[]", + name: "ids", + type: "uint256[]" + } + ], + name: "balanceOfBatch", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "address", + name: "addr", + type: "address" + } + ], + name: "canModifyName", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + name: "controllers", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "ens", + outputs: [ + { + internalType: "contract ENS", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "parentNode", + type: "bytes32" + }, + { + internalType: "bytes32", + name: "labelhash", + type: "bytes32" + }, + { + internalType: "uint64", + name: "expiry", + type: "uint64" + } + ], + name: "extendExpiry", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "uint256", + name: "id", + type: "uint256" + } + ], + name: "getData", + outputs: [ + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "uint32", + name: "fuses", + type: "uint32" + }, + { + internalType: "uint64", + name: "expiry", + type: "uint64" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address" + }, + { + internalType: "address", + name: "operator", + type: "address" + } + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "isWrapped", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "metadataService", + outputs: [ + { + internalType: "contract IMetadataService", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "name", + outputs: [ + { + internalType: "string", + name: "", + type: "string" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + name: "names", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "to", + type: "address" + }, + { + internalType: "address", + name: "", + type: "address" + }, + { + internalType: "uint256", + name: "tokenId", + type: "uint256" + }, + { + internalType: "bytes", + name: "data", + type: "bytes" + } + ], + name: "onERC721Received", + outputs: [ + { + internalType: "bytes4", + name: "", + type: "bytes4" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "uint256", + name: "id", + type: "uint256" + } + ], + name: "ownerOf", + outputs: [ + { + internalType: "address", + name: "owner", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "_token", + type: "address" + }, + { + internalType: "address", + name: "_to", + type: "address" + }, + { + internalType: "uint256", + name: "_amount", + type: "uint256" + } + ], + name: "recoverFunds", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "string", + name: "label", + type: "string" + }, + { + internalType: "address", + name: "wrappedOwner", + type: "address" + }, + { + internalType: "uint256", + name: "duration", + type: "uint256" + }, + { + internalType: "address", + name: "resolver", + type: "address" + }, + { + internalType: "uint16", + name: "ownerControlledFuses", + type: "uint16" + } + ], + name: "registerAndWrapETH2LD", + outputs: [ + { + internalType: "uint256", + name: "registrarExpiry", + type: "uint256" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [], + name: "registrar", + outputs: [ + { + internalType: "contract IBaseRegistrar", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256" + }, + { + internalType: "uint256", + name: "duration", + type: "uint256" + } + ], + name: "renew", + outputs: [ + { + internalType: "uint256", + name: "expires", + type: "uint256" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [], + name: "renounceOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address" + }, + { + internalType: "address", + name: "to", + type: "address" + }, + { + internalType: "uint256[]", + name: "ids", + type: "uint256[]" + }, + { + internalType: "uint256[]", + name: "amounts", + type: "uint256[]" + }, + { + internalType: "bytes", + name: "data", + type: "bytes" + } + ], + name: "safeBatchTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "from", + type: "address" + }, + { + internalType: "address", + name: "to", + type: "address" + }, + { + internalType: "uint256", + name: "id", + type: "uint256" + }, + { + internalType: "uint256", + name: "amount", + type: "uint256" + }, + { + internalType: "bytes", + name: "data", + type: "bytes" + } + ], + name: "safeTransferFrom", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address" + }, + { + internalType: "bool", + name: "approved", + type: "bool" + } + ], + name: "setApprovalForAll", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "parentNode", + type: "bytes32" + }, + { + internalType: "bytes32", + name: "labelhash", + type: "bytes32" + }, + { + internalType: "uint32", + name: "fuses", + type: "uint32" + }, + { + internalType: "uint64", + name: "expiry", + type: "uint64" + } + ], + name: "setChildFuses", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "controller", + type: "address" + }, + { + internalType: "bool", + name: "active", + type: "bool" + } + ], + name: "setController", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "uint16", + name: "ownerControlledFuses", + type: "uint16" + } + ], + name: "setFuses", + outputs: [ + { + internalType: "uint32", + name: "", + type: "uint32" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "contract IMetadataService", + name: "_metadataService", + type: "address" + } + ], + name: "setMetadataService", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "address", + name: "resolver", + type: "address" + }, + { + internalType: "uint64", + name: "ttl", + type: "uint64" + } + ], + name: "setRecord", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "address", + name: "resolver", + type: "address" + } + ], + name: "setResolver", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "parentNode", + type: "bytes32" + }, + { + internalType: "string", + name: "label", + type: "string" + }, + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "uint32", + name: "fuses", + type: "uint32" + }, + { + internalType: "uint64", + name: "expiry", + type: "uint64" + } + ], + name: "setSubnodeOwner", + outputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "parentNode", + type: "bytes32" + }, + { + internalType: "string", + name: "label", + type: "string" + }, + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "address", + name: "resolver", + type: "address" + }, + { + internalType: "uint64", + name: "ttl", + type: "uint64" + }, + { + internalType: "uint32", + name: "fuses", + type: "uint32" + }, + { + internalType: "uint64", + name: "expiry", + type: "uint64" + } + ], + name: "setSubnodeRecord", + outputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "uint64", + name: "ttl", + type: "uint64" + } + ], + name: "setTTL", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "contract INameWrapperUpgrade", + name: "_upgradeAddress", + type: "address" + } + ], + name: "setUpgradeContract", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes4", + name: "interfaceId", + type: "bytes4" + } + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address" + } + ], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "parentNode", + type: "bytes32" + }, + { + internalType: "bytes32", + name: "labelhash", + type: "bytes32" + }, + { + internalType: "address", + name: "controller", + type: "address" + } + ], + name: "unwrap", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "labelhash", + type: "bytes32" + }, + { + internalType: "address", + name: "registrant", + type: "address" + }, + { + internalType: "address", + name: "controller", + type: "address" + } + ], + name: "unwrapETH2LD", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "parentNode", + type: "bytes32" + }, + { + internalType: "string", + name: "label", + type: "string" + }, + { + internalType: "address", + name: "wrappedOwner", + type: "address" + }, + { + internalType: "address", + name: "resolver", + type: "address" + } + ], + name: "upgrade", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [], + name: "upgradeContract", + outputs: [ + { + internalType: "contract INameWrapperUpgrade", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "string", + name: "label", + type: "string" + }, + { + internalType: "address", + name: "wrappedOwner", + type: "address" + }, + { + internalType: "address", + name: "resolver", + type: "address" + } + ], + name: "upgradeETH2LD", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "uint256", + name: "tokenId", + type: "uint256" + } + ], + name: "uri", + outputs: [ + { + internalType: "string", + name: "", + type: "string" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + internalType: "address", + name: "wrappedOwner", + type: "address" + }, + { + internalType: "address", + name: "resolver", + type: "address" + } + ], + name: "wrap", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "string", + name: "label", + type: "string" + }, + { + internalType: "address", + name: "wrappedOwner", + type: "address" + }, + { + internalType: "uint16", + name: "ownerControlledFuses", + type: "uint16" + }, + { + internalType: "address", + name: "resolver", + type: "address" + } + ], + name: "wrapETH2LD", + outputs: [], + stateMutability: "nonpayable", + type: "function" + } +]; +var NameWrapper__factory = class { + static createInterface() { + return new Interface(_abi); + } + static connect(address, signerOrProvider) { + return new Contract(address, _abi, signerOrProvider); + } +}; +__publicField(NameWrapper__factory, "abi", _abi); +export { + NameWrapper__factory +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/P256SHA256Algorithm__factory.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/P256SHA256Algorithm__factory.mjs new file mode 100644 index 000000000..9aef1aea8 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/P256SHA256Algorithm__factory.mjs @@ -0,0 +1,53 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; + +// src/generated/factories/P256SHA256Algorithm__factory.ts +import { Interface } from "@ethersproject/abi/lib.esm/interface.js"; +import { Contract } from "@ethersproject/contracts"; +var _abi = [ + { + inputs: [ + { + internalType: "bytes", + name: "key", + type: "bytes" + }, + { + internalType: "bytes", + name: "data", + type: "bytes" + }, + { + internalType: "bytes", + name: "signature", + type: "bytes" + } + ], + name: "verify", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + } +]; +var P256SHA256Algorithm__factory = class { + static createInterface() { + return new Interface(_abi); + } + static connect(address, signerOrProvider) { + return new Contract(address, _abi, signerOrProvider); + } +}; +__publicField(P256SHA256Algorithm__factory, "abi", _abi); +export { + P256SHA256Algorithm__factory +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/PublicResolver__factory.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/PublicResolver__factory.mjs new file mode 100644 index 000000000..9f0e17c2a --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/PublicResolver__factory.mjs @@ -0,0 +1,1035 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; + +// src/generated/factories/PublicResolver__factory.ts +import { Interface } from "@ethersproject/abi/lib.esm/interface.js"; +import { Contract } from "@ethersproject/contracts"; +var _abi = [ + { + inputs: [ + { + internalType: "contract ENS", + name: "_ens", + type: "address" + }, + { + internalType: "contract INameWrapper", + name: "wrapperAddress", + type: "address" + }, + { + internalType: "address", + name: "_trustedETHController", + type: "address" + }, + { + internalType: "address", + name: "_trustedReverseRegistrar", + type: "address" + } + ], + stateMutability: "nonpayable", + type: "constructor" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: true, + internalType: "uint256", + name: "contentType", + type: "uint256" + } + ], + name: "ABIChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "address", + name: "a", + type: "address" + } + ], + name: "AddrChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "uint256", + name: "coinType", + type: "uint256" + }, + { + indexed: false, + internalType: "bytes", + name: "newAddress", + type: "bytes" + } + ], + name: "AddressChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "owner", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "operator", + type: "address" + }, + { + indexed: false, + internalType: "bool", + name: "approved", + type: "bool" + } + ], + name: "ApprovalForAll", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "owner", + type: "address" + }, + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: true, + internalType: "address", + name: "delegate", + type: "address" + }, + { + indexed: true, + internalType: "bool", + name: "approved", + type: "bool" + } + ], + name: "Approved", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "bytes", + name: "hash", + type: "bytes" + } + ], + name: "ContenthashChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + indexed: false, + internalType: "uint16", + name: "resource", + type: "uint16" + }, + { + indexed: false, + internalType: "bytes", + name: "record", + type: "bytes" + } + ], + name: "DNSRecordChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + indexed: false, + internalType: "uint16", + name: "resource", + type: "uint16" + } + ], + name: "DNSRecordDeleted", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "bytes", + name: "lastzonehash", + type: "bytes" + }, + { + indexed: false, + internalType: "bytes", + name: "zonehash", + type: "bytes" + } + ], + name: "DNSZonehashChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: true, + internalType: "bytes4", + name: "interfaceID", + type: "bytes4" + }, + { + indexed: false, + internalType: "address", + name: "implementer", + type: "address" + } + ], + name: "InterfaceChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "string", + name: "name", + type: "string" + } + ], + name: "NameChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "bytes32", + name: "x", + type: "bytes32" + }, + { + indexed: false, + internalType: "bytes32", + name: "y", + type: "bytes32" + } + ], + name: "PubkeyChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: true, + internalType: "string", + name: "indexedKey", + type: "string" + }, + { + indexed: false, + internalType: "string", + name: "key", + type: "string" + }, + { + indexed: false, + internalType: "string", + name: "value", + type: "string" + } + ], + name: "TextChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + indexed: false, + internalType: "uint64", + name: "newVersion", + type: "uint64" + } + ], + name: "VersionChanged", + type: "event" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "uint256", + name: "contentTypes", + type: "uint256" + } + ], + name: "ABI", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + }, + { + internalType: "bytes", + name: "", + type: "bytes" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "addr", + outputs: [ + { + internalType: "address payable", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "uint256", + name: "coinType", + type: "uint256" + } + ], + name: "addr", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "address", + name: "delegate", + type: "address" + }, + { + internalType: "bool", + name: "approved", + type: "bool" + } + ], + name: "approve", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "clearRecords", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "contenthash", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "bytes32", + name: "name", + type: "bytes32" + }, + { + internalType: "uint16", + name: "resource", + type: "uint16" + } + ], + name: "dnsRecord", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "bytes32", + name: "name", + type: "bytes32" + } + ], + name: "hasDNSRecords", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "bytes4", + name: "interfaceID", + type: "bytes4" + } + ], + name: "interfaceImplementer", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "address", + name: "delegate", + type: "address" + } + ], + name: "isApprovedFor", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "account", + type: "address" + }, + { + internalType: "address", + name: "operator", + type: "address" + } + ], + name: "isApprovedForAll", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes[]", + name: "data", + type: "bytes[]" + } + ], + name: "multicall", + outputs: [ + { + internalType: "bytes[]", + name: "results", + type: "bytes[]" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "nodehash", + type: "bytes32" + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]" + } + ], + name: "multicallWithNodeCheck", + outputs: [ + { + internalType: "bytes[]", + name: "results", + type: "bytes[]" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "name", + outputs: [ + { + internalType: "string", + name: "", + type: "string" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "pubkey", + outputs: [ + { + internalType: "bytes32", + name: "x", + type: "bytes32" + }, + { + internalType: "bytes32", + name: "y", + type: "bytes32" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + name: "recordVersions", + outputs: [ + { + internalType: "uint64", + name: "", + type: "uint64" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "uint256", + name: "contentType", + type: "uint256" + }, + { + internalType: "bytes", + name: "data", + type: "bytes" + } + ], + name: "setABI", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "uint256", + name: "coinType", + type: "uint256" + }, + { + internalType: "bytes", + name: "a", + type: "bytes" + } + ], + name: "setAddr", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "address", + name: "a", + type: "address" + } + ], + name: "setAddr", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "operator", + type: "address" + }, + { + internalType: "bool", + name: "approved", + type: "bool" + } + ], + name: "setApprovalForAll", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "bytes", + name: "hash", + type: "bytes" + } + ], + name: "setContenthash", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "bytes", + name: "data", + type: "bytes" + } + ], + name: "setDNSRecords", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "bytes4", + name: "interfaceID", + type: "bytes4" + }, + { + internalType: "address", + name: "implementer", + type: "address" + } + ], + name: "setInterface", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "string", + name: "newName", + type: "string" + } + ], + name: "setName", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "bytes32", + name: "x", + type: "bytes32" + }, + { + internalType: "bytes32", + name: "y", + type: "bytes32" + } + ], + name: "setPubkey", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "string", + name: "key", + type: "string" + }, + { + internalType: "string", + name: "value", + type: "string" + } + ], + name: "setText", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "bytes", + name: "hash", + type: "bytes" + } + ], + name: "setZonehash", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes4", + name: "interfaceID", + type: "bytes4" + } + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + }, + { + internalType: "string", + name: "key", + type: "string" + } + ], + name: "text", + outputs: [ + { + internalType: "string", + name: "", + type: "string" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "zonehash", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes" + } + ], + stateMutability: "view", + type: "function" + } +]; +var PublicResolver__factory = class { + static createInterface() { + return new Interface(_abi); + } + static connect(address, signerOrProvider) { + return new Contract(address, _abi, signerOrProvider); + } +}; +__publicField(PublicResolver__factory, "abi", _abi); +export { + PublicResolver__factory +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/RSASHA1Algorithm__factory.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/RSASHA1Algorithm__factory.mjs new file mode 100644 index 000000000..e85c60757 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/RSASHA1Algorithm__factory.mjs @@ -0,0 +1,53 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; + +// src/generated/factories/RSASHA1Algorithm__factory.ts +import { Interface } from "@ethersproject/abi/lib.esm/interface.js"; +import { Contract } from "@ethersproject/contracts"; +var _abi = [ + { + inputs: [ + { + internalType: "bytes", + name: "key", + type: "bytes" + }, + { + internalType: "bytes", + name: "data", + type: "bytes" + }, + { + internalType: "bytes", + name: "sig", + type: "bytes" + } + ], + name: "verify", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + } +]; +var RSASHA1Algorithm__factory = class { + static createInterface() { + return new Interface(_abi); + } + static connect(address, signerOrProvider) { + return new Contract(address, _abi, signerOrProvider); + } +}; +__publicField(RSASHA1Algorithm__factory, "abi", _abi); +export { + RSASHA1Algorithm__factory +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/RSASHA256Algorithm__factory.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/RSASHA256Algorithm__factory.mjs new file mode 100644 index 000000000..c678f241a --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/RSASHA256Algorithm__factory.mjs @@ -0,0 +1,53 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; + +// src/generated/factories/RSASHA256Algorithm__factory.ts +import { Interface } from "@ethersproject/abi/lib.esm/interface.js"; +import { Contract } from "@ethersproject/contracts"; +var _abi = [ + { + inputs: [ + { + internalType: "bytes", + name: "key", + type: "bytes" + }, + { + internalType: "bytes", + name: "data", + type: "bytes" + }, + { + internalType: "bytes", + name: "sig", + type: "bytes" + } + ], + name: "verify", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + } +]; +var RSASHA256Algorithm__factory = class { + static createInterface() { + return new Interface(_abi); + } + static connect(address, signerOrProvider) { + return new Contract(address, _abi, signerOrProvider); + } +}; +__publicField(RSASHA256Algorithm__factory, "abi", _abi); +export { + RSASHA256Algorithm__factory +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/ReverseRegistrar__factory.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/ReverseRegistrar__factory.mjs new file mode 100644 index 000000000..747888a27 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/ReverseRegistrar__factory.mjs @@ -0,0 +1,358 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; + +// src/generated/factories/ReverseRegistrar__factory.ts +import { Interface } from "@ethersproject/abi/lib.esm/interface.js"; +import { Contract } from "@ethersproject/contracts"; +var _abi = [ + { + inputs: [ + { + internalType: "contract ENS", + name: "ensAddr", + type: "address" + } + ], + stateMutability: "nonpayable", + type: "constructor" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "controller", + type: "address" + }, + { + indexed: false, + internalType: "bool", + name: "enabled", + type: "bool" + } + ], + name: "ControllerChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "contract NameResolver", + name: "resolver", + type: "address" + } + ], + name: "DefaultResolverChanged", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "previousOwner", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "newOwner", + type: "address" + } + ], + name: "OwnershipTransferred", + type: "event" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "addr", + type: "address" + }, + { + indexed: true, + internalType: "bytes32", + name: "node", + type: "bytes32" + } + ], + name: "ReverseClaimed", + type: "event" + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address" + } + ], + name: "claim", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "addr", + type: "address" + }, + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "address", + name: "resolver", + type: "address" + } + ], + name: "claimForAddr", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "address", + name: "resolver", + type: "address" + } + ], + name: "claimWithResolver", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + name: "controllers", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "defaultResolver", + outputs: [ + { + internalType: "contract NameResolver", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "ens", + outputs: [ + { + internalType: "contract ENS", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "addr", + type: "address" + } + ], + name: "node", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + stateMutability: "pure", + type: "function" + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "renounceOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "controller", + type: "address" + }, + { + internalType: "bool", + name: "enabled", + type: "bool" + } + ], + name: "setController", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "resolver", + type: "address" + } + ], + name: "setDefaultResolver", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "string", + name: "name", + type: "string" + } + ], + name: "setName", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "addr", + type: "address" + }, + { + internalType: "address", + name: "owner", + type: "address" + }, + { + internalType: "address", + name: "resolver", + type: "address" + }, + { + internalType: "string", + name: "name", + type: "string" + } + ], + name: "setNameForAddr", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address" + } + ], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function" + } +]; +var ReverseRegistrar__factory = class { + static createInterface() { + return new Interface(_abi); + } + static connect(address, signerOrProvider) { + return new Contract(address, _abi, signerOrProvider); + } +}; +__publicField(ReverseRegistrar__factory, "abi", _abi); +export { + ReverseRegistrar__factory +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/Root__factory.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/Root__factory.mjs new file mode 100644 index 000000000..4058f07c7 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/Root__factory.mjs @@ -0,0 +1,248 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; + +// src/generated/factories/Root__factory.ts +import { Interface } from "@ethersproject/abi/lib.esm/interface.js"; +import { Contract } from "@ethersproject/contracts"; +var _abi = [ + { + inputs: [ + { + internalType: "contract ENS", + name: "_ens", + type: "address" + } + ], + payable: false, + stateMutability: "nonpayable", + type: "constructor" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "bytes32", + name: "label", + type: "bytes32" + } + ], + name: "TLDLocked", + type: "event" + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + name: "controllers", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [], + name: "ens", + outputs: [ + { + internalType: "contract ENS", + name: "", + type: "address" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "address", + name: "addr", + type: "address" + } + ], + name: "isOwner", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "label", + type: "bytes32" + } + ], + name: "lock", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + name: "locked", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: true, + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + payable: false, + stateMutability: "view", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "controller", + type: "address" + }, + { + internalType: "bool", + name: "enabled", + type: "bool" + } + ], + name: "setController", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "resolver", + type: "address" + } + ], + name: "setResolver", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "bytes32", + name: "label", + type: "bytes32" + }, + { + internalType: "address", + name: "owner", + type: "address" + } + ], + name: "setSubnodeOwner", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + }, + { + constant: true, + inputs: [ + { + internalType: "bytes4", + name: "interfaceID", + type: "bytes4" + } + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + payable: false, + stateMutability: "pure", + type: "function" + }, + { + constant: false, + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address" + } + ], + name: "transferOwnership", + outputs: [], + payable: false, + stateMutability: "nonpayable", + type: "function" + } +]; +var Root__factory = class { + static createInterface() { + return new Interface(_abi); + } + static connect(address, signerOrProvider) { + return new Contract(address, _abi, signerOrProvider); + } +}; +__publicField(Root__factory, "abi", _abi); +export { + Root__factory +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/SHA1Digest__factory.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/SHA1Digest__factory.mjs new file mode 100644 index 000000000..881c6da99 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/SHA1Digest__factory.mjs @@ -0,0 +1,48 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; + +// src/generated/factories/SHA1Digest__factory.ts +import { Interface } from "@ethersproject/abi/lib.esm/interface.js"; +import { Contract } from "@ethersproject/contracts"; +var _abi = [ + { + inputs: [ + { + internalType: "bytes", + name: "data", + type: "bytes" + }, + { + internalType: "bytes", + name: "hash", + type: "bytes" + } + ], + name: "verify", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "pure", + type: "function" + } +]; +var SHA1Digest__factory = class { + static createInterface() { + return new Interface(_abi); + } + static connect(address, signerOrProvider) { + return new Contract(address, _abi, signerOrProvider); + } +}; +__publicField(SHA1Digest__factory, "abi", _abi); +export { + SHA1Digest__factory +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/SHA1NSEC3Digest__factory.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/SHA1NSEC3Digest__factory.mjs new file mode 100644 index 000000000..5696ce5cc --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/SHA1NSEC3Digest__factory.mjs @@ -0,0 +1,53 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; + +// src/generated/factories/SHA1NSEC3Digest__factory.ts +import { Interface } from "@ethersproject/abi/lib.esm/interface.js"; +import { Contract } from "@ethersproject/contracts"; +var _abi = [ + { + inputs: [ + { + internalType: "bytes", + name: "salt", + type: "bytes" + }, + { + internalType: "bytes", + name: "data", + type: "bytes" + }, + { + internalType: "uint256", + name: "iterations", + type: "uint256" + } + ], + name: "hash", + outputs: [ + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + stateMutability: "pure", + type: "function" + } +]; +var SHA1NSEC3Digest__factory = class { + static createInterface() { + return new Interface(_abi); + } + static connect(address, signerOrProvider) { + return new Contract(address, _abi, signerOrProvider); + } +}; +__publicField(SHA1NSEC3Digest__factory, "abi", _abi); +export { + SHA1NSEC3Digest__factory +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/SHA256Digest__factory.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/SHA256Digest__factory.mjs new file mode 100644 index 000000000..dbef30460 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/SHA256Digest__factory.mjs @@ -0,0 +1,48 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; + +// src/generated/factories/SHA256Digest__factory.ts +import { Interface } from "@ethersproject/abi/lib.esm/interface.js"; +import { Contract } from "@ethersproject/contracts"; +var _abi = [ + { + inputs: [ + { + internalType: "bytes", + name: "data", + type: "bytes" + }, + { + internalType: "bytes", + name: "hash", + type: "bytes" + } + ], + name: "verify", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "pure", + type: "function" + } +]; +var SHA256Digest__factory = class { + static createInterface() { + return new Interface(_abi); + } + static connect(address, signerOrProvider) { + return new Contract(address, _abi, signerOrProvider); + } +}; +__publicField(SHA256Digest__factory, "abi", _abi); +export { + SHA256Digest__factory +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/StaticMetadataService__factory.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/StaticMetadataService__factory.mjs new file mode 100644 index 000000000..58018cbfd --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/StaticMetadataService__factory.mjs @@ -0,0 +1,58 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; + +// src/generated/factories/StaticMetadataService__factory.ts +import { Interface } from "@ethersproject/abi/lib.esm/interface.js"; +import { Contract } from "@ethersproject/contracts"; +var _abi = [ + { + inputs: [ + { + internalType: "string", + name: "_metaDataUri", + type: "string" + } + ], + stateMutability: "nonpayable", + type: "constructor" + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + name: "uri", + outputs: [ + { + internalType: "string", + name: "", + type: "string" + } + ], + stateMutability: "view", + type: "function" + } +]; +var StaticMetadataService__factory = class { + static createInterface() { + return new Interface(_abi); + } + static connect(address, signerOrProvider) { + return new Contract( + address, + _abi, + signerOrProvider + ); + } +}; +__publicField(StaticMetadataService__factory, "abi", _abi); +export { + StaticMetadataService__factory +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/TLDPublicSuffixList__factory.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/TLDPublicSuffixList__factory.mjs new file mode 100644 index 000000000..ed0a9d8cc --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/TLDPublicSuffixList__factory.mjs @@ -0,0 +1,43 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; + +// src/generated/factories/TLDPublicSuffixList__factory.ts +import { Interface } from "@ethersproject/abi/lib.esm/interface.js"; +import { Contract } from "@ethersproject/contracts"; +var _abi = [ + { + inputs: [ + { + internalType: "bytes", + name: "name", + type: "bytes" + } + ], + name: "isPublicSuffix", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + } +]; +var TLDPublicSuffixList__factory = class { + static createInterface() { + return new Interface(_abi); + } + static connect(address, signerOrProvider) { + return new Contract(address, _abi, signerOrProvider); + } +}; +__publicField(TLDPublicSuffixList__factory, "abi", _abi); +export { + TLDPublicSuffixList__factory +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/UniversalResolver__factory.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/UniversalResolver__factory.mjs new file mode 100644 index 000000000..17600347b --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/UniversalResolver__factory.mjs @@ -0,0 +1,551 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; + +// src/generated/factories/UniversalResolver__factory.ts +import { Interface } from "@ethersproject/abi/lib.esm/interface.js"; +import { Contract } from "@ethersproject/contracts"; +var _abi = [ + { + inputs: [ + { + internalType: "address", + name: "_registry", + type: "address" + }, + { + internalType: "string[]", + name: "_urls", + type: "string[]" + } + ], + stateMutability: "nonpayable", + type: "constructor" + }, + { + inputs: [ + { + internalType: "address", + name: "sender", + type: "address" + }, + { + internalType: "string[]", + name: "urls", + type: "string[]" + }, + { + internalType: "bytes", + name: "callData", + type: "bytes" + }, + { + internalType: "bytes4", + name: "callbackFunction", + type: "bytes4" + }, + { + internalType: "bytes", + name: "extraData", + type: "bytes" + } + ], + name: "OffchainLookup", + type: "error" + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "previousOwner", + type: "address" + }, + { + indexed: true, + internalType: "address", + name: "newOwner", + type: "address" + } + ], + name: "OwnershipTransferred", + type: "event" + }, + { + inputs: [ + { + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + internalType: "bytes", + name: "data", + type: "bytes" + }, + { + internalType: "string[]", + name: "gateways", + type: "string[]" + }, + { + internalType: "bytes4", + name: "callbackFunction", + type: "bytes4" + }, + { + internalType: "bytes", + name: "metaData", + type: "bytes" + } + ], + name: "_resolveSingle", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes" + }, + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256" + } + ], + name: "batchGatewayURLs", + outputs: [ + { + internalType: "string", + name: "", + type: "string" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "name", + type: "bytes" + } + ], + name: "findResolver", + outputs: [ + { + internalType: "contract Resolver", + name: "", + type: "address" + }, + { + internalType: "bytes32", + name: "", + type: "bytes32" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "registry", + outputs: [ + { + internalType: "contract ENS", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [], + name: "renounceOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + internalType: "bytes", + name: "data", + type: "bytes" + }, + { + internalType: "string[]", + name: "gateways", + type: "string[]" + } + ], + name: "resolve", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes" + }, + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]" + } + ], + name: "resolve", + outputs: [ + { + internalType: "bytes[]", + name: "", + type: "bytes[]" + }, + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + internalType: "bytes[]", + name: "data", + type: "bytes[]" + }, + { + internalType: "string[]", + name: "gateways", + type: "string[]" + } + ], + name: "resolve", + outputs: [ + { + internalType: "bytes[]", + name: "", + type: "bytes[]" + }, + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "name", + type: "bytes" + }, + { + internalType: "bytes", + name: "data", + type: "bytes" + } + ], + name: "resolve", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes" + }, + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "response", + type: "bytes" + }, + { + internalType: "bytes", + name: "extraData", + type: "bytes" + } + ], + name: "resolveCallback", + outputs: [ + { + internalType: "bytes[]", + name: "", + type: "bytes[]" + }, + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "response", + type: "bytes" + }, + { + internalType: "bytes", + name: "extraData", + type: "bytes" + } + ], + name: "resolveSingleCallback", + outputs: [ + { + internalType: "bytes", + name: "", + type: "bytes" + }, + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "reverseName", + type: "bytes" + }, + { + internalType: "string[]", + name: "gateways", + type: "string[]" + } + ], + name: "reverse", + outputs: [ + { + internalType: "string", + name: "", + type: "string" + }, + { + internalType: "address", + name: "", + type: "address" + }, + { + internalType: "address", + name: "", + type: "address" + }, + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "reverseName", + type: "bytes" + } + ], + name: "reverse", + outputs: [ + { + internalType: "string", + name: "", + type: "string" + }, + { + internalType: "address", + name: "", + type: "address" + }, + { + internalType: "address", + name: "", + type: "address" + }, + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes", + name: "response", + type: "bytes" + }, + { + internalType: "bytes", + name: "extraData", + type: "bytes" + } + ], + name: "reverseCallback", + outputs: [ + { + internalType: "string", + name: "", + type: "string" + }, + { + internalType: "address", + name: "", + type: "address" + }, + { + internalType: "address", + name: "", + type: "address" + }, + { + internalType: "address", + name: "", + type: "address" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "string[]", + name: "_urls", + type: "string[]" + } + ], + name: "setGatewayURLs", + outputs: [], + stateMutability: "nonpayable", + type: "function" + }, + { + inputs: [ + { + internalType: "bytes4", + name: "interfaceId", + type: "bytes4" + } + ], + name: "supportsInterface", + outputs: [ + { + internalType: "bool", + name: "", + type: "bool" + } + ], + stateMutability: "view", + type: "function" + }, + { + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address" + } + ], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function" + } +]; +var UniversalResolver__factory = class { + static createInterface() { + return new Interface(_abi); + } + static connect(address, signerOrProvider) { + return new Contract(address, _abi, signerOrProvider); + } +}; +__publicField(UniversalResolver__factory, "abi", _abi); +export { + UniversalResolver__factory +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/index.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/index.mjs new file mode 100644 index 000000000..1880661d9 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/generated/factories/index.mjs @@ -0,0 +1,45 @@ +// src/generated/factories/index.ts +import { BaseRegistrarImplementation__factory } from "./BaseRegistrarImplementation__factory.mjs"; +import { BulkRenewal__factory } from "./BulkRenewal__factory.mjs"; +import { DNSRegistrar__factory } from "./DNSRegistrar__factory.mjs"; +import { DNSSECImpl__factory } from "./DNSSECImpl__factory.mjs"; +import { DefaultReverseResolver__factory } from "./DefaultReverseResolver__factory.mjs"; +import { ENSRegistry__factory } from "./ENSRegistry__factory.mjs"; +import { ETHRegistrarController__factory } from "./ETHRegistrarController__factory.mjs"; +import { Multicall__factory } from "./Multicall__factory.mjs"; +import { NameWrapper__factory } from "./NameWrapper__factory.mjs"; +import { P256SHA256Algorithm__factory } from "./P256SHA256Algorithm__factory.mjs"; +import { PublicResolver__factory } from "./PublicResolver__factory.mjs"; +import { RSASHA1Algorithm__factory } from "./RSASHA1Algorithm__factory.mjs"; +import { RSASHA256Algorithm__factory } from "./RSASHA256Algorithm__factory.mjs"; +import { ReverseRegistrar__factory } from "./ReverseRegistrar__factory.mjs"; +import { Root__factory } from "./Root__factory.mjs"; +import { SHA1Digest__factory } from "./SHA1Digest__factory.mjs"; +import { SHA1NSEC3Digest__factory } from "./SHA1NSEC3Digest__factory.mjs"; +import { SHA256Digest__factory } from "./SHA256Digest__factory.mjs"; +import { StaticMetadataService__factory } from "./StaticMetadataService__factory.mjs"; +import { TLDPublicSuffixList__factory } from "./TLDPublicSuffixList__factory.mjs"; +import { UniversalResolver__factory } from "./UniversalResolver__factory.mjs"; +export { + BaseRegistrarImplementation__factory, + BulkRenewal__factory, + DNSRegistrar__factory, + DNSSECImpl__factory, + DefaultReverseResolver__factory, + ENSRegistry__factory, + ETHRegistrarController__factory, + Multicall__factory, + NameWrapper__factory, + P256SHA256Algorithm__factory, + PublicResolver__factory, + RSASHA1Algorithm__factory, + RSASHA256Algorithm__factory, + ReverseRegistrar__factory, + Root__factory, + SHA1Digest__factory, + SHA1NSEC3Digest__factory, + SHA256Digest__factory, + StaticMetadataService__factory, + TLDPublicSuffixList__factory, + UniversalResolver__factory +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/generated/index.mjs b/.yalc/@ensdomains/ensjs/dist/esm/generated/index.mjs new file mode 100644 index 000000000..3331731da --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/generated/index.mjs @@ -0,0 +1,47 @@ +// src/generated/index.ts +import * as factories from "./factories.mjs"; +import { BaseRegistrarImplementation__factory } from "./factories/BaseRegistrarImplementation__factory.mjs"; +import { DefaultReverseResolver__factory } from "./factories/DefaultReverseResolver__factory.mjs"; +import { DNSRegistrar__factory } from "./factories/DNSRegistrar__factory.mjs"; +import { DNSSECImpl__factory } from "./factories/DNSSECImpl__factory.mjs"; +import { ENSRegistry__factory } from "./factories/ENSRegistry__factory.mjs"; +import { ETHRegistrarController__factory } from "./factories/ETHRegistrarController__factory.mjs"; +import { P256SHA256Algorithm__factory } from "./factories/P256SHA256Algorithm__factory.mjs"; +import { PublicResolver__factory } from "./factories/PublicResolver__factory.mjs"; +import { ReverseRegistrar__factory } from "./factories/ReverseRegistrar__factory.mjs"; +import { Root__factory } from "./factories/Root__factory.mjs"; +import { RSASHA1Algorithm__factory } from "./factories/RSASHA1Algorithm__factory.mjs"; +import { RSASHA256Algorithm__factory } from "./factories/RSASHA256Algorithm__factory.mjs"; +import { SHA1Digest__factory } from "./factories/SHA1Digest__factory.mjs"; +import { SHA1NSEC3Digest__factory } from "./factories/SHA1NSEC3Digest__factory.mjs"; +import { SHA256Digest__factory } from "./factories/SHA256Digest__factory.mjs"; +import { TLDPublicSuffixList__factory } from "./factories/TLDPublicSuffixList__factory.mjs"; +import { Multicall__factory } from "./factories/Multicall__factory.mjs"; +import { NameWrapper__factory } from "./factories/NameWrapper__factory.mjs"; +import { StaticMetadataService__factory } from "./factories/StaticMetadataService__factory.mjs"; +import { UniversalResolver__factory } from "./factories/UniversalResolver__factory.mjs"; +import { BulkRenewal__factory } from "./factories/BulkRenewal__factory.mjs"; +export { + BaseRegistrarImplementation__factory, + BulkRenewal__factory, + DNSRegistrar__factory, + DNSSECImpl__factory, + DefaultReverseResolver__factory, + ENSRegistry__factory, + ETHRegistrarController__factory, + Multicall__factory, + NameWrapper__factory, + P256SHA256Algorithm__factory, + PublicResolver__factory, + RSASHA1Algorithm__factory, + RSASHA256Algorithm__factory, + ReverseRegistrar__factory, + Root__factory, + SHA1Digest__factory, + SHA1NSEC3Digest__factory, + SHA256Digest__factory, + StaticMetadataService__factory, + TLDPublicSuffixList__factory, + UniversalResolver__factory, + factories +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/index.mjs b/.yalc/@ensdomains/ensjs/dist/esm/index.mjs new file mode 100644 index 000000000..bde1d2c25 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/index.mjs @@ -0,0 +1,310 @@ +// src/index.ts +import { getContractAddress as _getContractAddress } from "./contracts/getContractAddress.mjs"; +import ContractManager from "./contracts/index.mjs"; +import GqlManager from "./GqlManager.mjs"; +import singleCall from "./utils/singleCall.mjs"; +import writeTx from "./utils/writeTx.mjs"; +var graphURIEndpoints = { + 1: "https://api.thegraph.com/subgraphs/name/ensdomains/ens", + 3: "https://api.thegraph.com/subgraphs/name/ensdomains/ensropsten", + 4: "https://api.thegraph.com/subgraphs/name/ensdomains/ensrinkeby", + 5: "https://api.thegraph.com/subgraphs/name/ensdomains/ensgoerli" +}; +var ENS = class { + options; + provider; + graphURI; + initialProvider; + contracts; + getContractAddress = _getContractAddress; + gqlInstance = new GqlManager(); + constructor(options) { + this.options = options; + this.getContractAddress = options?.getContractAddress || _getContractAddress; + } + checkInitialProvider = async () => { + if (!this.initialProvider) { + return; + } + await this.setProvider(this.initialProvider); + }; + forwardDependenciesFromArray = (dependencies) => Object.fromEntries( + dependencies.map((dep) => [dep, this[dep]]) + ); + getModule = async (path, exportName) => { + let mod = await import( + /* webpackMode: "lazy", webpackChunkName: "[request]", webpackPreload: true, webpackExclude: /.*\.ts$/ */ + `./functions/${path}` + ); + if (mod.default?.[exportName]) { + mod = mod.default; + } + return mod; + }; + getFunction = (subFunc, writeable, exportName, mod, _path) => subFunc && !writeable ? mod[exportName][subFunc] : mod[exportName]; + importGenerator = (path, dependencies, exportName = "default", subFunc, passthrough) => { + if (subFunc === "batch") { + return (...args) => ({ args, ...passthrough }); + } + const thisRef = this; + const mainFunc = async function(...args) { + await thisRef.checkInitialProvider(); + const mod = await thisRef.getModule(path, exportName); + if (subFunc !== "combine") { + const writeable = subFunc === "write" || subFunc === "populateTransaction"; + const func = thisRef.getFunction( + subFunc, + writeable, + exportName, + mod, + path + ); + let dependenciesToForward2 = thisRef.forwardDependenciesFromArray(dependencies); + if (writeable) { + const options = args[1] || {}; + const signer = options.signer || thisRef.provider?.getSigner(options.addressOrIndex); + const populate = subFunc === "populateTransaction"; + if (!signer) { + throw new Error("No signer specified"); + } + delete options.addressOrIndex; + delete options.signer; + dependenciesToForward2 = { ...dependenciesToForward2, signer }; + return func(dependenciesToForward2, args[0], options).then( + writeTx(signer, populate) + ); + } + return func(dependenciesToForward2, ...args); + } + const dependenciesToForward = thisRef.forwardDependenciesFromArray(dependencies); + return singleCall( + thisRef.provider, + dependenciesToForward, + thisRef.getFunction(void 0, void 0, exportName, mod, path), + ...args + ); + }; + if (subFunc === "combine") { + mainFunc.raw = this.importGenerator( + path, + dependencies, + exportName, + "raw" + ); + mainFunc.decode = this.importGenerator( + path, + dependencies, + exportName, + "decode" + ); + mainFunc.batch = this.importGenerator( + path, + dependencies, + exportName, + "batch", + { raw: mainFunc.raw, decode: mainFunc.decode } + ); + } else if (subFunc === "write") { + mainFunc.populateTransaction = this.importGenerator( + path, + dependencies, + exportName, + "populateTransaction" + ); + } + return mainFunc; + }; + generateFunction = (path, dependencies, exportName = "default") => this.importGenerator(path, dependencies, exportName); + generateWriteFunction = (path, dependencies, exportName = "default") => this.importGenerator( + path, + dependencies, + exportName, + "write" + ); + generateRawFunction = (path, dependencies, exportName = "default") => this.importGenerator( + path, + dependencies, + exportName, + "combine" + ); + setProvider = async (provider) => { + this.provider = provider; + const network = this.staticNetwork ? this.provider._network.chainId : (await this.provider.getNetwork()).chainId; + if (this.options && this.options.graphURI) { + this.graphURI = this.options.graphURI; + } else { + this.graphURI = graphURIEndpoints[network]; + } + await this.gqlInstance.setUrl(this.graphURI); + this.contracts = new ContractManager( + this.provider, + this.getContractAddress(String(network)) + ); + }; + withProvider = (provider) => { + const newENS = new ENS(this.options); + newENS.initialProvider = provider; + return newENS; + }; + batch = this.generateRawFunction( + "initialGetters", + ["multicallWrapper"], + "batch" + ); + getProfile = this.generateFunction( + "initialGetters", + [ + "contracts", + "gqlInstance", + "getName", + "resolverMulticallWrapper", + "multicallWrapper", + "_getAddr", + "_getContentHash", + "_getText" + ], + "getProfile" + ); + getRecords = this.generateFunction( + "initialGetters", + ["getProfile"], + "getRecords" + ); + getName = this.generateRawFunction( + "initialGetters", + ["contracts"], + "getName" + ); + getResolver = this.generateRawFunction( + "getResolver", + ["contracts"] + ); + getWrapperData = this.generateRawFunction("getWrapperData", ["contracts"]); + getHistory = this.generateFunction( + "getHistory", + ["gqlInstance"], + "getHistory" + ); + getContentHash = this.generateRawFunction("initialGetters", ["contracts", "universalWrapper"], "getContentHash"); + _getContentHash = this.generateRawFunction("initialGetters", ["contracts"], "_getContentHash"); + getAddr = this.generateRawFunction( + "initialGetters", + ["contracts", "universalWrapper"], + "getAddr" + ); + _getAddr = this.generateRawFunction( + "initialGetters", + ["contracts"], + "_getAddr" + ); + getText = this.generateRawFunction( + "initialGetters", + ["contracts", "universalWrapper"], + "getText" + ); + _getText = this.generateRawFunction( + "initialGetters", + ["contracts"], + "_getText" + ); + getABI = this.generateRawFunction( + "initialGetters", + ["contracts", "universalWrapper"], + "getABI" + ); + _getABI = this.generateRawFunction( + "initialGetters", + ["contracts"], + "_getABI" + ); + getOwner = this.generateRawFunction( + "initialGetters", + ["contracts", "multicallWrapper", "gqlInstance"], + "getOwner" + ); + getExpiry = this.generateRawFunction( + "initialGetters", + ["contracts", "multicallWrapper"], + "getExpiry" + ); + getSubnames = this.generateFunction( + "initialGetters", + ["gqlInstance"], + "getSubnames" + ); + getNames = this.generateFunction( + "initialGetters", + ["gqlInstance"], + "getNames" + ); + getPrice = this.generateRawFunction( + "initialGetters", + ["contracts", "multicallWrapper"], + "getPrice" + ); + getDNSOwner = this.generateFunction( + "getDNSOwner", + [] + ); + supportsTLD = this.generateFunction( + "initialGetters", + ["getOwner", "provider"], + "supportsTLD" + ); + getAvailable = this.generateRawFunction( + "getAvailable", + ["contracts"] + ); + universalWrapper = this.generateRawFunction("initialGetters", ["contracts"], "universalWrapper"); + resolverMulticallWrapper = this.generateRawFunction("initialGetters", ["contracts"], "resolverMulticallWrapper"); + multicallWrapper = this.generateRawFunction("initialGetters", ["contracts"], "multicallWrapper"); + setName = this.generateWriteFunction( + "setName", + ["contracts"] + ); + setRecords = this.generateWriteFunction( + "setRecords", + ["contracts", "provider", "getResolver"] + ); + setRecord = this.generateWriteFunction( + "setRecord", + ["contracts", "provider", "getResolver"] + ); + setResolver = this.generateWriteFunction( + "setResolver", + ["contracts"] + ); + transferName = this.generateWriteFunction("transferName", ["contracts"]); + transferController = this.generateWriteFunction("transferController", ["contracts"]); + wrapName = this.generateWriteFunction( + "wrapName", + ["contracts"] + ); + unwrapName = this.generateWriteFunction( + "unwrapName", + ["contracts"] + ); + setFuses = this.generateWriteFunction( + "setFuses", + ["contracts"] + ); + setChildFuses = this.generateWriteFunction("setFuses", ["contracts"], "setChildFuses"); + importDNSSECName = this.generateWriteFunction("importDNSSECName", ["contracts", "provider", "signer"]); + createSubname = this.generateWriteFunction("createSubname", ["contracts", "getExpiry"]); + deleteSubname = this.generateWriteFunction("deleteSubname", ["contracts"]); + transferSubname = this.generateWriteFunction("transferSubname", ["contracts", "getExpiry"]); + commitName = this.generateWriteFunction( + "commitName", + ["contracts"] + ); + registerName = this.generateWriteFunction("registerName", ["contracts"]); + renewNames = this.generateWriteFunction( + "renewNames", + ["contracts"] + ); + extendWrappedName = this.generateWriteFunction("renewNames", ["contracts"], "extendWrappedName"); +}; +export { + ENS, + graphURIEndpoints +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/static.mjs b/.yalc/@ensdomains/ensjs/dist/esm/static.mjs new file mode 100644 index 000000000..316c34bfa --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/static.mjs @@ -0,0 +1,62 @@ +// src/static.ts +import { gql, GraphQLClient } from "graphql-request"; +import { parse, print, visit } from "graphql/language"; +import traverse from "traverse"; +import ContractManager from "./contracts/index.mjs"; +import { ENS, graphURIEndpoints } from "./index.mjs"; +import { requestMiddleware, responseMiddleware } from "./GqlManager.mjs"; +var StaticENS = class extends ENS { + functions; + contractsObject; + gqlInstance = { + client: { request: () => Promise.resolve(null) }, + setUrl: () => Promise.resolve(), + gql: (query) => query.join() + }; + constructor(provider, { functions, contracts, ...options }) { + super(options); + this.functions = functions; + this.contractsObject = contracts; + this.setStaticProvider(provider); + } + setStaticProvider = (provider) => { + this.provider = provider; + const network = provider.network.chainId; + if (this.options && this.options.graphURI) { + this.graphURI = this.options.graphURI; + } else { + this.graphURI = graphURIEndpoints[network]; + } + if (this.graphURI) { + const client = new GraphQLClient(this.graphURI, { + requestMiddleware: requestMiddleware(visit, parse, print), + responseMiddleware: responseMiddleware(traverse) + }); + this.gqlInstance = { + client, + setUrl: () => Promise.resolve(), + gql + }; + } + this.contracts = new ContractManager( + provider, + this.getContractAddress(String(network)), + (name) => Promise.resolve(this.contractsObject[name]) + ); + }; + setProvider = async (provider) => { + this.setStaticProvider(provider); + }; + getModule = async () => this.functions; + getFunction = (subFunc, _writeable, exportName, mod, path) => { + const base = mod[exportName === "default" ? path : exportName]; + if (subFunc === "raw" || subFunc === "decode") { + return base[subFunc]; + } + return base; + }; +}; +var static_default = StaticENS; +export { + static_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/utils/ccip.mjs b/.yalc/@ensdomains/ensjs/dist/esm/utils/ccip.mjs new file mode 100644 index 000000000..6c377267d --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/utils/ccip.mjs @@ -0,0 +1,114 @@ +// src/utils/ccip.ts +import { BigNumber } from "@ethersproject/bignumber/lib.esm/bignumber.js"; +import { + arrayify, + hexConcat, + hexDataSlice +} from "@ethersproject/bytes"; +import { toUtf8String } from "@ethersproject/strings/lib.esm/utf8.js"; +function bytesPad(value) { + if (value.length % 32 === 0) { + return value; + } + const result = new Uint8Array(Math.ceil(value.length / 32) * 32); + result.set(value); + return result; +} +function numPad(value) { + const result = arrayify(value); + if (result.length > 32) { + throw new Error("internal; should not happen"); + } + const padded = new Uint8Array(32); + padded.set(result, 32 - result.length); + return padded; +} +function encodeBytes(datas) { + const result = []; + let byteCount = 0; + for (let i = 0; i < datas.length; i += 1) { + result.push(new Uint8Array(0)); + byteCount += 32; + } + for (let i = 0; i < datas.length; i += 1) { + const data = arrayify(datas[i]); + result[i] = numPad(byteCount); + result.push(numPad(data.length)); + result.push(bytesPad(data)); + byteCount += 32 + Math.ceil(data.length / 32) * 32; + } + return hexConcat(result); +} +function _parseBytes(result, start) { + if (result === "0x") { + return null; + } + const offset = BigNumber.from( + hexDataSlice(result, start, start + 32) + ).toNumber(); + const length = BigNumber.from( + hexDataSlice(result, offset, offset + 32) + ).toNumber(); + return hexDataSlice(result, offset + 32, offset + 32 + length); +} +function _parseString(result, start) { + try { + const bytes = _parseBytes(result, start); + if (bytes == null) + return null; + return toUtf8String(bytes); + } catch (error) { + } + return null; +} +var ccipLookup = async (provider, transaction, result) => { + const txSender = transaction.to; + try { + const data = hexDataSlice(result, 4); + const sender = hexDataSlice(data, 0, 32); + if (!BigNumber.from(sender).eq(txSender)) { + throw new Error("CCIP Read sender did not match"); + } + const urls = []; + const urlsOffset = BigNumber.from(hexDataSlice(data, 32, 64)).toNumber(); + const urlsLength = BigNumber.from( + hexDataSlice(data, urlsOffset, urlsOffset + 32) + ).toNumber(); + const urlsData = hexDataSlice(data, urlsOffset + 32); + for (let u = 0; u < urlsLength; u += 1) { + const url = _parseString(urlsData, u * 32); + if (url == null) { + throw new Error("CCIP Read contained corrupt URL string"); + } + urls.push(url); + } + const calldata = _parseBytes(data, 64); + if (!BigNumber.from(hexDataSlice(data, 100, 128)).isZero()) { + throw new Error("CCIP Read callback selected included junk"); + } + const callbackSelector = hexDataSlice(data, 96, 100); + const extraData = _parseBytes(data, 128); + const ccipResult = await provider.ccipReadFetch( + transaction, + calldata, + urls + ); + if (ccipResult == null) { + throw new Error("CCIP Read disabled or provided no URLs"); + } + const tx = { + to: sender, + data: hexConcat([ + callbackSelector, + encodeBytes([ccipResult, extraData]) + ]) + }; + return await provider._call(tx, "latest", 1); + } catch (error) { + console.error(error); + } +}; +var ccip_default = ccipLookup; +export { + ccip_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/utils/consts.mjs b/.yalc/@ensdomains/ensjs/dist/esm/utils/consts.mjs new file mode 100644 index 000000000..c90a877a9 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/utils/consts.mjs @@ -0,0 +1,7 @@ +// src/utils/consts.ts +var EMPTY_ADDRESS = "0x0000000000000000000000000000000000000000"; +var MAX_INT_64 = 2n ** 64n - 1n; +export { + EMPTY_ADDRESS, + MAX_INT_64 +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/utils/contentHash.mjs b/.yalc/@ensdomains/ensjs/dist/esm/utils/contentHash.mjs new file mode 100644 index 000000000..3cc4b20c2 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/utils/contentHash.mjs @@ -0,0 +1,142 @@ +// src/utils/contentHash.ts +import contentHash from "@ensdomains/content-hash"; +import { isHexString } from "@ethersproject/bytes"; +var supportedCodecs = [ + "ipns-ns", + "ipfs-ns", + "swarm-ns", + "onion", + "onion3", + "skynet-ns", + "arweave-ns" +]; +function matchProtocol(text) { + return text.match(/^(ipfs|sia|ipns|bzz|onion|onion3|arweave|ar):\/\/(.*)/) || text.match(/\/(ipfs)\/(.*)/) || text.match(/\/(ipns)\/(.*)/); +} +function decodeContenthash(encoded) { + let decoded; + let protocolType; + let error; + if (!encoded || encoded === "0x") { + return {}; + } + if (encoded.error) { + return { protocolType: null, decoded: encoded.error }; + } + if (encoded === false) { + return { protocolType: null, decoded: "invalid value" }; + } + if (encoded) { + try { + decoded = contentHash.decode(encoded); + const codec = contentHash.getCodec(encoded); + if (codec === "ipfs-ns") { + protocolType = "ipfs"; + } else if (codec === "ipns-ns") { + protocolType = "ipns"; + } else if (codec === "swarm-ns") { + protocolType = "bzz"; + } else if (codec === "onion") { + protocolType = "onion"; + } else if (codec === "onion3") { + protocolType = "onion3"; + } else if (codec === "skynet-ns") { + protocolType = "sia"; + } else if (codec === "arweave-ns") { + protocolType = "ar"; + } else { + decoded = encoded; + } + } catch (e) { + error = e.message; + } + } + return { protocolType, decoded, error }; +} +function validateContent(encoded) { + return contentHash.isHashOfType(encoded, contentHash.Types.ipfs) || contentHash.isHashOfType(encoded, contentHash.Types.swarm); +} +function isValidContenthash(encoded) { + try { + const codec = contentHash.getCodec(encoded); + return isHexString(encoded) && supportedCodecs.includes(codec); + } catch (e) { + console.log(e); + } +} +function getProtocolType(encoded) { + let protocolType; + let decoded; + try { + const matched = matchProtocol(encoded); + if (matched) { + ; + [, protocolType, decoded] = matched; + } + return { + protocolType, + decoded + }; + } catch (e) { + console.log(e); + } +} +function encodeContenthash(text) { + let content = text; + let contentType; + let encoded = false; + let error; + if (text) { + const matched = matchProtocol(text); + if (matched) { + ; + [, contentType, content] = matched; + } + try { + if (contentType === "ipfs") { + if (content.length >= 4) { + encoded = `0x${contentHash.encode("ipfs-ns", content)}`; + } + } else if (contentType === "ipns") { + encoded = `0x${contentHash.encode("ipns-ns", content)}`; + } else if (contentType === "bzz") { + if (content.length >= 4) { + encoded = `0x${contentHash.fromSwarm(content)}`; + } + } else if (contentType === "onion") { + if (content.length === 16) { + encoded = `0x${contentHash.encode("onion", content)}`; + } + } else if (contentType === "onion3") { + if (content.length === 56) { + encoded = `0x${contentHash.encode("onion3", content)}`; + } + } else if (contentType === "sia") { + if (content.length === 46) { + encoded = `0x${contentHash.encode("skynet-ns", content)}`; + } + } else if (contentType === "arweave" || contentType === "ar") { + if (content.length === 43) { + encoded = `0x${contentHash.encode("arweave-ns", content)}`; + } + } else { + console.warn("Unsupported protocol or invalid value", { + contentType, + text + }); + } + } catch (err) { + const errorMessage = "Error encoding content hash"; + console.warn(errorMessage, { text, encoded }); + error = errorMessage; + } + } + return { encoded, error }; +} +export { + decodeContenthash, + encodeContenthash, + getProtocolType, + isValidContenthash, + validateContent +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/utils/createReverseNode.mjs b/.yalc/@ensdomains/ensjs/dist/esm/utils/createReverseNode.mjs new file mode 100644 index 000000000..d2413a93c --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/utils/createReverseNode.mjs @@ -0,0 +1,5 @@ +// src/utils/createReverseNode.ts +var createReverseNode_default = (address) => `${address.toLowerCase().substring(2)}.addr.reverse`; +export { + createReverseNode_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/utils/format.mjs b/.yalc/@ensdomains/ensjs/dist/esm/utils/format.mjs new file mode 100644 index 000000000..85f97bdec --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/utils/format.mjs @@ -0,0 +1,9 @@ +// src/utils/format.ts +var formatHashed = (name) => name.replace(/(\[)(.{64})(\])/g, "0x$2"); +var truncateFormat = (name) => name.replace(/(\[.{3})(.{58})(.{3}\])/g, "$1...$3"); +var bracketFormat = (name) => name.replace(/(0x)(.{64})(?=\.)/g, "[$2]"); +export { + bracketFormat, + formatHashed, + truncateFormat +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/utils/fuses.mjs b/.yalc/@ensdomains/ensjs/dist/esm/utils/fuses.mjs new file mode 100644 index 000000000..fe34e0ec6 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/utils/fuses.mjs @@ -0,0 +1,250 @@ +// src/utils/fuses.ts +var CANNOT_UNWRAP = 1; +var CANNOT_BURN_FUSES = 2; +var CANNOT_TRANSFER = 4; +var CANNOT_SET_RESOLVER = 8; +var CANNOT_SET_TTL = 16; +var CANNOT_CREATE_SUBDOMAIN = 32; +var PARENT_CANNOT_CONTROL = 65536; +var IS_DOT_ETH = 131072; +var CAN_EXTEND_EXPIRY = 262144; +var CHILD_CONTROLLED_FUSES = 65535; +var PARENT_CONTROLLED_FUSES = 4294901760; +var USER_SETTABLE_FUSES = 4294836223; +var CAN_DO_EVERYTHING = 0; +var childFuseEnum = { + CANNOT_UNWRAP, + CANNOT_BURN_FUSES, + CANNOT_TRANSFER, + CANNOT_SET_RESOLVER, + CANNOT_SET_TTL, + CANNOT_CREATE_SUBDOMAIN +}; +var parentFuseEnum = { + PARENT_CANNOT_CONTROL, + CAN_EXTEND_EXPIRY +}; +var fullParentFuseEnum = { + ...parentFuseEnum, + IS_DOT_ETH +}; +var userSettableFuseEnum = { + ...childFuseEnum, + ...parentFuseEnum +}; +var fullFuseEnum = { + ...userSettableFuseEnum, + CAN_DO_EVERYTHING +}; +var unnamedChildFuses = [ + 64, + 128, + 256, + 512, + 1024, + 2048, + 4096, + 8192, + 16384, + 32768 +]; +var unnamedParentFuses = [ + 524288, + 1048576, + 2097152, + 4194304, + 8388608, + 16777216, + 33554432, + 67108864, + 134217728, + 268435456, + 536870912, + 1073741824, + 2147483648 +]; +var unnamedUserSettableFuses = [ + ...unnamedChildFuses, + ...unnamedParentFuses +]; +var childFuseKeys = Object.keys( + childFuseEnum +); +var parentFuseKeys = Object.keys( + parentFuseEnum +); +var fullParentFuseKeys = Object.keys( + fullParentFuseEnum +); +var userSettableFuseKeys = Object.keys( + userSettableFuseEnum +); +var checkNumber = (fuses) => { + if (fuses > 2 ** 32 || fuses < 1) { + throw new Error( + `Fuse number must be limited to uint32, ${fuses} was too ${fuses < 1 ? "low" : "high"}.` + ); + } else if (fuses % 1 !== 0) { + throw new Error(`Fuse number must be an integer, ${fuses} was not.`); + } else if ((fuses & USER_SETTABLE_FUSES) !== fuses) { + throw new Error( + `Fuse number must be limited to user settable fuses, ${fuses} was not.` + ); + } +}; +function encodeFuses(fuses, restrictTo) { + let encodedFuses = 0; + if (typeof fuses === "number") { + if (restrictTo) { + throw new Error("Cannot specify an exact fuse value when restricted."); + } + checkNumber(fuses); + encodedFuses = fuses; + } else { + let fusesRef = fuses; + let allowedNamed = []; + let allowedUnnamed = []; + let namedArray = []; + let unnamedArray = []; + if (restrictTo) { + if ("parent" in fuses || "child" in fuses) { + throw new Error("Can't specify fuse category when restricted."); + } + allowedNamed = restrictTo === "child" ? childFuseKeys : parentFuseKeys; + allowedUnnamed = restrictTo === "child" ? unnamedChildFuses : unnamedParentFuses; + fusesRef = { [restrictTo]: fuses }; + } else { + allowedNamed = userSettableFuseKeys; + allowedUnnamed = unnamedUserSettableFuses; + } + if ("parent" in fusesRef) { + if ("named" in fusesRef.parent) + namedArray = fusesRef.parent.named; + if ("unnamed" in fusesRef.parent) + unnamedArray = fusesRef.parent.unnamed; + if ("number" in fusesRef.parent) { + if ("named" in fusesRef.parent || "unnamed" in fusesRef.parent) { + throw new Error( + "Cannot specify both a fuse number and named/unnamed fuses." + ); + } + checkNumber(fusesRef.parent.number); + if ((fusesRef.parent.number & PARENT_CONTROLLED_FUSES) !== fusesRef.parent.number) { + throw new Error( + "Cannot specify a fuse value to set that is outside of the parent's control." + ); + } + encodedFuses |= fusesRef.parent.number; + } + } + if ("child" in fusesRef) { + if ("named" in fusesRef.child) + namedArray = [...namedArray, ...fusesRef.child.named]; + if ("unnamed" in fusesRef.child) + unnamedArray = [...unnamedArray, ...fusesRef.child.unnamed]; + if ("number" in fusesRef.child) { + if ("named" in fusesRef.child || "unnamed" in fusesRef.child) { + throw new Error( + "Cannot specify both a fuse number and named/unnamed fuses." + ); + } + checkNumber(fusesRef.child.number); + if ((fusesRef.child.number & CHILD_CONTROLLED_FUSES) !== fusesRef.child.number) { + throw new Error( + "Cannot specify a fuse value to set that is outside of the owner's control." + ); + } + encodedFuses |= fusesRef.child.number; + } + } + if (!namedArray.length && !unnamedArray.length && !encodedFuses) { + throw new Error("Must specify at least one fuse."); + } + for (const fuse of namedArray) { + if (!allowedNamed.includes(fuse)) { + if (!userSettableFuseKeys.includes(fuse)) { + throw new Error(`${fuse} is not a valid named fuse.`); + } + throw new Error(`Fuse ${fuse} is not allowed for this operation.`); + } + encodedFuses |= userSettableFuseEnum[fuse]; + } + for (const fuse of unnamedArray) { + if (!allowedUnnamed.includes(fuse)) { + if (!unnamedUserSettableFuses.includes(fuse)) { + throw new Error( + `${fuse} is not a valid unnamed fuse. If you are trying to set a named fuse, use the named property.` + ); + } + throw new Error(`Fuse ${fuse} is not allowed for this operation.`); + } + encodedFuses |= fuse; + } + } + return encodedFuses; +} +var decodeNamedFuses = (fuses, arr) => { + const fuseObj = Object.fromEntries( + arr.map((fuse) => [ + fuse, + (fuses & userSettableFuseEnum[fuse]) > 0 + ]) + ); + return fuseObj; +}; +var decodeUnnamedFuses = (fuses, arr) => { + const fuseObj = Object.fromEntries( + arr.map((fuse) => [fuse, (fuses & fuse) > 0]) + ); + return fuseObj; +}; +var decodeFuses = (fuses) => { + const parentNamedFuses = decodeNamedFuses( + fuses, + fullParentFuseKeys + ); + const parentUnnamedFuses = decodeUnnamedFuses( + fuses, + unnamedParentFuses + ); + const childNamedFuses = decodeNamedFuses( + fuses, + childFuseKeys + ); + const childUnnamedFuses = decodeUnnamedFuses( + fuses, + unnamedChildFuses + ); + return { + parent: { + ...parentNamedFuses, + unnamed: parentUnnamedFuses + }, + child: { + ...childNamedFuses, + CAN_DO_EVERYTHING: (fuses & CHILD_CONTROLLED_FUSES) === 0, + unnamed: childUnnamedFuses + } + }; +}; +var fuses_default = fullFuseEnum; +export { + CHILD_CONTROLLED_FUSES, + PARENT_CONTROLLED_FUSES, + USER_SETTABLE_FUSES, + childFuseEnum, + childFuseKeys, + decodeFuses, + fuses_default as default, + encodeFuses, + fullFuseEnum, + fullParentFuseEnum, + fullParentFuseKeys, + parentFuseEnum, + parentFuseKeys, + unnamedChildFuses, + unnamedParentFuses, + unnamedUserSettableFuses, + userSettableFuseEnum, + userSettableFuseKeys +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/utils/hexEncodedName.mjs b/.yalc/@ensdomains/ensjs/dist/esm/utils/hexEncodedName.mjs new file mode 100644 index 000000000..f7ee95ce7 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/utils/hexEncodedName.mjs @@ -0,0 +1,6 @@ +// src/utils/hexEncodedName.ts +import packet from "dns-packet"; +var hexEncodeName = (name) => `0x${packet.name.encode(name).toString("hex")}`; +export { + hexEncodeName +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/utils/labels.mjs b/.yalc/@ensdomains/ensjs/dist/esm/utils/labels.mjs new file mode 100644 index 000000000..775e25c64 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/utils/labels.mjs @@ -0,0 +1,109 @@ +// src/utils/labels.ts +import { keccak256 as solidityKeccak256 } from "@ethersproject/solidity"; +import { truncateFormat } from "./format.mjs"; +var hasLocalStorage = typeof localStorage !== "undefined"; +var labelhash = (input) => solidityKeccak256(["string"], [input]); +var keccakFromString = (input) => labelhash(input); +function decodeLabelhash(hash) { + if (!(hash.startsWith("[") && hash.endsWith("]"))) { + throw Error( + "Expected encoded labelhash to start and end with square brackets" + ); + } + if (hash.length !== 66) { + throw Error("Expected encoded labelhash to have a length of 66"); + } + return `0x${hash.slice(1, -1)}`; +} +function encodeLabelhash(hash) { + if (!hash.startsWith("0x")) { + throw new Error("Expected label hash to start with 0x"); + } + if (hash.length !== 66) { + throw new Error("Expected label hash to have a length of 66"); + } + return `[${hash.slice(2)}]`; +} +function isEncodedLabelhash(hash) { + return hash.startsWith("[") && hash.endsWith("]") && hash.length === 66; +} +function getLabels() { + return hasLocalStorage ? JSON.parse(localStorage.getItem("ensjs:labels")) || {} : {}; +} +function _saveLabel(hash, label) { + if (!hasLocalStorage) + return hash; + const labels = getLabels(); + localStorage.setItem( + "ensjs:labels", + JSON.stringify({ + ...labels, + [hash]: label + }) + ); + return hash; +} +function saveLabel(label) { + const hash = `${labelhash(label.toLowerCase())}`; + return _saveLabel(hash, label); +} +function saveName(name) { + const nameArray = name.split("."); + nameArray.forEach((label) => { + saveLabel(label); + }); +} +function checkLabel(hash) { + const labels = getLabels(); + if (isEncodedLabelhash(hash)) { + return labels[decodeLabelhash(hash)]; + } + if (hash.startsWith("0x")) { + return labels[`${hash.slice(2)}`]; + } +} +function encodeLabel(label) { + try { + return encodeLabelhash(label); + } catch { + return label; + } +} +function parseName(name) { + const nameArray = name.split("."); + return nameArray.map((label) => encodeLabel(label)).join("."); +} +function checkIsDecrypted(string) { + return !string?.includes("["); +} +function decryptName(name) { + return name.split(".").map((label) => checkLabel(label) || label).join("."); +} +var truncateUndecryptedName = (name) => truncateFormat(name); +function checkLocalStorageSize() { + if (!hasLocalStorage) + return "Empty (0 KB)"; + let allStrings = ""; + for (const key in window.localStorage) { + if (Object.prototype.hasOwnProperty.call(window.localStorage, key)) { + allStrings += window.localStorage[key]; + } + } + return allStrings ? `${3 + allStrings.length * 16 / (8 * 1024)} KB` : "Empty (0 KB)"; +} +export { + checkIsDecrypted, + checkLabel, + checkLocalStorageSize, + decodeLabelhash, + decryptName, + encodeLabel, + encodeLabelhash, + isEncodedLabelhash, + keccakFromString, + labelhash, + parseName, + saveLabel, + saveName, + truncateUndecryptedName +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/utils/makeHashIndexes.mjs b/.yalc/@ensdomains/ensjs/dist/esm/utils/makeHashIndexes.mjs new file mode 100644 index 000000000..90e8c39de --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/utils/makeHashIndexes.mjs @@ -0,0 +1,10 @@ +// src/utils/makeHashIndexes.ts +import { namehash } from "./normalise.mjs"; +var makeOtherIndexes = (data, findStr) => Array.from(data.matchAll(findStr)).map((x) => x.index / 2 - 1); +var makeNamehashIndexes = (data, name) => Array.from(data.matchAll(namehash(name).substring(2))).map( + (x) => x.index / 2 - 1 +); +export { + makeNamehashIndexes, + makeOtherIndexes +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/utils/normalise.mjs b/.yalc/@ensdomains/ensjs/dist/esm/utils/normalise.mjs new file mode 100644 index 000000000..e3432295d --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/utils/normalise.mjs @@ -0,0 +1,32 @@ +// src/utils/normalise.ts +import { concat, hexlify } from "@ethersproject/bytes"; +import { keccak256 } from "@ethersproject/keccak256"; +import { toUtf8Bytes } from "@ethersproject/strings/lib.esm/utf8.js"; +import uts46 from "idna-uts46-hx/uts46bundle.js"; +import { decodeLabelhash, isEncodedLabelhash } from "./labels.mjs"; +var zeros = new Uint8Array(32); +zeros.fill(0); +var normalise = (name) => name ? uts46.toUnicode(name, { useStd3ASCII: true }) : name; +var namehash = (name) => { + let result = zeros; + if (name) { + const labels = name.split("."); + for (let i = labels.length - 1; i >= 0; i -= 1) { + let labelSha; + if (isEncodedLabelhash(labels[i])) { + labelSha = decodeLabelhash(labels[i]); + } else { + const normalised = normalise(labels[i]); + labelSha = keccak256(toUtf8Bytes(normalised)); + } + result = keccak256(concat([result, labelSha])); + } + } else { + result = hexlify(zeros); + } + return result; +}; +export { + namehash, + normalise +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/utils/recordHelpers.mjs b/.yalc/@ensdomains/ensjs/dist/esm/utils/recordHelpers.mjs new file mode 100644 index 000000000..7efd9d9c8 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/utils/recordHelpers.mjs @@ -0,0 +1,123 @@ +// src/utils/recordHelpers.ts +import { formatsByCoinType, formatsByName } from "@ensdomains/address-encoder"; +import { isBytesLike, toUtf8Bytes } from "ethers/lib/utils"; +import { encodeContenthash } from "./contentHash.mjs"; +var generateSetAddr = (namehash, coinType, address, resolver) => { + let coinTypeInstance; + if (!Number.isNaN(parseInt(coinType))) { + coinTypeInstance = formatsByCoinType[parseInt(coinType)]; + } else { + coinTypeInstance = formatsByName[coinType.toUpperCase()]; + } + const inputCoinType = coinTypeInstance.coinType; + const encodedAddress = coinTypeInstance.decoder(address); + return resolver?.interface.encodeFunctionData( + "setAddr(bytes32,uint256,bytes)", + [namehash, inputCoinType, encodedAddress] + ); +}; +var generateABIInput = async (encodeAs, data) => { + let contentType; + let encodedData; + switch (encodeAs) { + case "json": + contentType = 1; + encodedData = JSON.stringify(data); + break; + case "zlib": { + contentType = 2; + const { deflate } = await import("pako/dist/pako_deflate.min.js"); + encodedData = deflate(JSON.stringify(data)); + break; + } + case "cbor": { + contentType = 4; + const { encode } = await import("cbor"); + encodedData = encode(data); + break; + } + default: { + contentType = 8; + encodedData = data; + break; + } + } + return { contentType, data: encodedData }; +}; +function generateSingleRecordCall(namehash, resolver, type) { + if (type === "contentHash") { + return (_r) => { + const record = _r; + let _contentHash = ""; + if (record !== _contentHash) { + const encoded = encodeContenthash(record); + if (encoded.error) + throw new Error(encoded.error); + _contentHash = encoded.encoded; + } + return resolver.interface.encodeFunctionData("setContenthash", [ + namehash, + _contentHash + ]); + }; + } + if (type === "abi") { + return (_r) => { + const record = _r; + const { contentType = 1, data } = record; + let encodedData = data; + if (!isBytesLike(encodedData)) { + if (typeof encodedData === "object") { + encodedData = JSON.stringify(encodedData); + } + encodedData = toUtf8Bytes(encodedData); + } + return resolver.interface.encodeFunctionData("setABI", [ + namehash, + contentType, + encodedData + ]); + }; + } + return (_r) => { + const record = _r; + if (type === "text") { + return resolver.interface.encodeFunctionData("setText", [ + namehash, + record.key, + record.value + ]); + } + return generateSetAddr(namehash, record.key, record.value, resolver); + }; +} +var generateRecordCallArray = (namehash, records, resolver) => { + const calls = []; + if (records.clearRecords) { + calls.push( + resolver.interface.encodeFunctionData("clearRecords", [namehash]) + ); + } + if (records.contentHash) { + const data = generateSingleRecordCall( + namehash, + resolver, + "contentHash" + )(records.contentHash); + if (data) + calls.push(data); + } + if (records.texts && records.texts.length > 0) { + records.texts.map(generateSingleRecordCall(namehash, resolver, "text")).forEach((call) => calls.push(call)); + } + if (records.coinTypes && records.coinTypes.length > 0) { + records.coinTypes.map(generateSingleRecordCall(namehash, resolver, "addr")).forEach((call) => calls.push(call)); + } + return calls; +}; +export { + generateABIInput, + generateRecordCallArray, + generateSetAddr, + generateSingleRecordCall +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/utils/registerHelpers.mjs b/.yalc/@ensdomains/ensjs/dist/esm/utils/registerHelpers.mjs new file mode 100644 index 000000000..87514394f --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/utils/registerHelpers.mjs @@ -0,0 +1,90 @@ +// src/utils/registerHelpers.ts +import { defaultAbiCoder } from "@ethersproject/abi/lib.esm/abi-coder.js"; +import { keccak256 } from "@ethersproject/keccak256"; +import { encodeFuses } from "./fuses.mjs"; +import { labelhash } from "./labels.mjs"; +import { namehash } from "./normalise.mjs"; +import { generateRecordCallArray } from "./recordHelpers.mjs"; +var randomSecret = () => { + const bytes = Buffer.allocUnsafe(32); + return `0x${crypto.getRandomValues(bytes).toString("hex")}`; +}; +var makeCommitmentData = ({ + name, + owner, + duration, + resolver, + records, + reverseRecord, + fuses, + secret +}) => { + const labelHash = labelhash(name.split(".")[0]); + const hash = namehash(name); + const resolverAddress = resolver.address; + const fuseData = fuses ? encodeFuses(fuses, "child") : 0; + if (reverseRecord) { + if (!records) { + records = { coinTypes: [{ key: "ETH", value: owner }] }; + } else if (!records.coinTypes?.find((c) => c.key === "ETH")) { + if (!records.coinTypes) + records.coinTypes = []; + records.coinTypes.push({ key: "ETH", value: owner }); + } + } + const data = records ? generateRecordCallArray(hash, records, resolver) : []; + return [ + labelHash, + owner, + duration, + secret, + resolverAddress, + data, + !!reverseRecord, + fuseData + ]; +}; +var makeRegistrationData = (params) => { + const commitmentData = makeCommitmentData(params); + const label = params.name.split(".")[0]; + commitmentData[0] = label; + return commitmentData; +}; +var _makeCommitment = (params) => { + return keccak256( + defaultAbiCoder.encode( + [ + "bytes32", + "address", + "uint256", + "bytes32", + "address", + "bytes[]", + "bool", + "uint16" + ], + params + ) + ); +}; +var makeCommitment = ({ + secret = randomSecret(), + ...inputParams +}) => { + const generatedParams = makeCommitmentData({ + ...inputParams, + secret + }); + const commitment = _makeCommitment(generatedParams); + return { + secret, + commitment + }; +}; +export { + _makeCommitment, + makeCommitment, + makeCommitmentData, + makeRegistrationData, + randomSecret +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/utils/singleCall.mjs b/.yalc/@ensdomains/ensjs/dist/esm/utils/singleCall.mjs new file mode 100644 index 000000000..2845d791a --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/utils/singleCall.mjs @@ -0,0 +1,5 @@ +// src/utils/singleCall.ts +var singleCall_default = async (provider, ensData, func, ...data) => func.raw(ensData, ...data).then((rawData) => provider.call({ ...rawData, ccipReadEnabled: true })).catch(() => null).then((ret) => func.decode(ensData, ret, ...data)); +export { + singleCall_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/utils/subgraph-types.mjs b/.yalc/@ensdomains/ensjs/dist/esm/utils/subgraph-types.mjs new file mode 100644 index 000000000..e69de29bb diff --git a/.yalc/@ensdomains/ensjs/dist/esm/utils/validation.mjs b/.yalc/@ensdomains/ensjs/dist/esm/utils/validation.mjs new file mode 100644 index 000000000..996d6501a --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/utils/validation.mjs @@ -0,0 +1,67 @@ +// src/utils/validation.ts +import { isAddress } from "@ethersproject/address"; +import { isEncodedLabelhash, saveName } from "./labels.mjs"; +import { normalise } from "./normalise.mjs"; +var validateName = (name) => { + const nameArray = name.split("."); + const hasEmptyLabels = nameArray.some((label) => label.length === 0); + if (hasEmptyLabels) + throw new Error("Name cannot have empty labels"); + const normalizedArray = nameArray.map((label) => { + if (label === "[root]") { + return label; + } + return isEncodedLabelhash(label) ? label : normalise(label); + }); + const normalizedName = normalizedArray.join("."); + saveName(normalizedName); + return normalizedName; +}; +var validateTLD = (name) => { + const labels = name.split("."); + return validateName(labels[labels.length - 1]); +}; +var parseInputType = (input) => { + const validTLD = validateTLD(input); + const regex = /[^.]+$/; + try { + validateName(input); + } catch (e) { + return { + type: "unknown" + }; + } + if (input.indexOf(".") !== -1) { + const termArray = input.split("."); + const tld = input.match(regex) ? input.match(regex)[0] : ""; + if (validTLD) { + if (tld === "eth" && [...termArray[termArray.length - 2]].length < 3) { + return { + type: "name", + info: "short" + }; + } + return { + type: "name", + info: "supported" + }; + } + return { + type: "name", + info: "unsupported" + }; + } + if (isAddress(input)) { + return { + type: "address" + }; + } + return { + type: "label" + }; +}; +export { + parseInputType, + validateName, + validateTLD +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/utils/wrapper.mjs b/.yalc/@ensdomains/ensjs/dist/esm/utils/wrapper.mjs new file mode 100644 index 000000000..9394a4e7c --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/utils/wrapper.mjs @@ -0,0 +1,32 @@ +// src/utils/wrapper.ts +import { BigNumber } from "@ethersproject/bignumber/lib.esm/bignumber.js"; +import { toUtf8Bytes } from "@ethersproject/strings/lib.esm/utf8.js"; +var MAX_EXPIRY = BigNumber.from(2).pow(64).sub(1); +var makeExpiry = async ({ getExpiry }, name, expiry) => { + if (expiry) { + if (expiry instanceof Date) { + return BigNumber.from(expiry.getTime() / 1e3); + } + if (expiry instanceof BigNumber) { + return expiry; + } + return BigNumber.from(expiry); + } + if (name.endsWith(".eth")) { + const expResponse = await getExpiry(name); + if (!expResponse?.expiry) + throw new Error("Couldn't get expiry for name, please provide one."); + return BigNumber.from(expResponse.expiry.getTime() / 1e3); + } + return MAX_EXPIRY; +}; +var wrappedLabelLengthCheck = (label) => { + const bytes = toUtf8Bytes(label); + if (bytes.byteLength > 255) + throw new Error("Label can't be longer than 255 bytes"); +}; +export { + MAX_EXPIRY, + makeExpiry, + wrappedLabelLengthCheck +}; diff --git a/.yalc/@ensdomains/ensjs/dist/esm/utils/writeTx.mjs b/.yalc/@ensdomains/ensjs/dist/esm/utils/writeTx.mjs new file mode 100644 index 000000000..88cfed855 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/esm/utils/writeTx.mjs @@ -0,0 +1,6 @@ +// src/utils/writeTx.ts +var withCustomData = (tx, customData) => customData ? { ...tx, customData } : tx; +var writeTx_default = (signer, populate) => ({ customData, ...tx }) => populate ? withCustomData(tx, customData) : signer.sendTransaction(tx).then((r) => withCustomData(r, customData)); +export { + writeTx_default as default +}; diff --git a/.yalc/@ensdomains/ensjs/dist/types/GqlManager.d.ts b/.yalc/@ensdomains/ensjs/dist/types/GqlManager.d.ts new file mode 100644 index 000000000..d9a475524 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/GqlManager.d.ts @@ -0,0 +1,13 @@ +import type { parse as Parse, print as Print, SelectionSetNode, visit as Visit } from 'graphql'; +import type { gql, GraphQLClient } from 'graphql-request'; +import type Traverse from 'traverse'; +export declare const enter: (node: SelectionSetNode) => SelectionSetNode | undefined; +export declare const requestMiddleware: (visit: typeof Visit, parse: typeof Parse, print: typeof Print) => (request: any) => any; +export declare const responseMiddleware: (traverse: typeof Traverse) => (response: any) => any; +export default class GqlManager { + gql: typeof gql | ((query: TemplateStringsArray) => string); + client: GraphQLClient | { + request: () => Promise; + }; + setUrl: (url: string | null) => Promise; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/contracts/baseRegistrar.d.ts b/.yalc/@ensdomains/ensjs/dist/types/contracts/baseRegistrar.d.ts new file mode 100644 index 000000000..c92078389 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/contracts/baseRegistrar.d.ts @@ -0,0 +1,3 @@ +import type { JsonRpcProvider } from '@ethersproject/providers'; +declare const _default: (provider: JsonRpcProvider, address: string) => import("../generated/BaseRegistrarImplementation").BaseRegistrarImplementation; +export default _default; diff --git a/.yalc/@ensdomains/ensjs/dist/types/contracts/bulkRenewal.d.ts b/.yalc/@ensdomains/ensjs/dist/types/contracts/bulkRenewal.d.ts new file mode 100644 index 000000000..5418ef9b5 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/contracts/bulkRenewal.d.ts @@ -0,0 +1,3 @@ +import type { JsonRpcProvider } from '@ethersproject/providers'; +declare const _default: (provider: JsonRpcProvider, address: string) => import("../generated/BulkRenewal").BulkRenewal; +export default _default; diff --git a/.yalc/@ensdomains/ensjs/dist/types/contracts/dnsRegistrar.d.ts b/.yalc/@ensdomains/ensjs/dist/types/contracts/dnsRegistrar.d.ts new file mode 100644 index 000000000..63dfffe87 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/contracts/dnsRegistrar.d.ts @@ -0,0 +1,3 @@ +import type { JsonRpcProvider } from '@ethersproject/providers'; +declare const _default: (provider: JsonRpcProvider, address: string) => import("../generated/DNSRegistrar").DNSRegistrar; +export default _default; diff --git a/.yalc/@ensdomains/ensjs/dist/types/contracts/ethRegistrarController.d.ts b/.yalc/@ensdomains/ensjs/dist/types/contracts/ethRegistrarController.d.ts new file mode 100644 index 000000000..59c788548 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/contracts/ethRegistrarController.d.ts @@ -0,0 +1,3 @@ +import type { JsonRpcProvider } from '@ethersproject/providers'; +declare const _default: (provider: JsonRpcProvider, address: string) => import("../generated/ETHRegistrarController").ETHRegistrarController; +export default _default; diff --git a/.yalc/@ensdomains/ensjs/dist/types/contracts/factories.d.ts b/.yalc/@ensdomains/ensjs/dist/types/contracts/factories.d.ts new file mode 100644 index 000000000..2dfa334c0 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/contracts/factories.d.ts @@ -0,0 +1,45 @@ +import type { BaseRegistrarImplementation__factory } from '../generated/factories/BaseRegistrarImplementation__factory'; +import type { BulkRenewal__factory } from '../generated/factories/BulkRenewal__factory'; +import type { DefaultReverseResolver__factory } from '../generated/factories/DefaultReverseResolver__factory'; +import type { DNSRegistrar__factory } from '../generated/factories/DNSRegistrar__factory'; +import type { DNSSECImpl__factory } from '../generated/factories/DNSSECImpl__factory'; +import type { ENSRegistry__factory } from '../generated/factories/ENSRegistry__factory'; +import type { ETHRegistrarController__factory } from '../generated/factories/ETHRegistrarController__factory'; +import type { Multicall__factory } from '../generated/factories/Multicall__factory'; +import type { NameWrapper__factory } from '../generated/factories/NameWrapper__factory'; +import type { P256SHA256Algorithm__factory } from '../generated/factories/P256SHA256Algorithm__factory'; +import type { PublicResolver__factory } from '../generated/factories/PublicResolver__factory'; +import type { ReverseRegistrar__factory } from '../generated/factories/ReverseRegistrar__factory'; +import type { Root__factory } from '../generated/factories/Root__factory'; +import type { RSASHA1Algorithm__factory } from '../generated/factories/RSASHA1Algorithm__factory'; +import type { RSASHA256Algorithm__factory } from '../generated/factories/RSASHA256Algorithm__factory'; +import type { SHA1Digest__factory } from '../generated/factories/SHA1Digest__factory'; +import type { SHA1NSEC3Digest__factory } from '../generated/factories/SHA1NSEC3Digest__factory'; +import type { SHA256Digest__factory } from '../generated/factories/SHA256Digest__factory'; +import type { StaticMetadataService__factory } from '../generated/factories/StaticMetadataService__factory'; +import type { TLDPublicSuffixList__factory } from '../generated/factories/TLDPublicSuffixList__factory'; +import type { UniversalResolver__factory } from '../generated/factories/UniversalResolver__factory'; +declare type Factories = { + BaseRegistrarImplementation: BaseRegistrarImplementation__factory; + DefaultReverseResolver: DefaultReverseResolver__factory; + DNSRegistrar: DNSRegistrar__factory; + DNSSECImpl: DNSSECImpl__factory; + ENSRegistry: ENSRegistry__factory; + ETHRegistrarController: ETHRegistrarController__factory; + P256SHA256Algorithm: P256SHA256Algorithm__factory; + PublicResolver: PublicResolver__factory; + ReverseRegistrar: ReverseRegistrar__factory; + Root: Root__factory; + RSASHA1Algorithm: RSASHA1Algorithm__factory; + RSASHA256Algorithm: RSASHA256Algorithm__factory; + SHA1Digest: SHA1Digest__factory; + SHA1NSEC3Digest: SHA1NSEC3Digest__factory; + SHA256Digest: SHA256Digest__factory; + TLDPublicSuffixList: TLDPublicSuffixList__factory; + Multicall: Multicall__factory; + NameWrapper: NameWrapper__factory; + StaticMetadataService: StaticMetadataService__factory; + UniversalResolver: UniversalResolver__factory; + BulkRenewal: BulkRenewal__factory; +}; +export default Factories; diff --git a/.yalc/@ensdomains/ensjs/dist/types/contracts/getContractAddress.d.ts b/.yalc/@ensdomains/ensjs/dist/types/contracts/getContractAddress.d.ts new file mode 100644 index 000000000..aa0ce3d50 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/contracts/getContractAddress.d.ts @@ -0,0 +1,3 @@ +import { ContractName, SupportedNetworkId } from './types'; +export declare type ContractAddressFetch = (contractName: ContractName) => string; +export declare const getContractAddress: (networkId: SupportedNetworkId) => ContractAddressFetch; diff --git a/.yalc/@ensdomains/ensjs/dist/types/contracts/index.d.ts b/.yalc/@ensdomains/ensjs/dist/types/contracts/index.d.ts new file mode 100644 index 000000000..69a8e6193 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/contracts/index.d.ts @@ -0,0 +1,38 @@ +import type { Interface } from '@ethersproject/abi'; +import type { Signer } from '@ethersproject/abstract-signer'; +import type { BaseContract } from '@ethersproject/contracts'; +import type { Provider } from '@ethersproject/providers'; +import type { BaseRegistrarImplementation } from '../generated/BaseRegistrarImplementation'; +import type { BulkRenewal } from '../generated/BulkRenewal'; +import type { DNSRegistrar } from '../generated/DNSRegistrar'; +import type { ENSRegistry } from '../generated/ENSRegistry'; +import type { ETHRegistrarController } from '../generated/ETHRegistrarController'; +import type { Multicall } from '../generated/Multicall'; +import type { NameWrapper } from '../generated/NameWrapper'; +import type { PublicResolver } from '../generated/PublicResolver'; +import type { ReverseRegistrar } from '../generated/ReverseRegistrar'; +import type { UniversalResolver } from '../generated/UniversalResolver'; +import { ContractAddressFetch } from './getContractAddress'; +declare type BaseFactory = { + readonly abi: object; + createInterface(): Interface; + connect(address: string, signerOrProvider: Signer | Provider): BaseContract; +}; +export default class ContractManager { + private provider; + private fetchAddress; + protected getModule: (name: string) => Promise; + constructor(provider: Provider, fetchAddress: ContractAddressFetch, getModule?: (name: string) => Promise); + private generateContractGetter; + getPublicResolver: (passedProvider?: any, address?: string) => Promise; + getUniversalResolver: (passedProvider?: any, address?: string) => Promise; + getRegistry: (passedProvider?: any, address?: string) => Promise; + getReverseRegistrar: (passedProvider?: any, address?: string) => Promise; + getNameWrapper: (passedProvider?: any, address?: string) => Promise; + getDNSRegistrar: (passedProvider?: any, address?: string) => Promise; + getBaseRegistrar: (passedProvider?: any, address?: string) => Promise; + getEthRegistrarController: (passedProvider?: any, address?: string) => Promise; + getMulticall: (passedProvider?: any, address?: string) => Promise; + getBulkRenewal: (passedProvider?: any, address?: string) => Promise; +} +export {}; diff --git a/.yalc/@ensdomains/ensjs/dist/types/contracts/multicall.d.ts b/.yalc/@ensdomains/ensjs/dist/types/contracts/multicall.d.ts new file mode 100644 index 000000000..f524484dd --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/contracts/multicall.d.ts @@ -0,0 +1,3 @@ +import type { JsonRpcProvider } from '@ethersproject/providers'; +declare const _default: (provider: JsonRpcProvider, address: string) => import("../generated/Multicall").Multicall; +export default _default; diff --git a/.yalc/@ensdomains/ensjs/dist/types/contracts/nameWrapper.d.ts b/.yalc/@ensdomains/ensjs/dist/types/contracts/nameWrapper.d.ts new file mode 100644 index 000000000..619dcaad2 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/contracts/nameWrapper.d.ts @@ -0,0 +1,3 @@ +import type { JsonRpcProvider } from '@ethersproject/providers'; +declare const _default: (provider: JsonRpcProvider, address: string) => import("../generated/NameWrapper").NameWrapper; +export default _default; diff --git a/.yalc/@ensdomains/ensjs/dist/types/contracts/publicResolver.d.ts b/.yalc/@ensdomains/ensjs/dist/types/contracts/publicResolver.d.ts new file mode 100644 index 000000000..db04ff8a6 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/contracts/publicResolver.d.ts @@ -0,0 +1,3 @@ +import type { JsonRpcProvider } from '@ethersproject/providers'; +declare const _default: (provider: JsonRpcProvider, address: string) => import("../generated/PublicResolver").PublicResolver; +export default _default; diff --git a/.yalc/@ensdomains/ensjs/dist/types/contracts/registry.d.ts b/.yalc/@ensdomains/ensjs/dist/types/contracts/registry.d.ts new file mode 100644 index 000000000..ff37748c5 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/contracts/registry.d.ts @@ -0,0 +1,3 @@ +import type { JsonRpcProvider } from '@ethersproject/providers'; +declare const _default: (provider: JsonRpcProvider, address: string) => import("../generated/ENSRegistry").ENSRegistry; +export default _default; diff --git a/.yalc/@ensdomains/ensjs/dist/types/contracts/reverseRegistrar.d.ts b/.yalc/@ensdomains/ensjs/dist/types/contracts/reverseRegistrar.d.ts new file mode 100644 index 000000000..dd93597a4 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/contracts/reverseRegistrar.d.ts @@ -0,0 +1,3 @@ +import type { JsonRpcProvider } from '@ethersproject/providers'; +declare const _default: (provider: JsonRpcProvider, address: string) => import("../generated/ReverseRegistrar").ReverseRegistrar; +export default _default; diff --git a/.yalc/@ensdomains/ensjs/dist/types/contracts/types.d.ts b/.yalc/@ensdomains/ensjs/dist/types/contracts/types.d.ts new file mode 100644 index 000000000..73888516b --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/contracts/types.d.ts @@ -0,0 +1,2 @@ +export declare type SupportedNetworkId = '1' | '3' | '4' | '5' | '1337'; +export declare type ContractName = 'BaseRegistrarImplementation' | 'ETHRegistrarController' | 'Multicall' | 'NameWrapper' | 'DNSRegistrar' | 'PublicResolver' | 'ENSRegistry' | 'ReverseRegistrar' | 'UniversalResolver' | 'BulkRenewal'; diff --git a/.yalc/@ensdomains/ensjs/dist/types/contracts/universalResolver.d.ts b/.yalc/@ensdomains/ensjs/dist/types/contracts/universalResolver.d.ts new file mode 100644 index 000000000..507088f9c --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/contracts/universalResolver.d.ts @@ -0,0 +1,3 @@ +import type { JsonRpcProvider } from '@ethersproject/providers'; +declare const _default: (provider: JsonRpcProvider, address: string) => import("../generated/UniversalResolver").UniversalResolver; +export default _default; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/batch.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/batch.d.ts new file mode 100644 index 000000000..5f5204a08 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/batch.d.ts @@ -0,0 +1,9 @@ +import { BatchFunctionResult, ENSArgs, RawFunction } from '..'; +declare const _default: { + raw: ({ multicallWrapper }: ENSArgs<"multicallWrapper">, ...items: BatchFunctionResult[]) => Promise<{ + to: string; + data: string; + }>; + decode: ({ multicallWrapper }: ENSArgs<"multicallWrapper">, data: string, ...items: BatchFunctionResult[]) => Promise; +}; +export default _default; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/batchWrappers.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/batchWrappers.d.ts new file mode 100644 index 000000000..dd06049ee --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/batchWrappers.d.ts @@ -0,0 +1,86 @@ +import type { TransactionRequest } from '@ethersproject/providers'; +import { ENSArgs } from '..'; +export declare const universalWrapper: { + raw: ({ contracts }: ENSArgs<'contracts'>, name: string, data: string) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts }: ENSArgs<'contracts'>, data: string) => Promise<{ + data: any; + resolver: any; + } | undefined>; +}; +export declare const resolverMulticallWrapper: { + raw: ({ contracts }: ENSArgs<'contracts'>, data: { + to: string; + data: string; + }[]) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts }: ENSArgs<'contracts'>, data: string) => Promise; +}; +export declare const multicallWrapper: { + raw({ contracts }: ENSArgs<'contracts'>, transactions: TransactionRequest[], requireSuccess?: boolean): Promise<{ + to: string; + data: string; + }>; + decode({ contracts, provider }: ENSArgs<'contracts' | 'provider'>, data: string, transactions: TransactionRequest[]): Promise<{ + success: boolean; + returnData: string; + 0: boolean; + 1: string; + length: 2; + toString(): string; + toLocaleString(): string; + pop(): string | boolean | undefined; + push(...items: (string | boolean)[]): number; + concat(...items: ConcatArray[]): (string | boolean)[]; + concat(...items: (string | boolean | ConcatArray)[]): (string | boolean)[]; + join(separator?: string | undefined): string; + reverse(): (string | boolean)[]; + shift(): string | boolean | undefined; + slice(start?: number | undefined, end?: number | undefined): (string | boolean)[]; + sort(compareFn?: ((a: string | boolean, b: string | boolean) => number) | undefined): [boolean, string]; + splice(start: number, deleteCount?: number | undefined): (string | boolean)[]; + splice(start: number, deleteCount: number, ...items: (string | boolean)[]): (string | boolean)[]; + unshift(...items: (string | boolean)[]): number; + indexOf(searchElement: string | boolean, fromIndex?: number | undefined): number; + lastIndexOf(searchElement: string | boolean, fromIndex?: number | undefined): number; + every(predicate: (value: string | boolean, index: number, array: (string | boolean)[]) => value is S, thisArg?: any): this is S[]; + every(predicate: (value: string | boolean, index: number, array: (string | boolean)[]) => unknown, thisArg?: any): boolean; + some(predicate: (value: string | boolean, index: number, array: (string | boolean)[]) => unknown, thisArg?: any): boolean; + forEach(callbackfn: (value: string | boolean, index: number, array: (string | boolean)[]) => void, thisArg?: any): void; + map(callbackfn: (value: string | boolean, index: number, array: (string | boolean)[]) => U, thisArg?: any): U[]; + filter(predicate: (value: string | boolean, index: number, array: (string | boolean)[]) => value is S_1, thisArg?: any): S_1[]; + filter(predicate: (value: string | boolean, index: number, array: (string | boolean)[]) => unknown, thisArg?: any): (string | boolean)[]; + reduce(callbackfn: (previousValue: string | boolean, currentValue: string | boolean, currentIndex: number, array: (string | boolean)[]) => string | boolean): string | boolean; + reduce(callbackfn: (previousValue: string | boolean, currentValue: string | boolean, currentIndex: number, array: (string | boolean)[]) => string | boolean, initialValue: string | boolean): string | boolean; + reduce(callbackfn: (previousValue: U_1, currentValue: string | boolean, currentIndex: number, array: (string | boolean)[]) => U_1, initialValue: U_1): U_1; + reduceRight(callbackfn: (previousValue: string | boolean, currentValue: string | boolean, currentIndex: number, array: (string | boolean)[]) => string | boolean): string | boolean; + reduceRight(callbackfn: (previousValue: string | boolean, currentValue: string | boolean, currentIndex: number, array: (string | boolean)[]) => string | boolean, initialValue: string | boolean): string | boolean; + reduceRight(callbackfn: (previousValue: U_2, currentValue: string | boolean, currentIndex: number, array: (string | boolean)[]) => U_2, initialValue: U_2): U_2; + find(predicate: (this: void, value: string | boolean, index: number, obj: (string | boolean)[]) => value is S_2, thisArg?: any): S_2 | undefined; + find(predicate: (value: string | boolean, index: number, obj: (string | boolean)[]) => unknown, thisArg?: any): string | boolean | undefined; + findIndex(predicate: (value: string | boolean, index: number, obj: (string | boolean)[]) => unknown, thisArg?: any): number; + fill(value: string | boolean, start?: number | undefined, end?: number | undefined): [boolean, string]; + copyWithin(target: number, start: number, end?: number | undefined): [boolean, string]; + entries(): IterableIterator<[number, string | boolean]>; + keys(): IterableIterator; + values(): IterableIterator; + includes(searchElement: string | boolean, fromIndex?: number | undefined): boolean; + flatMap(callback: (this: This, value: string | boolean, index: number, array: (string | boolean)[]) => U_3 | readonly U_3[], thisArg?: This | undefined): U_3[]; + flat(this: A, depth?: D | undefined): FlatArray[]; + [Symbol.iterator](): IterableIterator; + [Symbol.unscopables](): { + copyWithin: boolean; + entries: boolean; + fill: boolean; + find: boolean; + findIndex: boolean; + keys: boolean; + values: boolean; + }; + at(index: number): string | boolean | undefined; + }[] | undefined>; +}; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/commitName.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/commitName.d.ts new file mode 100644 index 000000000..f17ac86e6 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/commitName.d.ts @@ -0,0 +1,25 @@ +import { ENSArgs } from '..'; +import { CommitmentParams } from '../utils/registerHelpers'; +declare type Params = Omit & { + resolverAddress?: string; +}; +export default function ({ contracts }: ENSArgs<'contracts'>, name: string, { resolverAddress, ...params }: Params): Promise<{ + customData: { + secret: string; + commitment: string; + }; + to?: string | undefined; + from?: string | undefined; + nonce?: number | undefined; + gasLimit?: import("ethers").BigNumber | undefined; + gasPrice?: import("ethers").BigNumber | undefined; + data?: string | undefined; + value?: import("ethers").BigNumber | undefined; + chainId?: number | undefined; + type?: number | undefined; + accessList?: import("@ethersproject/transactions").AccessList | undefined; + maxFeePerGas?: import("ethers").BigNumber | undefined; + maxPriorityFeePerGas?: import("ethers").BigNumber | undefined; + ccipReadEnabled?: boolean | undefined; +}>; +export {}; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/createSubname.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/createSubname.d.ts new file mode 100644 index 000000000..50f0fd483 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/createSubname.d.ts @@ -0,0 +1,16 @@ +import { ENSArgs } from '..'; +import { CombinedFuseInput } from '../utils/fuses'; +import { Expiry } from '../utils/wrapper'; +declare type BaseArgs = { + owner: string; + resolverAddress?: string; + contract: 'registry' | 'nameWrapper'; +}; +declare type NameWrapperArgs = { + contract: 'nameWrapper'; + fuses?: CombinedFuseInput; + expiry?: Expiry; +} & BaseArgs; +declare type Args = BaseArgs | NameWrapperArgs; +export default function ({ contracts, signer, getExpiry, }: ENSArgs<'contracts' | 'signer' | 'getExpiry'>, name: string, { owner, resolverAddress, contract, ...wrapperArgs }: Args): Promise; +export {}; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/deleteSubname.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/deleteSubname.d.ts new file mode 100644 index 000000000..96e849795 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/deleteSubname.d.ts @@ -0,0 +1,6 @@ +import { ENSArgs } from '..'; +declare type Args = { + contract: 'registry' | 'nameWrapper'; +}; +export default function ({ contracts, signer }: ENSArgs<'contracts' | 'signer' | 'getExpiry'>, name: string, { contract }: Args): Promise; +export {}; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/getAvailable.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/getAvailable.d.ts new file mode 100644 index 000000000..ce6425ca3 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/getAvailable.d.ts @@ -0,0 +1,9 @@ +import { ENSArgs } from '..'; +declare const _default: { + raw: ({ contracts }: ENSArgs<"contracts">, name: string) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts }: ENSArgs<"contracts">, data: string) => Promise; +}; +export default _default; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/getDNSOwner.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/getDNSOwner.d.ts new file mode 100644 index 000000000..3bd6d4fcf --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/getDNSOwner.d.ts @@ -0,0 +1,7 @@ +import * as packet from 'dns-packet'; +export declare function encodeURLParams(p: { + [key: string]: string; +}): string; +export declare const getDNS: (q: packet.Packet) => Promise; +export declare const dnsQuery: (qtype: string, qname: string) => Promise; +export default function (_: any, dnsName: string): Promise; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/getExpiry.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/getExpiry.d.ts new file mode 100644 index 000000000..06e84e707 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/getExpiry.d.ts @@ -0,0 +1,19 @@ +import { ENSArgs } from '..'; +declare type ContractOption = 'registrar' | 'nameWrapper'; +declare type Args = { + contract?: ContractOption; +}; +declare const _default: { + raw: (ensArgs: ENSArgs<"contracts" | "multicallWrapper">, name: string, { contract }?: Args) => Promise<{ + to: string; + data: string; + }>; + decode: (ensArgs: ENSArgs<"contracts" | "multicallWrapper">, data: string, name: string, { contract }?: Args) => Promise<{ + expiry: Date; + gracePeriod: null; + } | { + expiry: Date | null; + gracePeriod: number; + } | undefined>; +}; +export default _default; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/getHistory.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/getHistory.d.ts new file mode 100644 index 000000000..d222ef502 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/getHistory.d.ts @@ -0,0 +1,28 @@ +import { ENSArgs } from '..'; +declare type DomainEvent = 'NewOwner' | 'NewResolver' | 'Transfer' | 'NewTTL' | 'WrappedTransfer' | 'NameWrapped' | 'NameUnwrapped' | 'FusesSet' | 'ExpiryExtended'; +declare type RegistrationEvent = 'NameRegistered' | 'NameRenewed' | 'NameTransferred'; +declare type ResolverEvent = 'AddrChanged' | 'MulticoinAddrChanged' | 'NameChanged' | 'AbiChanged' | 'PubkeyChanged' | 'TextChanged' | 'ContenthashChanged' | 'InterfaceChanged' | 'AuthorisationChanged' | 'VersionChanged'; +export declare function getHistory({ gqlInstance }: ENSArgs<'gqlInstance'>, name: string): Promise<{ + domain: { + type: DomainEvent; + blockNumber: number; + transactionHash: string; + id: string; + data: object; + }[]; + registration: { + type: RegistrationEvent; + blockNumber: number; + transactionHash: string; + id: string; + data: object; + }[]; + resolver: { + type: ResolverEvent; + blockNumber: number; + transactionHash: string; + id: string; + data: object; + }[]; +} | undefined>; +export {}; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/getName.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/getName.d.ts new file mode 100644 index 000000000..19efc6c43 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/getName.d.ts @@ -0,0 +1,19 @@ +import { ENSArgs } from '..'; +declare const _default: { + raw: ({ contracts }: ENSArgs<"contracts">, address: string) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts }: ENSArgs<"contracts">, data: string, address: string) => Promise<{ + name: any; + match: boolean; + reverseResolverAddress: any; + resolverAddress: any; + } | { + name: undefined; + match?: undefined; + reverseResolverAddress?: undefined; + resolverAddress?: undefined; + } | undefined>; +}; +export default _default; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/getNames.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/getNames.d.ts new file mode 100644 index 000000000..6fcca2e63 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/getNames.d.ts @@ -0,0 +1,50 @@ +import { ENSArgs } from '..'; +import { AllCurrentFuses } from '../utils/fuses'; +export declare type Name = { + id: string; + labelName: string | null; + truncatedName?: string; + labelhash: string; + isMigrated: boolean; + name: string; + parent: { + name: string; + }; + createdAt?: Date; + registrationDate?: Date; + expiryDate?: Date; + fuses?: AllCurrentFuses; + registration?: { + expiryDate: Date; + registrationDate: Date; + }; + type: 'domain' | 'registration' | 'wrappedDomain'; +}; +declare type BaseParams = { + address: string; + type: 'registrant' | 'owner' | 'wrappedOwner' | 'all'; + page?: number; + pageSize?: number; + orderDirection?: 'asc' | 'desc'; +}; +declare type RegistrantParams = { + type: 'registrant'; + orderBy?: 'registrationDate' | 'expiryDate' | 'labelName'; +}; +declare type OwnerParams = { + type: 'owner'; + orderBy?: 'createdAt' | 'labelName'; +}; +declare type WrappedOwnerParams = { + type: 'wrappedOwner'; + orderBy?: 'expiryDate' | 'name'; +}; +declare type AllParams = { + type: 'all'; + orderBy?: 'labelName' | 'creationDate'; + page?: never; + pageSize?: never; +}; +declare type Params = BaseParams & (RegistrantParams | OwnerParams | WrappedOwnerParams | AllParams); +declare const getNames: ({ gqlInstance }: ENSArgs<'gqlInstance'>, { address: _address, type, page, pageSize, orderDirection, orderBy, }: Params) => Promise; +export default getNames; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/getOwner.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/getOwner.d.ts new file mode 100644 index 000000000..add08e183 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/getOwner.d.ts @@ -0,0 +1,15 @@ +import { ENSArgs } from '..'; +declare type Owner = { + registrant?: string; + owner?: string; + ownershipLevel: 'nameWrapper' | 'registry' | 'registrar'; + expired?: boolean; +}; +declare const _default: { + raw: ({ contracts, multicallWrapper }: ENSArgs<"contracts" | "multicallWrapper">, name: string, contract?: "nameWrapper" | "registrar" | "registry" | undefined) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts, multicallWrapper, gqlInstance, }: ENSArgs<"contracts" | "gqlInstance" | "multicallWrapper">, data: string, name: string, contract?: "nameWrapper" | "registrar" | "registry" | undefined) => Promise; +}; +export default _default; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/getPrice.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/getPrice.d.ts new file mode 100644 index 000000000..f2c28ecbf --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/getPrice.d.ts @@ -0,0 +1,13 @@ +import { BigNumber } from '@ethersproject/bignumber/lib/bignumber'; +import { ENSArgs } from '..'; +declare const _default: { + raw: ({ contracts, multicallWrapper }: ENSArgs<"contracts" | "multicallWrapper">, nameOrNames: string | string[], duration: number, legacy?: boolean | undefined) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts, multicallWrapper }: ENSArgs<"contracts" | "multicallWrapper">, data: string, _nameOrNames: string | string[], _duration: number, legacy?: boolean | undefined) => Promise<{ + base: BigNumber; + premium: BigNumber; + } | undefined>; +}; +export default _default; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/getProfile.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/getProfile.d.ts new file mode 100644 index 000000000..3c8e53078 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/getProfile.d.ts @@ -0,0 +1,40 @@ +import { ENSArgs } from '..'; +import { DecodedContentHash } from '../utils/contentHash'; +declare type FallbackRecords = { + contentHash?: boolean; + texts?: string[]; + coinTypes?: string[]; +}; +declare type DataItem = { + key: string | number; + type: 'addr' | 'text' | 'contentHash'; + coin?: string; + value: string; +}; +declare type ResolvedProfile = { + isMigrated: boolean | null; + createdAt: string | null; + address?: string; + name?: string | null; + match?: boolean; + message?: string; + records?: { + contentHash?: DecodedContentHash | string | null; + texts?: DataItem[]; + coinTypes?: DataItem[]; + }; + resolverAddress?: string; + isInvalidResolverAddress?: boolean; + reverseResolverAddress?: string; +}; +declare type ProfileOptions = { + contentHash?: boolean; + texts?: boolean | string[]; + coinTypes?: boolean | string[]; +}; +declare type InputProfileOptions = ProfileOptions & { + resolverAddress?: string; + fallback?: FallbackRecords; +}; +export default function ({ contracts, gqlInstance, getName, _getAddr, _getContentHash, _getText, resolverMulticallWrapper, multicallWrapper, }: ENSArgs<'contracts' | 'gqlInstance' | 'getName' | '_getText' | '_getAddr' | '_getContentHash' | 'resolverMulticallWrapper' | 'multicallWrapper'>, nameOrAddress: string, options?: InputProfileOptions): Promise; +export {}; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/getRecords.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/getRecords.d.ts new file mode 100644 index 000000000..757bacf8c --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/getRecords.d.ts @@ -0,0 +1,34 @@ +import { ENSArgs } from '..'; +declare type ProfileOptions = { + contentHash?: boolean; + texts?: boolean | string[]; + coinTypes?: boolean | string[]; + resolverAddress?: string; +}; +export default function ({ getProfile }: ENSArgs<'getProfile'>, name: string, options?: ProfileOptions): Promise<{ + isMigrated: boolean | null; + createdAt: string | null; + address?: string | undefined; + name?: string | null | undefined; + match?: boolean | undefined; + message?: string | undefined; + records?: { + contentHash?: string | import("../utils/contentHash").DecodedContentHash | null | undefined; + texts?: { + key: string | number; + type: "text" | "addr" | "contentHash"; + coin?: string | undefined; + value: string; + }[] | undefined; + coinTypes?: { + key: string | number; + type: "text" | "addr" | "contentHash"; + coin?: string | undefined; + value: string; + }[] | undefined; + } | undefined; + resolverAddress?: string | undefined; + isInvalidResolverAddress?: boolean | undefined; + reverseResolverAddress?: string | undefined; +} | undefined>; +export {}; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/getResolver.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/getResolver.d.ts new file mode 100644 index 000000000..2f3e1617d --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/getResolver.d.ts @@ -0,0 +1,9 @@ +import { ENSArgs } from '..'; +declare const _default: { + raw: ({ contracts }: ENSArgs<"contracts">, name: string) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts }: ENSArgs<"contracts">, data: string) => Promise; +}; +export default _default; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/getSpecificRecord.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/getSpecificRecord.d.ts new file mode 100644 index 000000000..88bad22e2 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/getSpecificRecord.d.ts @@ -0,0 +1,95 @@ +import { ENSArgs } from '..'; +export declare const _getContentHash: { + raw: ({ contracts }: ENSArgs<'contracts'>, name: string) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts }: ENSArgs<'contracts'>, data: string) => Promise<{ + protocolType?: undefined; + decoded?: undefined; + error?: undefined; + } | { + protocolType: null; + decoded: any; + error?: undefined; + } | { + protocolType: string | undefined; + decoded: any; + error: any; + } | undefined>; +}; +export declare const getContentHash: { + raw: ({ contracts, universalWrapper }: ENSArgs<'contracts' | 'universalWrapper'>, name: string) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts, universalWrapper }: ENSArgs<'contracts' | 'universalWrapper'>, data: string) => Promise<{ + protocolType?: undefined; + decoded?: undefined; + error?: undefined; + } | { + protocolType: null; + decoded: any; + error?: undefined; + } | { + protocolType: string | undefined; + decoded: any; + error: any; + } | undefined>; +}; +export declare const _getText: { + raw: ({ contracts }: ENSArgs<'contracts'>, name: string, key: string) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts }: ENSArgs<'contracts'>, data: string) => Promise; +}; +export declare const getText: { + raw: ({ contracts, universalWrapper }: ENSArgs<'contracts' | 'universalWrapper'>, name: string, key: string) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts, universalWrapper }: ENSArgs<'contracts' | 'universalWrapper'>, data: string) => Promise; +}; +export declare const _getAddr: { + raw: ({ contracts }: ENSArgs<'contracts'>, name: string, coinType?: string | number, bypassFormat?: boolean) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts }: ENSArgs<'contracts'>, data: string, _name: string, coinType?: string | number) => Promise; +}; +export declare const getAddr: { + raw: ({ contracts, universalWrapper }: ENSArgs<'contracts' | 'universalWrapper'>, name: string, coinType?: string | number) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts, universalWrapper }: ENSArgs<'contracts' | 'universalWrapper'>, data: string, _name: string, coinType?: string | number) => Promise; +}; +export declare const _getABI: { + raw: ({ contracts }: ENSArgs<'contracts'>, name: string) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts }: ENSArgs<'contracts'>, data: string) => Promise<{ + contentType: number; + decoded: boolean; + abi: string | object; + } | undefined>; +}; +export declare const getABI: { + raw: ({ contracts, universalWrapper }: ENSArgs<'contracts' | 'universalWrapper'>, name: string) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts, universalWrapper }: ENSArgs<'contracts' | 'universalWrapper'>, data: string) => Promise<{ + contentType: number; + decoded: boolean; + abi: string | object; + } | undefined>; +}; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/getSubnames.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/getSubnames.d.ts new file mode 100644 index 000000000..05d5a23bb --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/getSubnames.d.ts @@ -0,0 +1,26 @@ +import { ENSArgs } from '..'; +declare type Subname = { + id: string; + labelName: string | null; + truncatedName?: string; + labelhash: string; + isMigrated: boolean; + name: string; + owner: { + id: string; + }; +}; +declare type Params = { + name: string; + page?: number; + pageSize?: number; + orderDirection?: 'asc' | 'desc'; + orderBy?: 'createdAt' | 'labelName'; + lastSubnames?: Array; + search?: string; +}; +declare const getSubnames: (injected: ENSArgs<'gqlInstance'>, functionArgs: Params) => Promise<{ + subnames: Subname[]; + subnameCount: number; +}>; +export default getSubnames; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/getWrapperData.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/getWrapperData.d.ts new file mode 100644 index 000000000..c2048265e --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/getWrapperData.d.ts @@ -0,0 +1,54 @@ +import { ENSArgs } from '../index'; +declare const _default: { + raw: ({ contracts }: ENSArgs<"contracts">, name: string) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts }: ENSArgs<"contracts">, data: string) => Promise<{ + expiryDate: Date | undefined; + rawFuses: number; + owner: string; + parent: { + unnamed: { + 524288: boolean; + 1048576: boolean; + 2097152: boolean; + 4194304: boolean; + 8388608: boolean; + 16777216: boolean; + 33554432: boolean; + 67108864: boolean; + 134217728: boolean; + 268435456: boolean; + 536870912: boolean; + 1073741824: boolean; + 2147483648: boolean; + }; + IS_DOT_ETH: boolean; + PARENT_CANNOT_CONTROL: boolean; + CAN_EXTEND_EXPIRY: boolean; + }; + child: { + CAN_DO_EVERYTHING: boolean; + unnamed: { + 1024: boolean; + 64: boolean; + 128: boolean; + 256: boolean; + 512: boolean; + 2048: boolean; + 4096: boolean; + 8192: boolean; + 16384: boolean; + 32768: boolean; + }; + CANNOT_UNWRAP: boolean; + CANNOT_BURN_FUSES: boolean; + CANNOT_TRANSFER: boolean; + CANNOT_SET_RESOLVER: boolean; + CANNOT_SET_TTL: boolean; + CANNOT_CREATE_SUBDOMAIN: boolean; + }; + } | undefined>; +}; +export default _default; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/importDNSSECName.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/importDNSSECName.d.ts new file mode 100644 index 000000000..2345ef1a2 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/importDNSSECName.d.ts @@ -0,0 +1,7 @@ +import type { ENSArgs } from '..'; +export declare const DNS_OVER_HTTP_ENDPOINT = "https://1.1.1.1/dns-query"; +export declare type ImportDNSSECNameProps = { + address: string; + proverResult: any; +}; +export default function ({ contracts, provider }: ENSArgs<'contracts' | 'signer' | 'provider'>, name: string, { address, proverResult }: ImportDNSSECNameProps): Promise; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/initialGetters.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/initialGetters.d.ts new file mode 100644 index 000000000..9534281c5 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/initialGetters.d.ts @@ -0,0 +1,12 @@ +export { default as batch } from './batch'; +export * from './batchWrappers'; +export { default as getExpiry } from './getExpiry'; +export { default as getName } from './getName'; +export { default as getNames } from './getNames'; +export { default as getOwner } from './getOwner'; +export { default as getPrice } from './getPrice'; +export { default as getProfile } from './getProfile'; +export { default as getRecords } from './getRecords'; +export * from './getSpecificRecord'; +export { default as getSubnames } from './getSubnames'; +export { default as supportsTLD } from './supportsTLD'; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/registerName.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/registerName.d.ts new file mode 100644 index 000000000..ecf8fa70a --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/registerName.d.ts @@ -0,0 +1,8 @@ +import { BigNumber } from '@ethersproject/bignumber/lib/bignumber'; +import { ENSArgs } from '..'; +import { BaseRegistrationParams } from '../utils/registerHelpers'; +declare type Params = BaseRegistrationParams & { + value: BigNumber; +}; +export default function ({ contracts }: ENSArgs<'contracts'>, name: string, { resolverAddress, value, ...params }: Params): Promise; +export {}; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/renewNames.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/renewNames.d.ts new file mode 100644 index 000000000..bf1592f48 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/renewNames.d.ts @@ -0,0 +1,12 @@ +import { BigNumber, BigNumberish } from '@ethersproject/bignumber/lib/bignumber'; +import { ENSArgs } from '..'; +declare type BaseProps = { + duration: number; + value: BigNumber; +}; +declare type WrappedProps = { + duration: BigNumberish; +}; +export declare function extendWrappedName({ contracts }: ENSArgs<'contracts'>, name: string, options?: WrappedProps): Promise; +export default function ({ contracts }: ENSArgs<'contracts'>, nameOrNames: string | string[], { duration, value }: BaseProps): Promise; +export {}; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/setFuses.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/setFuses.d.ts new file mode 100644 index 000000000..a9982b17e --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/setFuses.d.ts @@ -0,0 +1,7 @@ +import { ENSArgs } from '../index'; +import { CombinedFuseInput } from '../utils/fuses'; +export declare function setChildFuses({ contracts, signer }: ENSArgs<'contracts' | 'signer'>, name: string, { fuses, expiry, }: { + fuses: Partial | number; + expiry?: number; +}): Promise; +export default function ({ contracts, signer }: ENSArgs<'contracts' | 'signer'>, name: string, props: CombinedFuseInput['child']): Promise; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/setName.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/setName.d.ts new file mode 100644 index 000000000..270914226 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/setName.d.ts @@ -0,0 +1,5 @@ +import { ENSArgs } from '..'; +export default function ({ contracts, signer }: ENSArgs<'contracts' | 'signer'>, name: string, { address, resolver, }?: { + address?: string; + resolver?: string; +}): Promise; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/setRecord.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/setRecord.d.ts new file mode 100644 index 000000000..2878808a7 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/setRecord.d.ts @@ -0,0 +1,22 @@ +import { ENSArgs } from '..'; +import { RecordInput } from '../utils/recordHelpers'; +declare type BaseInput = { + resolverAddress?: string; +}; +declare type ContentHashInput = { + record: RecordInput<'contentHash'>; + type: 'contentHash'; +}; +declare type AddrOrTextInput = { + record: RecordInput<'addr' | 'text'>; + type: 'addr' | 'text'; +}; +declare type ABIInput = { + record: RecordInput<'abi'>; + type: 'abi'; +}; +export default function ({ contracts, provider, getResolver, signer, }: ENSArgs<'contracts' | 'provider' | 'getResolver' | 'signer'>, name: string, { record, type, resolverAddress, }: BaseInput & (ContentHashInput | AddrOrTextInput | ABIInput)): Promise<{ + to: string; + data: string; +}>; +export {}; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/setRecords.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/setRecords.d.ts new file mode 100644 index 000000000..58b0935a5 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/setRecords.d.ts @@ -0,0 +1,6 @@ +import { ENSArgs } from '..'; +import { RecordOptions } from '../utils/recordHelpers'; +export default function ({ contracts, provider, getResolver, signer, }: ENSArgs<'contracts' | 'provider' | 'getResolver' | 'signer'>, name: string, { records, resolverAddress, }: { + records: RecordOptions; + resolverAddress?: string; +}): Promise; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/setResolver.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/setResolver.d.ts new file mode 100644 index 000000000..32cad2468 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/setResolver.d.ts @@ -0,0 +1,5 @@ +import { ENSArgs } from '..'; +export default function ({ contracts, signer }: ENSArgs<'contracts' | 'signer'>, name: string, { contract, resolver, }: { + contract: 'registry' | 'nameWrapper'; + resolver?: string; +}): Promise; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/supportsTLD.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/supportsTLD.d.ts new file mode 100644 index 000000000..cf78bbb72 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/supportsTLD.d.ts @@ -0,0 +1,2 @@ +import { ENSArgs } from '..'; +export default function ({ getOwner, provider }: ENSArgs<'getOwner' | 'provider'>, name: string): Promise; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/transferController.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/transferController.d.ts new file mode 100644 index 000000000..333bdd8bb --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/transferController.d.ts @@ -0,0 +1,5 @@ +import { ENSArgs } from '..'; +export default function ({ contracts, signer }: ENSArgs<'contracts' | 'signer'>, name: string, { newOwner, isOwner, }: { + newOwner: string; + isOwner: boolean; +}): Promise; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/transferName.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/transferName.d.ts new file mode 100644 index 000000000..144ea566a --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/transferName.d.ts @@ -0,0 +1,6 @@ +import { ENSArgs } from '..'; +export default function ({ contracts, signer }: ENSArgs<'contracts' | 'signer'>, name: string, { newOwner, contract, reclaim, }: { + newOwner: string; + contract: 'registry' | 'nameWrapper' | 'baseRegistrar'; + reclaim?: boolean; +}): Promise; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/transferSubname.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/transferSubname.d.ts new file mode 100644 index 000000000..68f189365 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/transferSubname.d.ts @@ -0,0 +1,14 @@ +import { ENSArgs } from '..'; +import { Expiry } from '../utils/wrapper'; +declare type BaseArgs = { + owner: string; + resolverAddress?: string; + contract: 'registry' | 'nameWrapper'; +}; +declare type NameWrapperArgs = { + contract: 'nameWrapper'; + expiry?: Expiry; +} & BaseArgs; +declare type Args = BaseArgs | NameWrapperArgs; +export default function ({ contracts, signer, getExpiry, }: ENSArgs<'contracts' | 'signer' | 'getExpiry'>, name: string, { contract, owner, resolverAddress, ...wrapperArgs }: Args): Promise; +export {}; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/types.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/types.d.ts new file mode 100644 index 000000000..ebaa5973d --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/types.d.ts @@ -0,0 +1,81 @@ +import type batch from './batch'; +import type { multicallWrapper, resolverMulticallWrapper, universalWrapper } from './batchWrappers'; +import type commitName from './commitName'; +import type createSubname from './createSubname'; +import type deleteSubname from './deleteSubname'; +import type getAvailable from './getAvailable'; +import type getDNSOwner from './getDNSOwner'; +import type getExpiry from './getExpiry'; +import type { getHistory } from './getHistory'; +import type getName from './getName'; +import type getNames from './getNames'; +import type getOwner from './getOwner'; +import type getPrice from './getPrice'; +import type getProfile from './getProfile'; +import type getRecords from './getRecords'; +import type getResolver from './getResolver'; +import type { getABI, getAddr, getContentHash, getText, _getABI, _getAddr, _getContentHash, _getText } from './getSpecificRecord'; +import type getSubnames from './getSubnames'; +import type getWrapperData from './getWrapperData'; +import type importDNSSECName from './importDNSSECName'; +import type registerName from './registerName'; +import type { default as renewNames, extendWrappedName } from './renewNames'; +import type setFuses from './setFuses'; +import type { setChildFuses } from './setFuses'; +import type setName from './setName'; +import type setRecord from './setRecord'; +import type setRecords from './setRecords'; +import type setResolver from './setResolver'; +import type supportsTLD from './supportsTLD'; +import type transferController from './transferController'; +import type transferName from './transferName'; +import type transferSubname from './transferSubname'; +import type unwrapName from './unwrapName'; +import type wrapName from './wrapName'; +declare type Function = { + batch: typeof batch; + multicallWrapper: typeof multicallWrapper; + resolverMulticallWrapper: typeof resolverMulticallWrapper; + universalWrapper: typeof universalWrapper; + setFuses: typeof setFuses; + setChildFuses: typeof setChildFuses; + commitName: typeof commitName; + createSubname: typeof createSubname; + deleteSubname: typeof deleteSubname; + getAvailable: typeof getAvailable; + getDNSOwner: typeof getDNSOwner; + getExpiry: typeof getExpiry; + getHistory: typeof getHistory; + getName: typeof getName; + getNames: typeof getNames; + getOwner: typeof getOwner; + getPrice: typeof getPrice; + getProfile: typeof getProfile; + getRecords: typeof getRecords; + getResolver: typeof getResolver; + getAddr: typeof getAddr; + getContentHash: typeof getContentHash; + getText: typeof getText; + getABI: typeof getABI; + _getAddr: typeof _getAddr; + _getContentHash: typeof _getContentHash; + _getText: typeof _getText; + _getABI: typeof _getABI; + getSubnames: typeof getSubnames; + getWrapperData: typeof getWrapperData; + importDNSSECName: typeof importDNSSECName; + registerName: typeof registerName; + renewNames: typeof renewNames; + extendWrappedName: typeof extendWrappedName; + setName: typeof setName; + setRecord: typeof setRecord; + setRecords: typeof setRecords; + setResolver: typeof setResolver; + supportsTLD: typeof supportsTLD; + transferController: typeof transferController; + transferName: typeof transferName; + transferSubname: typeof transferSubname; + unwrapName: typeof unwrapName; + wrapName: typeof wrapName; +}; +export default Function; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/unwrapName.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/unwrapName.d.ts new file mode 100644 index 000000000..30ea20fc9 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/unwrapName.d.ts @@ -0,0 +1,5 @@ +import { ENSArgs } from '..'; +export default function ({ contracts, signer }: ENSArgs<'contracts' | 'signer'>, name: string, { newController, newRegistrant, }: { + newController: string; + newRegistrant?: string; +}): Promise; diff --git a/.yalc/@ensdomains/ensjs/dist/types/functions/wrapName.d.ts b/.yalc/@ensdomains/ensjs/dist/types/functions/wrapName.d.ts new file mode 100644 index 000000000..804c087f9 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/functions/wrapName.d.ts @@ -0,0 +1,9 @@ +import { ENSArgs } from '..'; +import { CombinedFuseInput } from '../utils/fuses'; +import { Expiry } from '../utils/wrapper'; +export default function ({ contracts, signer }: ENSArgs<'contracts' | 'signer'>, name: string, { wrappedOwner, fuseOptions, expiry, resolverAddress, }: { + wrappedOwner: string; + fuseOptions?: Partial | number; + expiry?: Expiry; + resolverAddress?: string; +}): Promise; diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/BaseRegistrarImplementation.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/BaseRegistrarImplementation.d.ts new file mode 100644 index 000000000..b9e93c406 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/BaseRegistrarImplementation.d.ts @@ -0,0 +1,512 @@ +import type { EventFragment, FunctionFragment, Result } from '@ethersproject/abi'; +import { Interface } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/abstract-provider'; +import type { Signer } from '@ethersproject/abstract-signer'; +import type { BigNumber, BigNumberish } from '@ethersproject/bignumber'; +import type { BytesLike } from '@ethersproject/bytes'; +import type { BaseContract, CallOverrides, ContractTransaction, Overrides, PopulatedTransaction } from '@ethersproject/contracts'; +import type { OnEvent, PromiseOrValue, TypedEvent, TypedEventFilter, TypedListener } from './common'; +export interface BaseRegistrarImplementationInterface extends Interface { + functions: { + 'GRACE_PERIOD()': FunctionFragment; + 'addController(address)': FunctionFragment; + 'approve(address,uint256)': FunctionFragment; + 'available(uint256)': FunctionFragment; + 'balanceOf(address)': FunctionFragment; + 'baseNode()': FunctionFragment; + 'controllers(address)': FunctionFragment; + 'ens()': FunctionFragment; + 'getApproved(uint256)': FunctionFragment; + 'isApprovedForAll(address,address)': FunctionFragment; + 'isOwner()': FunctionFragment; + 'nameExpires(uint256)': FunctionFragment; + 'owner()': FunctionFragment; + 'ownerOf(uint256)': FunctionFragment; + 'reclaim(uint256,address)': FunctionFragment; + 'register(uint256,address,uint256)': FunctionFragment; + 'registerOnly(uint256,address,uint256)': FunctionFragment; + 'removeController(address)': FunctionFragment; + 'renew(uint256,uint256)': FunctionFragment; + 'renounceOwnership()': FunctionFragment; + 'safeTransferFrom(address,address,uint256)': FunctionFragment; + 'safeTransferFrom(address,address,uint256,bytes)': FunctionFragment; + 'setApprovalForAll(address,bool)': FunctionFragment; + 'setResolver(address)': FunctionFragment; + 'supportsInterface(bytes4)': FunctionFragment; + 'transferFrom(address,address,uint256)': FunctionFragment; + 'transferOwnership(address)': FunctionFragment; + }; + getFunction(nameOrSignatureOrTopic: 'GRACE_PERIOD' | 'addController' | 'approve' | 'available' | 'balanceOf' | 'baseNode' | 'controllers' | 'ens' | 'getApproved' | 'isApprovedForAll' | 'isOwner' | 'nameExpires' | 'owner' | 'ownerOf' | 'reclaim' | 'register' | 'registerOnly' | 'removeController' | 'renew' | 'renounceOwnership' | 'safeTransferFrom(address,address,uint256)' | 'safeTransferFrom(address,address,uint256,bytes)' | 'setApprovalForAll' | 'setResolver' | 'supportsInterface' | 'transferFrom' | 'transferOwnership'): FunctionFragment; + encodeFunctionData(functionFragment: 'GRACE_PERIOD', values?: undefined): string; + encodeFunctionData(functionFragment: 'addController', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'approve', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'available', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'balanceOf', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'baseNode', values?: undefined): string; + encodeFunctionData(functionFragment: 'controllers', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'ens', values?: undefined): string; + encodeFunctionData(functionFragment: 'getApproved', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'isApprovedForAll', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'isOwner', values?: undefined): string; + encodeFunctionData(functionFragment: 'nameExpires', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'owner', values?: undefined): string; + encodeFunctionData(functionFragment: 'ownerOf', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'reclaim', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'register', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'registerOnly', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'removeController', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'renew', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'renounceOwnership', values?: undefined): string; + encodeFunctionData(functionFragment: 'safeTransferFrom(address,address,uint256)', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'safeTransferFrom(address,address,uint256,bytes)', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'setApprovalForAll', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setResolver', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'supportsInterface', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'transferFrom', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'transferOwnership', values: [PromiseOrValue]): string; + decodeFunctionResult(functionFragment: 'GRACE_PERIOD', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'addController', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'approve', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'available', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'baseNode', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'controllers', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'ens', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getApproved', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'isApprovedForAll', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'isOwner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'nameExpires', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'ownerOf', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'reclaim', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'register', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'registerOnly', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'removeController', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'renew', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'renounceOwnership', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'safeTransferFrom(address,address,uint256)', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'safeTransferFrom(address,address,uint256,bytes)', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setApprovalForAll', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setResolver', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'supportsInterface', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferFrom', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferOwnership', data: BytesLike): Result; + events: { + 'Approval(address,address,uint256)': EventFragment; + 'ApprovalForAll(address,address,bool)': EventFragment; + 'ControllerAdded(address)': EventFragment; + 'ControllerRemoved(address)': EventFragment; + 'NameMigrated(uint256,address,uint256)': EventFragment; + 'NameRegistered(uint256,address,uint256)': EventFragment; + 'NameRenewed(uint256,uint256)': EventFragment; + 'OwnershipTransferred(address,address)': EventFragment; + 'Transfer(address,address,uint256)': EventFragment; + }; + getEvent(nameOrSignatureOrTopic: 'Approval'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'ApprovalForAll'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'ControllerAdded'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'ControllerRemoved'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'NameMigrated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'NameRegistered'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'NameRenewed'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OwnershipTransferred'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Transfer'): EventFragment; +} +export interface ApprovalEventObject { + owner: string; + approved: string; + tokenId: BigNumber; +} +export declare type ApprovalEvent = TypedEvent<[ + string, + string, + BigNumber +], ApprovalEventObject>; +export declare type ApprovalEventFilter = TypedEventFilter; +export interface ApprovalForAllEventObject { + owner: string; + operator: string; + approved: boolean; +} +export declare type ApprovalForAllEvent = TypedEvent<[ + string, + string, + boolean +], ApprovalForAllEventObject>; +export declare type ApprovalForAllEventFilter = TypedEventFilter; +export interface ControllerAddedEventObject { + controller: string; +} +export declare type ControllerAddedEvent = TypedEvent<[ + string +], ControllerAddedEventObject>; +export declare type ControllerAddedEventFilter = TypedEventFilter; +export interface ControllerRemovedEventObject { + controller: string; +} +export declare type ControllerRemovedEvent = TypedEvent<[ + string +], ControllerRemovedEventObject>; +export declare type ControllerRemovedEventFilter = TypedEventFilter; +export interface NameMigratedEventObject { + id: BigNumber; + owner: string; + expires: BigNumber; +} +export declare type NameMigratedEvent = TypedEvent<[ + BigNumber, + string, + BigNumber +], NameMigratedEventObject>; +export declare type NameMigratedEventFilter = TypedEventFilter; +export interface NameRegisteredEventObject { + id: BigNumber; + owner: string; + expires: BigNumber; +} +export declare type NameRegisteredEvent = TypedEvent<[ + BigNumber, + string, + BigNumber +], NameRegisteredEventObject>; +export declare type NameRegisteredEventFilter = TypedEventFilter; +export interface NameRenewedEventObject { + id: BigNumber; + expires: BigNumber; +} +export declare type NameRenewedEvent = TypedEvent<[ + BigNumber, + BigNumber +], NameRenewedEventObject>; +export declare type NameRenewedEventFilter = TypedEventFilter; +export interface OwnershipTransferredEventObject { + previousOwner: string; + newOwner: string; +} +export declare type OwnershipTransferredEvent = TypedEvent<[ + string, + string +], OwnershipTransferredEventObject>; +export declare type OwnershipTransferredEventFilter = TypedEventFilter; +export interface TransferEventObject { + from: string; + to: string; + tokenId: BigNumber; +} +export declare type TransferEvent = TypedEvent<[ + string, + string, + BigNumber +], TransferEventObject>; +export declare type TransferEventFilter = TypedEventFilter; +export interface BaseRegistrarImplementation extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + interface: BaseRegistrarImplementationInterface; + queryFilter(event: TypedEventFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>; + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + functions: { + GRACE_PERIOD(overrides?: CallOverrides): Promise<[BigNumber]>; + addController(controller: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + approve(to: PromiseOrValue, tokenId: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + available(id: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + balanceOf(owner: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; + baseNode(overrides?: CallOverrides): Promise<[string]>; + controllers(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + ens(overrides?: CallOverrides): Promise<[string]>; + getApproved(tokenId: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + isApprovedForAll(owner: PromiseOrValue, operator: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + isOwner(overrides?: CallOverrides): Promise<[boolean]>; + nameExpires(id: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; + owner(overrides?: CallOverrides): Promise<[string]>; + ownerOf(tokenId: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + reclaim(id: PromiseOrValue, owner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + register(id: PromiseOrValue, owner: PromiseOrValue, duration: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + registerOnly(id: PromiseOrValue, owner: PromiseOrValue, duration: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + removeController(controller: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + renew(id: PromiseOrValue, duration: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + renounceOwnership(overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + 'safeTransferFrom(address,address,uint256)'(from: PromiseOrValue, to: PromiseOrValue, tokenId: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + 'safeTransferFrom(address,address,uint256,bytes)'(from: PromiseOrValue, to: PromiseOrValue, tokenId: PromiseOrValue, _data: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setApprovalForAll(to: PromiseOrValue, approved: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setResolver(resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + transferFrom(from: PromiseOrValue, to: PromiseOrValue, tokenId: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + }; + GRACE_PERIOD(overrides?: CallOverrides): Promise; + addController(controller: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + approve(to: PromiseOrValue, tokenId: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + available(id: PromiseOrValue, overrides?: CallOverrides): Promise; + balanceOf(owner: PromiseOrValue, overrides?: CallOverrides): Promise; + baseNode(overrides?: CallOverrides): Promise; + controllers(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + ens(overrides?: CallOverrides): Promise; + getApproved(tokenId: PromiseOrValue, overrides?: CallOverrides): Promise; + isApprovedForAll(owner: PromiseOrValue, operator: PromiseOrValue, overrides?: CallOverrides): Promise; + isOwner(overrides?: CallOverrides): Promise; + nameExpires(id: PromiseOrValue, overrides?: CallOverrides): Promise; + owner(overrides?: CallOverrides): Promise; + ownerOf(tokenId: PromiseOrValue, overrides?: CallOverrides): Promise; + reclaim(id: PromiseOrValue, owner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + register(id: PromiseOrValue, owner: PromiseOrValue, duration: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + registerOnly(id: PromiseOrValue, owner: PromiseOrValue, duration: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + removeController(controller: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + renew(id: PromiseOrValue, duration: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + renounceOwnership(overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + 'safeTransferFrom(address,address,uint256)'(from: PromiseOrValue, to: PromiseOrValue, tokenId: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + 'safeTransferFrom(address,address,uint256,bytes)'(from: PromiseOrValue, to: PromiseOrValue, tokenId: PromiseOrValue, _data: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setApprovalForAll(to: PromiseOrValue, approved: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setResolver(resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + transferFrom(from: PromiseOrValue, to: PromiseOrValue, tokenId: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + callStatic: { + GRACE_PERIOD(overrides?: CallOverrides): Promise; + addController(controller: PromiseOrValue, overrides?: CallOverrides): Promise; + approve(to: PromiseOrValue, tokenId: PromiseOrValue, overrides?: CallOverrides): Promise; + available(id: PromiseOrValue, overrides?: CallOverrides): Promise; + balanceOf(owner: PromiseOrValue, overrides?: CallOverrides): Promise; + baseNode(overrides?: CallOverrides): Promise; + controllers(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + ens(overrides?: CallOverrides): Promise; + getApproved(tokenId: PromiseOrValue, overrides?: CallOverrides): Promise; + isApprovedForAll(owner: PromiseOrValue, operator: PromiseOrValue, overrides?: CallOverrides): Promise; + isOwner(overrides?: CallOverrides): Promise; + nameExpires(id: PromiseOrValue, overrides?: CallOverrides): Promise; + owner(overrides?: CallOverrides): Promise; + ownerOf(tokenId: PromiseOrValue, overrides?: CallOverrides): Promise; + reclaim(id: PromiseOrValue, owner: PromiseOrValue, overrides?: CallOverrides): Promise; + register(id: PromiseOrValue, owner: PromiseOrValue, duration: PromiseOrValue, overrides?: CallOverrides): Promise; + registerOnly(id: PromiseOrValue, owner: PromiseOrValue, duration: PromiseOrValue, overrides?: CallOverrides): Promise; + removeController(controller: PromiseOrValue, overrides?: CallOverrides): Promise; + renew(id: PromiseOrValue, duration: PromiseOrValue, overrides?: CallOverrides): Promise; + renounceOwnership(overrides?: CallOverrides): Promise; + 'safeTransferFrom(address,address,uint256)'(from: PromiseOrValue, to: PromiseOrValue, tokenId: PromiseOrValue, overrides?: CallOverrides): Promise; + 'safeTransferFrom(address,address,uint256,bytes)'(from: PromiseOrValue, to: PromiseOrValue, tokenId: PromiseOrValue, _data: PromiseOrValue, overrides?: CallOverrides): Promise; + setApprovalForAll(to: PromiseOrValue, approved: PromiseOrValue, overrides?: CallOverrides): Promise; + setResolver(resolver: PromiseOrValue, overrides?: CallOverrides): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + transferFrom(from: PromiseOrValue, to: PromiseOrValue, tokenId: PromiseOrValue, overrides?: CallOverrides): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + filters: { + 'Approval(address,address,uint256)'(owner?: PromiseOrValue | null, approved?: PromiseOrValue | null, tokenId?: PromiseOrValue | null): ApprovalEventFilter; + Approval(owner?: PromiseOrValue | null, approved?: PromiseOrValue | null, tokenId?: PromiseOrValue | null): ApprovalEventFilter; + 'ApprovalForAll(address,address,bool)'(owner?: PromiseOrValue | null, operator?: PromiseOrValue | null, approved?: null): ApprovalForAllEventFilter; + ApprovalForAll(owner?: PromiseOrValue | null, operator?: PromiseOrValue | null, approved?: null): ApprovalForAllEventFilter; + 'ControllerAdded(address)'(controller?: PromiseOrValue | null): ControllerAddedEventFilter; + ControllerAdded(controller?: PromiseOrValue | null): ControllerAddedEventFilter; + 'ControllerRemoved(address)'(controller?: PromiseOrValue | null): ControllerRemovedEventFilter; + ControllerRemoved(controller?: PromiseOrValue | null): ControllerRemovedEventFilter; + 'NameMigrated(uint256,address,uint256)'(id?: PromiseOrValue | null, owner?: PromiseOrValue | null, expires?: null): NameMigratedEventFilter; + NameMigrated(id?: PromiseOrValue | null, owner?: PromiseOrValue | null, expires?: null): NameMigratedEventFilter; + 'NameRegistered(uint256,address,uint256)'(id?: PromiseOrValue | null, owner?: PromiseOrValue | null, expires?: null): NameRegisteredEventFilter; + NameRegistered(id?: PromiseOrValue | null, owner?: PromiseOrValue | null, expires?: null): NameRegisteredEventFilter; + 'NameRenewed(uint256,uint256)'(id?: PromiseOrValue | null, expires?: null): NameRenewedEventFilter; + NameRenewed(id?: PromiseOrValue | null, expires?: null): NameRenewedEventFilter; + 'OwnershipTransferred(address,address)'(previousOwner?: PromiseOrValue | null, newOwner?: PromiseOrValue | null): OwnershipTransferredEventFilter; + OwnershipTransferred(previousOwner?: PromiseOrValue | null, newOwner?: PromiseOrValue | null): OwnershipTransferredEventFilter; + 'Transfer(address,address,uint256)'(from?: PromiseOrValue | null, to?: PromiseOrValue | null, tokenId?: PromiseOrValue | null): TransferEventFilter; + Transfer(from?: PromiseOrValue | null, to?: PromiseOrValue | null, tokenId?: PromiseOrValue | null): TransferEventFilter; + }; + estimateGas: { + GRACE_PERIOD(overrides?: CallOverrides): Promise; + addController(controller: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + approve(to: PromiseOrValue, tokenId: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + available(id: PromiseOrValue, overrides?: CallOverrides): Promise; + balanceOf(owner: PromiseOrValue, overrides?: CallOverrides): Promise; + baseNode(overrides?: CallOverrides): Promise; + controllers(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + ens(overrides?: CallOverrides): Promise; + getApproved(tokenId: PromiseOrValue, overrides?: CallOverrides): Promise; + isApprovedForAll(owner: PromiseOrValue, operator: PromiseOrValue, overrides?: CallOverrides): Promise; + isOwner(overrides?: CallOverrides): Promise; + nameExpires(id: PromiseOrValue, overrides?: CallOverrides): Promise; + owner(overrides?: CallOverrides): Promise; + ownerOf(tokenId: PromiseOrValue, overrides?: CallOverrides): Promise; + reclaim(id: PromiseOrValue, owner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + register(id: PromiseOrValue, owner: PromiseOrValue, duration: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + registerOnly(id: PromiseOrValue, owner: PromiseOrValue, duration: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + removeController(controller: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + renew(id: PromiseOrValue, duration: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + renounceOwnership(overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + 'safeTransferFrom(address,address,uint256)'(from: PromiseOrValue, to: PromiseOrValue, tokenId: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + 'safeTransferFrom(address,address,uint256,bytes)'(from: PromiseOrValue, to: PromiseOrValue, tokenId: PromiseOrValue, _data: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setApprovalForAll(to: PromiseOrValue, approved: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setResolver(resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + transferFrom(from: PromiseOrValue, to: PromiseOrValue, tokenId: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + }; + populateTransaction: { + GRACE_PERIOD(overrides?: CallOverrides): Promise; + addController(controller: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + approve(to: PromiseOrValue, tokenId: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + available(id: PromiseOrValue, overrides?: CallOverrides): Promise; + balanceOf(owner: PromiseOrValue, overrides?: CallOverrides): Promise; + baseNode(overrides?: CallOverrides): Promise; + controllers(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + ens(overrides?: CallOverrides): Promise; + getApproved(tokenId: PromiseOrValue, overrides?: CallOverrides): Promise; + isApprovedForAll(owner: PromiseOrValue, operator: PromiseOrValue, overrides?: CallOverrides): Promise; + isOwner(overrides?: CallOverrides): Promise; + nameExpires(id: PromiseOrValue, overrides?: CallOverrides): Promise; + owner(overrides?: CallOverrides): Promise; + ownerOf(tokenId: PromiseOrValue, overrides?: CallOverrides): Promise; + reclaim(id: PromiseOrValue, owner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + register(id: PromiseOrValue, owner: PromiseOrValue, duration: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + registerOnly(id: PromiseOrValue, owner: PromiseOrValue, duration: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + removeController(controller: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + renew(id: PromiseOrValue, duration: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + renounceOwnership(overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + 'safeTransferFrom(address,address,uint256)'(from: PromiseOrValue, to: PromiseOrValue, tokenId: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + 'safeTransferFrom(address,address,uint256,bytes)'(from: PromiseOrValue, to: PromiseOrValue, tokenId: PromiseOrValue, _data: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setApprovalForAll(to: PromiseOrValue, approved: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setResolver(resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + transferFrom(from: PromiseOrValue, to: PromiseOrValue, tokenId: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/BulkRenewal.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/BulkRenewal.d.ts new file mode 100644 index 000000000..d053242be --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/BulkRenewal.d.ts @@ -0,0 +1,80 @@ +import type { FunctionFragment, Result } from '@ethersproject/abi'; +import { Interface } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/abstract-provider'; +import type { Signer } from '@ethersproject/abstract-signer'; +import type { BigNumber, BigNumberish } from '@ethersproject/bignumber'; +import type { BytesLike } from '@ethersproject/bytes'; +import type { BaseContract, CallOverrides, ContractTransaction, PayableOverrides, PopulatedTransaction } from '@ethersproject/contracts'; +import type { OnEvent, PromiseOrValue, TypedEvent, TypedEventFilter, TypedListener } from './common'; +export interface BulkRenewalInterface extends Interface { + functions: { + 'ens()': FunctionFragment; + 'renewAll(string[],uint256)': FunctionFragment; + 'rentPrice(string[],uint256)': FunctionFragment; + 'supportsInterface(bytes4)': FunctionFragment; + }; + getFunction(nameOrSignatureOrTopic: 'ens' | 'renewAll' | 'rentPrice' | 'supportsInterface'): FunctionFragment; + encodeFunctionData(functionFragment: 'ens', values?: undefined): string; + encodeFunctionData(functionFragment: 'renewAll', values: [PromiseOrValue[], PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'rentPrice', values: [PromiseOrValue[], PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'supportsInterface', values: [PromiseOrValue]): string; + decodeFunctionResult(functionFragment: 'ens', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'renewAll', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'rentPrice', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'supportsInterface', data: BytesLike): Result; + events: {}; +} +export interface BulkRenewal extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + interface: BulkRenewalInterface; + queryFilter(event: TypedEventFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>; + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + functions: { + ens(overrides?: CallOverrides): Promise<[string]>; + renewAll(names: PromiseOrValue[], duration: PromiseOrValue, overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + rentPrice(names: PromiseOrValue[], duration: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber] & { + total: BigNumber; + }>; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + }; + ens(overrides?: CallOverrides): Promise; + renewAll(names: PromiseOrValue[], duration: PromiseOrValue, overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + rentPrice(names: PromiseOrValue[], duration: PromiseOrValue, overrides?: CallOverrides): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + callStatic: { + ens(overrides?: CallOverrides): Promise; + renewAll(names: PromiseOrValue[], duration: PromiseOrValue, overrides?: CallOverrides): Promise; + rentPrice(names: PromiseOrValue[], duration: PromiseOrValue, overrides?: CallOverrides): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + filters: {}; + estimateGas: { + ens(overrides?: CallOverrides): Promise; + renewAll(names: PromiseOrValue[], duration: PromiseOrValue, overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + rentPrice(names: PromiseOrValue[], duration: PromiseOrValue, overrides?: CallOverrides): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + populateTransaction: { + ens(overrides?: CallOverrides): Promise; + renewAll(names: PromiseOrValue[], duration: PromiseOrValue, overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + rentPrice(names: PromiseOrValue[], duration: PromiseOrValue, overrides?: CallOverrides): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/DNSRegistrar.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/DNSRegistrar.d.ts new file mode 100644 index 000000000..07da3941b --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/DNSRegistrar.d.ts @@ -0,0 +1,228 @@ +import type { EventFragment, FunctionFragment, Result } from '@ethersproject/abi'; +import { Interface } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/abstract-provider'; +import type { Signer } from '@ethersproject/abstract-signer'; +import type { BigNumber } from '@ethersproject/bignumber'; +import type { BytesLike } from '@ethersproject/bytes'; +import type { BaseContract, CallOverrides, ContractTransaction, Overrides, PopulatedTransaction } from '@ethersproject/contracts'; +import type { OnEvent, PromiseOrValue, TypedEvent, TypedEventFilter, TypedListener } from './common'; +export declare namespace DNSSEC { + type RRSetWithSignatureStruct = { + rrset: PromiseOrValue; + sig: PromiseOrValue; + }; + type RRSetWithSignatureStructOutput = [string, string] & { + rrset: string; + sig: string; + }; +} +export interface DNSRegistrarInterface extends Interface { + functions: { + 'claim(bytes,bytes)': FunctionFragment; + 'ens()': FunctionFragment; + 'oracle()': FunctionFragment; + 'proveAndClaim(bytes,(bytes,bytes)[],bytes)': FunctionFragment; + 'proveAndClaimWithResolver(bytes,(bytes,bytes)[],bytes,address,address)': FunctionFragment; + 'setOracle(address)': FunctionFragment; + 'setPublicSuffixList(address)': FunctionFragment; + 'suffixes()': FunctionFragment; + 'supportsInterface(bytes4)': FunctionFragment; + }; + getFunction(nameOrSignatureOrTopic: 'claim' | 'ens' | 'oracle' | 'proveAndClaim' | 'proveAndClaimWithResolver' | 'setOracle' | 'setPublicSuffixList' | 'suffixes' | 'supportsInterface'): FunctionFragment; + encodeFunctionData(functionFragment: 'claim', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'ens', values?: undefined): string; + encodeFunctionData(functionFragment: 'oracle', values?: undefined): string; + encodeFunctionData(functionFragment: 'proveAndClaim', values: [ + PromiseOrValue, + DNSSEC.RRSetWithSignatureStruct[], + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'proveAndClaimWithResolver', values: [ + PromiseOrValue, + DNSSEC.RRSetWithSignatureStruct[], + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'setOracle', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setPublicSuffixList', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'suffixes', values?: undefined): string; + encodeFunctionData(functionFragment: 'supportsInterface', values: [PromiseOrValue]): string; + decodeFunctionResult(functionFragment: 'claim', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'ens', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'oracle', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'proveAndClaim', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'proveAndClaimWithResolver', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setOracle', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setPublicSuffixList', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'suffixes', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'supportsInterface', data: BytesLike): Result; + events: { + 'Claim(bytes32,address,bytes)': EventFragment; + 'NewOracle(address)': EventFragment; + 'NewPublicSuffixList(address)': EventFragment; + }; + getEvent(nameOrSignatureOrTopic: 'Claim'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'NewOracle'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'NewPublicSuffixList'): EventFragment; +} +export interface ClaimEventObject { + node: string; + owner: string; + dnsname: string; +} +export declare type ClaimEvent = TypedEvent<[string, string, string], ClaimEventObject>; +export declare type ClaimEventFilter = TypedEventFilter; +export interface NewOracleEventObject { + oracle: string; +} +export declare type NewOracleEvent = TypedEvent<[string], NewOracleEventObject>; +export declare type NewOracleEventFilter = TypedEventFilter; +export interface NewPublicSuffixListEventObject { + suffixes: string; +} +export declare type NewPublicSuffixListEvent = TypedEvent<[ + string +], NewPublicSuffixListEventObject>; +export declare type NewPublicSuffixListEventFilter = TypedEventFilter; +export interface DNSRegistrar extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + interface: DNSRegistrarInterface; + queryFilter(event: TypedEventFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>; + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + functions: { + /** + * Claims a name by proving ownership of its DNS equivalent. + * @param name The name to claim, in DNS wire format. + * @param proof A DNS RRSet proving ownership of the name. Must be verified in the DNSSEC oracle before calling. This RRSET must contain a TXT record for '_ens.' + name, with the value 'a=0x...'. Ownership of the name will be transferred to the address specified in the TXT record. + */ + claim(name: PromiseOrValue, proof: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + ens(overrides?: CallOverrides): Promise<[string]>; + oracle(overrides?: CallOverrides): Promise<[string]>; + proveAndClaim(name: PromiseOrValue, input: DNSSEC.RRSetWithSignatureStruct[], proof: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + proveAndClaimWithResolver(name: PromiseOrValue, input: DNSSEC.RRSetWithSignatureStruct[], proof: PromiseOrValue, resolver: PromiseOrValue, addr: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setOracle(_dnssec: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setPublicSuffixList(_suffixes: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + suffixes(overrides?: CallOverrides): Promise<[string]>; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + }; + /** + * Claims a name by proving ownership of its DNS equivalent. + * @param name The name to claim, in DNS wire format. + * @param proof A DNS RRSet proving ownership of the name. Must be verified in the DNSSEC oracle before calling. This RRSET must contain a TXT record for '_ens.' + name, with the value 'a=0x...'. Ownership of the name will be transferred to the address specified in the TXT record. + */ + claim(name: PromiseOrValue, proof: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + ens(overrides?: CallOverrides): Promise; + oracle(overrides?: CallOverrides): Promise; + proveAndClaim(name: PromiseOrValue, input: DNSSEC.RRSetWithSignatureStruct[], proof: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + proveAndClaimWithResolver(name: PromiseOrValue, input: DNSSEC.RRSetWithSignatureStruct[], proof: PromiseOrValue, resolver: PromiseOrValue, addr: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setOracle(_dnssec: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setPublicSuffixList(_suffixes: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + suffixes(overrides?: CallOverrides): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + callStatic: { + /** + * Claims a name by proving ownership of its DNS equivalent. + * @param name The name to claim, in DNS wire format. + * @param proof A DNS RRSet proving ownership of the name. Must be verified in the DNSSEC oracle before calling. This RRSET must contain a TXT record for '_ens.' + name, with the value 'a=0x...'. Ownership of the name will be transferred to the address specified in the TXT record. + */ + claim(name: PromiseOrValue, proof: PromiseOrValue, overrides?: CallOverrides): Promise; + ens(overrides?: CallOverrides): Promise; + oracle(overrides?: CallOverrides): Promise; + proveAndClaim(name: PromiseOrValue, input: DNSSEC.RRSetWithSignatureStruct[], proof: PromiseOrValue, overrides?: CallOverrides): Promise; + proveAndClaimWithResolver(name: PromiseOrValue, input: DNSSEC.RRSetWithSignatureStruct[], proof: PromiseOrValue, resolver: PromiseOrValue, addr: PromiseOrValue, overrides?: CallOverrides): Promise; + setOracle(_dnssec: PromiseOrValue, overrides?: CallOverrides): Promise; + setPublicSuffixList(_suffixes: PromiseOrValue, overrides?: CallOverrides): Promise; + suffixes(overrides?: CallOverrides): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + filters: { + 'Claim(bytes32,address,bytes)'(node?: PromiseOrValue | null, owner?: PromiseOrValue | null, dnsname?: null): ClaimEventFilter; + Claim(node?: PromiseOrValue | null, owner?: PromiseOrValue | null, dnsname?: null): ClaimEventFilter; + 'NewOracle(address)'(oracle?: null): NewOracleEventFilter; + NewOracle(oracle?: null): NewOracleEventFilter; + 'NewPublicSuffixList(address)'(suffixes?: null): NewPublicSuffixListEventFilter; + NewPublicSuffixList(suffixes?: null): NewPublicSuffixListEventFilter; + }; + estimateGas: { + /** + * Claims a name by proving ownership of its DNS equivalent. + * @param name The name to claim, in DNS wire format. + * @param proof A DNS RRSet proving ownership of the name. Must be verified in the DNSSEC oracle before calling. This RRSET must contain a TXT record for '_ens.' + name, with the value 'a=0x...'. Ownership of the name will be transferred to the address specified in the TXT record. + */ + claim(name: PromiseOrValue, proof: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + ens(overrides?: CallOverrides): Promise; + oracle(overrides?: CallOverrides): Promise; + proveAndClaim(name: PromiseOrValue, input: DNSSEC.RRSetWithSignatureStruct[], proof: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + proveAndClaimWithResolver(name: PromiseOrValue, input: DNSSEC.RRSetWithSignatureStruct[], proof: PromiseOrValue, resolver: PromiseOrValue, addr: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setOracle(_dnssec: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setPublicSuffixList(_suffixes: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + suffixes(overrides?: CallOverrides): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + populateTransaction: { + /** + * Claims a name by proving ownership of its DNS equivalent. + * @param name The name to claim, in DNS wire format. + * @param proof A DNS RRSet proving ownership of the name. Must be verified in the DNSSEC oracle before calling. This RRSET must contain a TXT record for '_ens.' + name, with the value 'a=0x...'. Ownership of the name will be transferred to the address specified in the TXT record. + */ + claim(name: PromiseOrValue, proof: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + ens(overrides?: CallOverrides): Promise; + oracle(overrides?: CallOverrides): Promise; + proveAndClaim(name: PromiseOrValue, input: DNSSEC.RRSetWithSignatureStruct[], proof: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + proveAndClaimWithResolver(name: PromiseOrValue, input: DNSSEC.RRSetWithSignatureStruct[], proof: PromiseOrValue, resolver: PromiseOrValue, addr: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setOracle(_dnssec: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setPublicSuffixList(_suffixes: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + suffixes(overrides?: CallOverrides): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/DNSSECImpl.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/DNSSECImpl.d.ts new file mode 100644 index 000000000..cc07ffe0d --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/DNSSECImpl.d.ts @@ -0,0 +1,406 @@ +import type { EventFragment, FunctionFragment, Result } from '@ethersproject/abi'; +import { Interface } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/abstract-provider'; +import type { Signer } from '@ethersproject/abstract-signer'; +import type { BigNumber, BigNumberish } from '@ethersproject/bignumber'; +import type { BytesLike } from '@ethersproject/bytes'; +import type { BaseContract, CallOverrides, ContractTransaction, Overrides, PopulatedTransaction } from '@ethersproject/contracts'; +import type { OnEvent, PromiseOrValue, TypedEvent, TypedEventFilter, TypedListener } from './common'; +export declare namespace DNSSEC { + type RRSetWithSignatureStruct = { + rrset: PromiseOrValue; + sig: PromiseOrValue; + }; + type RRSetWithSignatureStructOutput = [string, string] & { + rrset: string; + sig: string; + }; +} +export interface DNSSECImplInterface extends Interface { + functions: { + 'algorithms(uint8)': FunctionFragment; + 'anchors()': FunctionFragment; + 'deleteRRSet(uint16,bytes,(bytes,bytes),bytes)': FunctionFragment; + 'deleteRRSetNSEC3(uint16,bytes,(bytes,bytes),(bytes,bytes),bytes)': FunctionFragment; + 'digests(uint8)': FunctionFragment; + 'nsec3Digests(uint8)': FunctionFragment; + 'owner()': FunctionFragment; + 'rrdata(uint16,bytes)': FunctionFragment; + 'setAlgorithm(uint8,address)': FunctionFragment; + 'setDigest(uint8,address)': FunctionFragment; + 'setNSEC3Digest(uint8,address)': FunctionFragment; + 'setOwner(address)': FunctionFragment; + 'submitRRSet((bytes,bytes),bytes)': FunctionFragment; + 'submitRRSets((bytes,bytes)[],bytes)': FunctionFragment; + }; + getFunction(nameOrSignatureOrTopic: 'algorithms' | 'anchors' | 'deleteRRSet' | 'deleteRRSetNSEC3' | 'digests' | 'nsec3Digests' | 'owner' | 'rrdata' | 'setAlgorithm' | 'setDigest' | 'setNSEC3Digest' | 'setOwner' | 'submitRRSet' | 'submitRRSets'): FunctionFragment; + encodeFunctionData(functionFragment: 'algorithms', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'anchors', values?: undefined): string; + encodeFunctionData(functionFragment: 'deleteRRSet', values: [ + PromiseOrValue, + PromiseOrValue, + DNSSEC.RRSetWithSignatureStruct, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'deleteRRSetNSEC3', values: [ + PromiseOrValue, + PromiseOrValue, + DNSSEC.RRSetWithSignatureStruct, + DNSSEC.RRSetWithSignatureStruct, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'digests', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'nsec3Digests', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'owner', values?: undefined): string; + encodeFunctionData(functionFragment: 'rrdata', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setAlgorithm', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setDigest', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setNSEC3Digest', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setOwner', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'submitRRSet', values: [DNSSEC.RRSetWithSignatureStruct, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'submitRRSets', values: [DNSSEC.RRSetWithSignatureStruct[], PromiseOrValue]): string; + decodeFunctionResult(functionFragment: 'algorithms', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'anchors', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'deleteRRSet', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'deleteRRSetNSEC3', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'digests', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'nsec3Digests', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'rrdata', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setAlgorithm', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setDigest', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setNSEC3Digest', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setOwner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'submitRRSet', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'submitRRSets', data: BytesLike): Result; + events: { + 'AlgorithmUpdated(uint8,address)': EventFragment; + 'DigestUpdated(uint8,address)': EventFragment; + 'Marker()': EventFragment; + 'NSEC3DigestUpdated(uint8,address)': EventFragment; + 'RRSetUpdated(bytes,bytes)': EventFragment; + 'Test(uint256)': EventFragment; + }; + getEvent(nameOrSignatureOrTopic: 'AlgorithmUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'DigestUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Marker'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'NSEC3DigestUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'RRSetUpdated'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Test'): EventFragment; +} +export interface AlgorithmUpdatedEventObject { + id: number; + addr: string; +} +export declare type AlgorithmUpdatedEvent = TypedEvent<[ + number, + string +], AlgorithmUpdatedEventObject>; +export declare type AlgorithmUpdatedEventFilter = TypedEventFilter; +export interface DigestUpdatedEventObject { + id: number; + addr: string; +} +export declare type DigestUpdatedEvent = TypedEvent<[ + number, + string +], DigestUpdatedEventObject>; +export declare type DigestUpdatedEventFilter = TypedEventFilter; +export interface MarkerEventObject { +} +export declare type MarkerEvent = TypedEvent<[], MarkerEventObject>; +export declare type MarkerEventFilter = TypedEventFilter; +export interface NSEC3DigestUpdatedEventObject { + id: number; + addr: string; +} +export declare type NSEC3DigestUpdatedEvent = TypedEvent<[ + number, + string +], NSEC3DigestUpdatedEventObject>; +export declare type NSEC3DigestUpdatedEventFilter = TypedEventFilter; +export interface RRSetUpdatedEventObject { + name: string; + rrset: string; +} +export declare type RRSetUpdatedEvent = TypedEvent<[ + string, + string +], RRSetUpdatedEventObject>; +export declare type RRSetUpdatedEventFilter = TypedEventFilter; +export interface TestEventObject { + t: BigNumber; +} +export declare type TestEvent = TypedEvent<[BigNumber], TestEventObject>; +export declare type TestEventFilter = TypedEventFilter; +export interface DNSSECImpl extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + interface: DNSSECImplInterface; + queryFilter(event: TypedEventFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>; + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + functions: { + algorithms(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + anchors(overrides?: CallOverrides): Promise<[string]>; + deleteRRSet(deleteType: PromiseOrValue, deleteName: PromiseOrValue, nsec: DNSSEC.RRSetWithSignatureStruct, proof: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + deleteRRSetNSEC3(deleteType: PromiseOrValue, deleteName: PromiseOrValue, closestEncloser: DNSSEC.RRSetWithSignatureStruct, nextClosest: DNSSEC.RRSetWithSignatureStruct, dnskey: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + digests(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + nsec3Digests(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + owner(overrides?: CallOverrides): Promise<[string]>; + /** + * Returns data about the RRs (if any) known to this oracle with the provided type and name. + * @param dnstype The DNS record type to query. + * @param name The name to query, in DNS label-sequence format. + */ + rrdata(dnstype: PromiseOrValue, name: PromiseOrValue, overrides?: CallOverrides): Promise<[number, number, string]>; + /** + * Sets the contract address for a signature verification algorithm. Callable only by the owner. + * @param algo The address of the algorithm contract. + * @param id The algorithm ID + */ + setAlgorithm(id: PromiseOrValue, algo: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + /** + * Sets the contract address for a digest verification algorithm. Callable only by the owner. + * @param digest The address of the digest contract. + * @param id The digest ID + */ + setDigest(id: PromiseOrValue, digest: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + /** + * Sets the contract address for an NSEC3 digest algorithm. Callable only by the owner. + * @param digest The address of the digest contract. + * @param id The digest ID + */ + setNSEC3Digest(id: PromiseOrValue, digest: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setOwner(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + submitRRSet(input: DNSSEC.RRSetWithSignatureStruct, proof: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + submitRRSets(input: DNSSEC.RRSetWithSignatureStruct[], _proof: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + }; + algorithms(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + anchors(overrides?: CallOverrides): Promise; + deleteRRSet(deleteType: PromiseOrValue, deleteName: PromiseOrValue, nsec: DNSSEC.RRSetWithSignatureStruct, proof: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + deleteRRSetNSEC3(deleteType: PromiseOrValue, deleteName: PromiseOrValue, closestEncloser: DNSSEC.RRSetWithSignatureStruct, nextClosest: DNSSEC.RRSetWithSignatureStruct, dnskey: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + digests(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + nsec3Digests(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + owner(overrides?: CallOverrides): Promise; + /** + * Returns data about the RRs (if any) known to this oracle with the provided type and name. + * @param dnstype The DNS record type to query. + * @param name The name to query, in DNS label-sequence format. + */ + rrdata(dnstype: PromiseOrValue, name: PromiseOrValue, overrides?: CallOverrides): Promise<[number, number, string]>; + /** + * Sets the contract address for a signature verification algorithm. Callable only by the owner. + * @param algo The address of the algorithm contract. + * @param id The algorithm ID + */ + setAlgorithm(id: PromiseOrValue, algo: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + /** + * Sets the contract address for a digest verification algorithm. Callable only by the owner. + * @param digest The address of the digest contract. + * @param id The digest ID + */ + setDigest(id: PromiseOrValue, digest: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + /** + * Sets the contract address for an NSEC3 digest algorithm. Callable only by the owner. + * @param digest The address of the digest contract. + * @param id The digest ID + */ + setNSEC3Digest(id: PromiseOrValue, digest: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setOwner(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + submitRRSet(input: DNSSEC.RRSetWithSignatureStruct, proof: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + submitRRSets(input: DNSSEC.RRSetWithSignatureStruct[], _proof: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + callStatic: { + algorithms(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + anchors(overrides?: CallOverrides): Promise; + deleteRRSet(deleteType: PromiseOrValue, deleteName: PromiseOrValue, nsec: DNSSEC.RRSetWithSignatureStruct, proof: PromiseOrValue, overrides?: CallOverrides): Promise; + deleteRRSetNSEC3(deleteType: PromiseOrValue, deleteName: PromiseOrValue, closestEncloser: DNSSEC.RRSetWithSignatureStruct, nextClosest: DNSSEC.RRSetWithSignatureStruct, dnskey: PromiseOrValue, overrides?: CallOverrides): Promise; + digests(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + nsec3Digests(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + owner(overrides?: CallOverrides): Promise; + /** + * Returns data about the RRs (if any) known to this oracle with the provided type and name. + * @param dnstype The DNS record type to query. + * @param name The name to query, in DNS label-sequence format. + */ + rrdata(dnstype: PromiseOrValue, name: PromiseOrValue, overrides?: CallOverrides): Promise<[number, number, string]>; + /** + * Sets the contract address for a signature verification algorithm. Callable only by the owner. + * @param algo The address of the algorithm contract. + * @param id The algorithm ID + */ + setAlgorithm(id: PromiseOrValue, algo: PromiseOrValue, overrides?: CallOverrides): Promise; + /** + * Sets the contract address for a digest verification algorithm. Callable only by the owner. + * @param digest The address of the digest contract. + * @param id The digest ID + */ + setDigest(id: PromiseOrValue, digest: PromiseOrValue, overrides?: CallOverrides): Promise; + /** + * Sets the contract address for an NSEC3 digest algorithm. Callable only by the owner. + * @param digest The address of the digest contract. + * @param id The digest ID + */ + setNSEC3Digest(id: PromiseOrValue, digest: PromiseOrValue, overrides?: CallOverrides): Promise; + setOwner(newOwner: PromiseOrValue, overrides?: CallOverrides): Promise; + submitRRSet(input: DNSSEC.RRSetWithSignatureStruct, proof: PromiseOrValue, overrides?: CallOverrides): Promise; + submitRRSets(input: DNSSEC.RRSetWithSignatureStruct[], _proof: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + filters: { + 'AlgorithmUpdated(uint8,address)'(id?: null, addr?: null): AlgorithmUpdatedEventFilter; + AlgorithmUpdated(id?: null, addr?: null): AlgorithmUpdatedEventFilter; + 'DigestUpdated(uint8,address)'(id?: null, addr?: null): DigestUpdatedEventFilter; + DigestUpdated(id?: null, addr?: null): DigestUpdatedEventFilter; + 'Marker()'(): MarkerEventFilter; + Marker(): MarkerEventFilter; + 'NSEC3DigestUpdated(uint8,address)'(id?: null, addr?: null): NSEC3DigestUpdatedEventFilter; + NSEC3DigestUpdated(id?: null, addr?: null): NSEC3DigestUpdatedEventFilter; + 'RRSetUpdated(bytes,bytes)'(name?: null, rrset?: null): RRSetUpdatedEventFilter; + RRSetUpdated(name?: null, rrset?: null): RRSetUpdatedEventFilter; + 'Test(uint256)'(t?: null): TestEventFilter; + Test(t?: null): TestEventFilter; + }; + estimateGas: { + algorithms(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + anchors(overrides?: CallOverrides): Promise; + deleteRRSet(deleteType: PromiseOrValue, deleteName: PromiseOrValue, nsec: DNSSEC.RRSetWithSignatureStruct, proof: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + deleteRRSetNSEC3(deleteType: PromiseOrValue, deleteName: PromiseOrValue, closestEncloser: DNSSEC.RRSetWithSignatureStruct, nextClosest: DNSSEC.RRSetWithSignatureStruct, dnskey: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + digests(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + nsec3Digests(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + owner(overrides?: CallOverrides): Promise; + /** + * Returns data about the RRs (if any) known to this oracle with the provided type and name. + * @param dnstype The DNS record type to query. + * @param name The name to query, in DNS label-sequence format. + */ + rrdata(dnstype: PromiseOrValue, name: PromiseOrValue, overrides?: CallOverrides): Promise; + /** + * Sets the contract address for a signature verification algorithm. Callable only by the owner. + * @param algo The address of the algorithm contract. + * @param id The algorithm ID + */ + setAlgorithm(id: PromiseOrValue, algo: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + /** + * Sets the contract address for a digest verification algorithm. Callable only by the owner. + * @param digest The address of the digest contract. + * @param id The digest ID + */ + setDigest(id: PromiseOrValue, digest: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + /** + * Sets the contract address for an NSEC3 digest algorithm. Callable only by the owner. + * @param digest The address of the digest contract. + * @param id The digest ID + */ + setNSEC3Digest(id: PromiseOrValue, digest: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setOwner(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + submitRRSet(input: DNSSEC.RRSetWithSignatureStruct, proof: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + submitRRSets(input: DNSSEC.RRSetWithSignatureStruct[], _proof: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + }; + populateTransaction: { + algorithms(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + anchors(overrides?: CallOverrides): Promise; + deleteRRSet(deleteType: PromiseOrValue, deleteName: PromiseOrValue, nsec: DNSSEC.RRSetWithSignatureStruct, proof: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + deleteRRSetNSEC3(deleteType: PromiseOrValue, deleteName: PromiseOrValue, closestEncloser: DNSSEC.RRSetWithSignatureStruct, nextClosest: DNSSEC.RRSetWithSignatureStruct, dnskey: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + digests(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + nsec3Digests(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + owner(overrides?: CallOverrides): Promise; + /** + * Returns data about the RRs (if any) known to this oracle with the provided type and name. + * @param dnstype The DNS record type to query. + * @param name The name to query, in DNS label-sequence format. + */ + rrdata(dnstype: PromiseOrValue, name: PromiseOrValue, overrides?: CallOverrides): Promise; + /** + * Sets the contract address for a signature verification algorithm. Callable only by the owner. + * @param algo The address of the algorithm contract. + * @param id The algorithm ID + */ + setAlgorithm(id: PromiseOrValue, algo: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + /** + * Sets the contract address for a digest verification algorithm. Callable only by the owner. + * @param digest The address of the digest contract. + * @param id The digest ID + */ + setDigest(id: PromiseOrValue, digest: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + /** + * Sets the contract address for an NSEC3 digest algorithm. Callable only by the owner. + * @param digest The address of the digest contract. + * @param id The digest ID + */ + setNSEC3Digest(id: PromiseOrValue, digest: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setOwner(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + submitRRSet(input: DNSSEC.RRSetWithSignatureStruct, proof: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + submitRRSets(input: DNSSEC.RRSetWithSignatureStruct[], _proof: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/DefaultReverseResolver.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/DefaultReverseResolver.d.ts new file mode 100644 index 000000000..051df6a57 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/DefaultReverseResolver.d.ts @@ -0,0 +1,70 @@ +import type { FunctionFragment, Result } from '@ethersproject/abi'; +import { Interface } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/abstract-provider'; +import type { Signer } from '@ethersproject/abstract-signer'; +import type { BigNumber } from '@ethersproject/bignumber'; +import type { BytesLike } from '@ethersproject/bytes'; +import type { BaseContract, CallOverrides, ContractTransaction, Overrides, PopulatedTransaction } from '@ethersproject/contracts'; +import type { OnEvent, PromiseOrValue, TypedEvent, TypedEventFilter, TypedListener } from './common'; +export interface DefaultReverseResolverInterface extends Interface { + functions: { + 'ens()': FunctionFragment; + 'name(bytes32)': FunctionFragment; + 'setName(bytes32,string)': FunctionFragment; + }; + getFunction(nameOrSignatureOrTopic: 'ens' | 'name' | 'setName'): FunctionFragment; + encodeFunctionData(functionFragment: 'ens', values?: undefined): string; + encodeFunctionData(functionFragment: 'name', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setName', values: [PromiseOrValue, PromiseOrValue]): string; + decodeFunctionResult(functionFragment: 'ens', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setName', data: BytesLike): Result; + events: {}; +} +export interface DefaultReverseResolver extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + interface: DefaultReverseResolverInterface; + queryFilter(event: TypedEventFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>; + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + functions: { + ens(overrides?: CallOverrides): Promise<[string]>; + name(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + setName(node: PromiseOrValue, _name: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + }; + ens(overrides?: CallOverrides): Promise; + name(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + setName(node: PromiseOrValue, _name: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + callStatic: { + ens(overrides?: CallOverrides): Promise; + name(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + setName(node: PromiseOrValue, _name: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + filters: {}; + estimateGas: { + ens(overrides?: CallOverrides): Promise; + name(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + setName(node: PromiseOrValue, _name: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + }; + populateTransaction: { + ens(overrides?: CallOverrides): Promise; + name(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + setName(node: PromiseOrValue, _name: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/ENSRegistry.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/ENSRegistry.d.ts new file mode 100644 index 000000000..15f390358 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/ENSRegistry.d.ts @@ -0,0 +1,278 @@ +import type { EventFragment, FunctionFragment, Result } from '@ethersproject/abi'; +import { Interface } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/abstract-provider'; +import type { Signer } from '@ethersproject/abstract-signer'; +import type { BigNumber, BigNumberish } from '@ethersproject/bignumber'; +import type { BytesLike } from '@ethersproject/bytes'; +import type { BaseContract, CallOverrides, ContractTransaction, Overrides, PopulatedTransaction } from '@ethersproject/contracts'; +import type { OnEvent, PromiseOrValue, TypedEvent, TypedEventFilter, TypedListener } from './common'; +export interface ENSRegistryInterface extends Interface { + functions: { + 'isApprovedForAll(address,address)': FunctionFragment; + 'old()': FunctionFragment; + 'owner(bytes32)': FunctionFragment; + 'recordExists(bytes32)': FunctionFragment; + 'resolver(bytes32)': FunctionFragment; + 'setApprovalForAll(address,bool)': FunctionFragment; + 'setOwner(bytes32,address)': FunctionFragment; + 'setRecord(bytes32,address,address,uint64)': FunctionFragment; + 'setResolver(bytes32,address)': FunctionFragment; + 'setSubnodeOwner(bytes32,bytes32,address)': FunctionFragment; + 'setSubnodeRecord(bytes32,bytes32,address,address,uint64)': FunctionFragment; + 'setTTL(bytes32,uint64)': FunctionFragment; + 'ttl(bytes32)': FunctionFragment; + }; + getFunction(nameOrSignatureOrTopic: 'isApprovedForAll' | 'old' | 'owner' | 'recordExists' | 'resolver' | 'setApprovalForAll' | 'setOwner' | 'setRecord' | 'setResolver' | 'setSubnodeOwner' | 'setSubnodeRecord' | 'setTTL' | 'ttl'): FunctionFragment; + encodeFunctionData(functionFragment: 'isApprovedForAll', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'old', values?: undefined): string; + encodeFunctionData(functionFragment: 'owner', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'recordExists', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'resolver', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setApprovalForAll', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setOwner', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setRecord', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'setResolver', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setSubnodeOwner', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'setSubnodeRecord', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'setTTL', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'ttl', values: [PromiseOrValue]): string; + decodeFunctionResult(functionFragment: 'isApprovedForAll', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'old', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'recordExists', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'resolver', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setApprovalForAll', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setOwner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setRecord', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setResolver', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setSubnodeOwner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setSubnodeRecord', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setTTL', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'ttl', data: BytesLike): Result; + events: { + 'ApprovalForAll(address,address,bool)': EventFragment; + 'NewOwner(bytes32,bytes32,address)': EventFragment; + 'NewResolver(bytes32,address)': EventFragment; + 'NewTTL(bytes32,uint64)': EventFragment; + 'Transfer(bytes32,address)': EventFragment; + }; + getEvent(nameOrSignatureOrTopic: 'ApprovalForAll'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'NewOwner'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'NewResolver'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'NewTTL'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Transfer'): EventFragment; +} +export interface ApprovalForAllEventObject { + owner: string; + operator: string; + approved: boolean; +} +export declare type ApprovalForAllEvent = TypedEvent<[ + string, + string, + boolean +], ApprovalForAllEventObject>; +export declare type ApprovalForAllEventFilter = TypedEventFilter; +export interface NewOwnerEventObject { + node: string; + label: string; + owner: string; +} +export declare type NewOwnerEvent = TypedEvent<[ + string, + string, + string +], NewOwnerEventObject>; +export declare type NewOwnerEventFilter = TypedEventFilter; +export interface NewResolverEventObject { + node: string; + resolver: string; +} +export declare type NewResolverEvent = TypedEvent<[ + string, + string +], NewResolverEventObject>; +export declare type NewResolverEventFilter = TypedEventFilter; +export interface NewTTLEventObject { + node: string; + ttl: BigNumber; +} +export declare type NewTTLEvent = TypedEvent<[string, BigNumber], NewTTLEventObject>; +export declare type NewTTLEventFilter = TypedEventFilter; +export interface TransferEventObject { + node: string; + owner: string; +} +export declare type TransferEvent = TypedEvent<[string, string], TransferEventObject>; +export declare type TransferEventFilter = TypedEventFilter; +export interface ENSRegistry extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + interface: ENSRegistryInterface; + queryFilter(event: TypedEventFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>; + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + functions: { + isApprovedForAll(owner: PromiseOrValue, operator: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + old(overrides?: CallOverrides): Promise<[string]>; + owner(node: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + recordExists(node: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + resolver(node: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + setApprovalForAll(operator: PromiseOrValue, approved: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setOwner(node: PromiseOrValue, owner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setRecord(node: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, ttl: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setResolver(node: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setSubnodeOwner(node: PromiseOrValue, label: PromiseOrValue, owner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setSubnodeRecord(node: PromiseOrValue, label: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, ttl: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setTTL(node: PromiseOrValue, ttl: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + ttl(node: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; + }; + isApprovedForAll(owner: PromiseOrValue, operator: PromiseOrValue, overrides?: CallOverrides): Promise; + old(overrides?: CallOverrides): Promise; + owner(node: PromiseOrValue, overrides?: CallOverrides): Promise; + recordExists(node: PromiseOrValue, overrides?: CallOverrides): Promise; + resolver(node: PromiseOrValue, overrides?: CallOverrides): Promise; + setApprovalForAll(operator: PromiseOrValue, approved: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setOwner(node: PromiseOrValue, owner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setRecord(node: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, ttl: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setResolver(node: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setSubnodeOwner(node: PromiseOrValue, label: PromiseOrValue, owner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setSubnodeRecord(node: PromiseOrValue, label: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, ttl: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setTTL(node: PromiseOrValue, ttl: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + ttl(node: PromiseOrValue, overrides?: CallOverrides): Promise; + callStatic: { + isApprovedForAll(owner: PromiseOrValue, operator: PromiseOrValue, overrides?: CallOverrides): Promise; + old(overrides?: CallOverrides): Promise; + owner(node: PromiseOrValue, overrides?: CallOverrides): Promise; + recordExists(node: PromiseOrValue, overrides?: CallOverrides): Promise; + resolver(node: PromiseOrValue, overrides?: CallOverrides): Promise; + setApprovalForAll(operator: PromiseOrValue, approved: PromiseOrValue, overrides?: CallOverrides): Promise; + setOwner(node: PromiseOrValue, owner: PromiseOrValue, overrides?: CallOverrides): Promise; + setRecord(node: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, ttl: PromiseOrValue, overrides?: CallOverrides): Promise; + setResolver(node: PromiseOrValue, resolver: PromiseOrValue, overrides?: CallOverrides): Promise; + setSubnodeOwner(node: PromiseOrValue, label: PromiseOrValue, owner: PromiseOrValue, overrides?: CallOverrides): Promise; + setSubnodeRecord(node: PromiseOrValue, label: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, ttl: PromiseOrValue, overrides?: CallOverrides): Promise; + setTTL(node: PromiseOrValue, ttl: PromiseOrValue, overrides?: CallOverrides): Promise; + ttl(node: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + filters: { + 'ApprovalForAll(address,address,bool)'(owner?: PromiseOrValue | null, operator?: PromiseOrValue | null, approved?: null): ApprovalForAllEventFilter; + ApprovalForAll(owner?: PromiseOrValue | null, operator?: PromiseOrValue | null, approved?: null): ApprovalForAllEventFilter; + 'NewOwner(bytes32,bytes32,address)'(node?: PromiseOrValue | null, label?: PromiseOrValue | null, owner?: null): NewOwnerEventFilter; + NewOwner(node?: PromiseOrValue | null, label?: PromiseOrValue | null, owner?: null): NewOwnerEventFilter; + 'NewResolver(bytes32,address)'(node?: PromiseOrValue | null, resolver?: null): NewResolverEventFilter; + NewResolver(node?: PromiseOrValue | null, resolver?: null): NewResolverEventFilter; + 'NewTTL(bytes32,uint64)'(node?: PromiseOrValue | null, ttl?: null): NewTTLEventFilter; + NewTTL(node?: PromiseOrValue | null, ttl?: null): NewTTLEventFilter; + 'Transfer(bytes32,address)'(node?: PromiseOrValue | null, owner?: null): TransferEventFilter; + Transfer(node?: PromiseOrValue | null, owner?: null): TransferEventFilter; + }; + estimateGas: { + isApprovedForAll(owner: PromiseOrValue, operator: PromiseOrValue, overrides?: CallOverrides): Promise; + old(overrides?: CallOverrides): Promise; + owner(node: PromiseOrValue, overrides?: CallOverrides): Promise; + recordExists(node: PromiseOrValue, overrides?: CallOverrides): Promise; + resolver(node: PromiseOrValue, overrides?: CallOverrides): Promise; + setApprovalForAll(operator: PromiseOrValue, approved: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setOwner(node: PromiseOrValue, owner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setRecord(node: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, ttl: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setResolver(node: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setSubnodeOwner(node: PromiseOrValue, label: PromiseOrValue, owner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setSubnodeRecord(node: PromiseOrValue, label: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, ttl: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setTTL(node: PromiseOrValue, ttl: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + ttl(node: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + populateTransaction: { + isApprovedForAll(owner: PromiseOrValue, operator: PromiseOrValue, overrides?: CallOverrides): Promise; + old(overrides?: CallOverrides): Promise; + owner(node: PromiseOrValue, overrides?: CallOverrides): Promise; + recordExists(node: PromiseOrValue, overrides?: CallOverrides): Promise; + resolver(node: PromiseOrValue, overrides?: CallOverrides): Promise; + setApprovalForAll(operator: PromiseOrValue, approved: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setOwner(node: PromiseOrValue, owner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setRecord(node: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, ttl: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setResolver(node: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setSubnodeOwner(node: PromiseOrValue, label: PromiseOrValue, owner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setSubnodeRecord(node: PromiseOrValue, label: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, ttl: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setTTL(node: PromiseOrValue, ttl: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + ttl(node: PromiseOrValue, overrides?: CallOverrides): Promise; + }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/ETHRegistrarController.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/ETHRegistrarController.d.ts new file mode 100644 index 000000000..b6806829a --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/ETHRegistrarController.d.ts @@ -0,0 +1,343 @@ +import type { EventFragment, FunctionFragment, Result } from '@ethersproject/abi'; +import { Interface } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/abstract-provider'; +import type { Signer } from '@ethersproject/abstract-signer'; +import type { BigNumber, BigNumberish } from '@ethersproject/bignumber'; +import type { BytesLike } from '@ethersproject/bytes'; +import type { BaseContract, CallOverrides, ContractTransaction, Overrides, PayableOverrides, PopulatedTransaction } from '@ethersproject/contracts'; +import type { OnEvent, PromiseOrValue, TypedEvent, TypedEventFilter, TypedListener } from './common'; +export declare namespace IPriceOracle { + type PriceStruct = { + base: PromiseOrValue; + premium: PromiseOrValue; + }; + type PriceStructOutput = [BigNumber, BigNumber] & { + base: BigNumber; + premium: BigNumber; + }; +} +export interface ETHRegistrarControllerInterface extends Interface { + functions: { + 'MIN_REGISTRATION_DURATION()': FunctionFragment; + 'available(string)': FunctionFragment; + 'commit(bytes32)': FunctionFragment; + 'commitments(bytes32)': FunctionFragment; + 'makeCommitment(string,address,uint256,bytes32,address,bytes[],bool,uint16)': FunctionFragment; + 'maxCommitmentAge()': FunctionFragment; + 'minCommitmentAge()': FunctionFragment; + 'nameWrapper()': FunctionFragment; + 'owner()': FunctionFragment; + 'prices()': FunctionFragment; + 'recoverFunds(address,address,uint256)': FunctionFragment; + 'register(string,address,uint256,bytes32,address,bytes[],bool,uint16)': FunctionFragment; + 'renew(string,uint256)': FunctionFragment; + 'renounceOwnership()': FunctionFragment; + 'rentPrice(string,uint256)': FunctionFragment; + 'reverseRegistrar()': FunctionFragment; + 'supportsInterface(bytes4)': FunctionFragment; + 'transferOwnership(address)': FunctionFragment; + 'valid(string)': FunctionFragment; + 'withdraw()': FunctionFragment; + }; + getFunction(nameOrSignatureOrTopic: 'MIN_REGISTRATION_DURATION' | 'available' | 'commit' | 'commitments' | 'makeCommitment' | 'maxCommitmentAge' | 'minCommitmentAge' | 'nameWrapper' | 'owner' | 'prices' | 'recoverFunds' | 'register' | 'renew' | 'renounceOwnership' | 'rentPrice' | 'reverseRegistrar' | 'supportsInterface' | 'transferOwnership' | 'valid' | 'withdraw'): FunctionFragment; + encodeFunctionData(functionFragment: 'MIN_REGISTRATION_DURATION', values?: undefined): string; + encodeFunctionData(functionFragment: 'available', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'commit', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'commitments', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'makeCommitment', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue[], + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'maxCommitmentAge', values?: undefined): string; + encodeFunctionData(functionFragment: 'minCommitmentAge', values?: undefined): string; + encodeFunctionData(functionFragment: 'nameWrapper', values?: undefined): string; + encodeFunctionData(functionFragment: 'owner', values?: undefined): string; + encodeFunctionData(functionFragment: 'prices', values?: undefined): string; + encodeFunctionData(functionFragment: 'recoverFunds', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'register', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue[], + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'renew', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'renounceOwnership', values?: undefined): string; + encodeFunctionData(functionFragment: 'rentPrice', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'reverseRegistrar', values?: undefined): string; + encodeFunctionData(functionFragment: 'supportsInterface', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'transferOwnership', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'valid', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'withdraw', values?: undefined): string; + decodeFunctionResult(functionFragment: 'MIN_REGISTRATION_DURATION', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'available', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'commit', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'commitments', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'makeCommitment', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'maxCommitmentAge', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'minCommitmentAge', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'nameWrapper', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'prices', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'recoverFunds', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'register', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'renew', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'renounceOwnership', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'rentPrice', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'reverseRegistrar', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'supportsInterface', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferOwnership', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'valid', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'withdraw', data: BytesLike): Result; + events: { + 'NameRegistered(string,bytes32,address,uint256,uint256,uint256)': EventFragment; + 'NameRenewed(string,bytes32,uint256,uint256)': EventFragment; + 'OwnershipTransferred(address,address)': EventFragment; + }; + getEvent(nameOrSignatureOrTopic: 'NameRegistered'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'NameRenewed'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OwnershipTransferred'): EventFragment; +} +export interface NameRegisteredEventObject { + name: string; + label: string; + owner: string; + baseCost: BigNumber; + premium: BigNumber; + expires: BigNumber; +} +export declare type NameRegisteredEvent = TypedEvent<[ + string, + string, + string, + BigNumber, + BigNumber, + BigNumber +], NameRegisteredEventObject>; +export declare type NameRegisteredEventFilter = TypedEventFilter; +export interface NameRenewedEventObject { + name: string; + label: string; + cost: BigNumber; + expires: BigNumber; +} +export declare type NameRenewedEvent = TypedEvent<[ + string, + string, + BigNumber, + BigNumber +], NameRenewedEventObject>; +export declare type NameRenewedEventFilter = TypedEventFilter; +export interface OwnershipTransferredEventObject { + previousOwner: string; + newOwner: string; +} +export declare type OwnershipTransferredEvent = TypedEvent<[ + string, + string +], OwnershipTransferredEventObject>; +export declare type OwnershipTransferredEventFilter = TypedEventFilter; +export interface ETHRegistrarController extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + interface: ETHRegistrarControllerInterface; + queryFilter(event: TypedEventFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>; + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + functions: { + MIN_REGISTRATION_DURATION(overrides?: CallOverrides): Promise<[BigNumber]>; + available(name: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + commit(commitment: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + commitments(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; + makeCommitment(name: PromiseOrValue, owner: PromiseOrValue, duration: PromiseOrValue, secret: PromiseOrValue, resolver: PromiseOrValue, data: PromiseOrValue[], reverseRecord: PromiseOrValue, ownerControlledFuses: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + maxCommitmentAge(overrides?: CallOverrides): Promise<[BigNumber]>; + minCommitmentAge(overrides?: CallOverrides): Promise<[BigNumber]>; + nameWrapper(overrides?: CallOverrides): Promise<[string]>; + owner(overrides?: CallOverrides): Promise<[string]>; + prices(overrides?: CallOverrides): Promise<[string]>; + recoverFunds(_token: PromiseOrValue, _to: PromiseOrValue, _amount: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + register(name: PromiseOrValue, owner: PromiseOrValue, duration: PromiseOrValue, secret: PromiseOrValue, resolver: PromiseOrValue, data: PromiseOrValue[], reverseRecord: PromiseOrValue, ownerControlledFuses: PromiseOrValue, overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + renew(name: PromiseOrValue, duration: PromiseOrValue, overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + renounceOwnership(overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + rentPrice(name: PromiseOrValue, duration: PromiseOrValue, overrides?: CallOverrides): Promise<[ + IPriceOracle.PriceStructOutput + ] & { + price: IPriceOracle.PriceStructOutput; + }>; + reverseRegistrar(overrides?: CallOverrides): Promise<[string]>; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + transferOwnership(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + valid(name: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + withdraw(overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + }; + MIN_REGISTRATION_DURATION(overrides?: CallOverrides): Promise; + available(name: PromiseOrValue, overrides?: CallOverrides): Promise; + commit(commitment: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + commitments(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + makeCommitment(name: PromiseOrValue, owner: PromiseOrValue, duration: PromiseOrValue, secret: PromiseOrValue, resolver: PromiseOrValue, data: PromiseOrValue[], reverseRecord: PromiseOrValue, ownerControlledFuses: PromiseOrValue, overrides?: CallOverrides): Promise; + maxCommitmentAge(overrides?: CallOverrides): Promise; + minCommitmentAge(overrides?: CallOverrides): Promise; + nameWrapper(overrides?: CallOverrides): Promise; + owner(overrides?: CallOverrides): Promise; + prices(overrides?: CallOverrides): Promise; + recoverFunds(_token: PromiseOrValue, _to: PromiseOrValue, _amount: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + register(name: PromiseOrValue, owner: PromiseOrValue, duration: PromiseOrValue, secret: PromiseOrValue, resolver: PromiseOrValue, data: PromiseOrValue[], reverseRecord: PromiseOrValue, ownerControlledFuses: PromiseOrValue, overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + renew(name: PromiseOrValue, duration: PromiseOrValue, overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + renounceOwnership(overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + rentPrice(name: PromiseOrValue, duration: PromiseOrValue, overrides?: CallOverrides): Promise; + reverseRegistrar(overrides?: CallOverrides): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + valid(name: PromiseOrValue, overrides?: CallOverrides): Promise; + withdraw(overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + callStatic: { + MIN_REGISTRATION_DURATION(overrides?: CallOverrides): Promise; + available(name: PromiseOrValue, overrides?: CallOverrides): Promise; + commit(commitment: PromiseOrValue, overrides?: CallOverrides): Promise; + commitments(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + makeCommitment(name: PromiseOrValue, owner: PromiseOrValue, duration: PromiseOrValue, secret: PromiseOrValue, resolver: PromiseOrValue, data: PromiseOrValue[], reverseRecord: PromiseOrValue, ownerControlledFuses: PromiseOrValue, overrides?: CallOverrides): Promise; + maxCommitmentAge(overrides?: CallOverrides): Promise; + minCommitmentAge(overrides?: CallOverrides): Promise; + nameWrapper(overrides?: CallOverrides): Promise; + owner(overrides?: CallOverrides): Promise; + prices(overrides?: CallOverrides): Promise; + recoverFunds(_token: PromiseOrValue, _to: PromiseOrValue, _amount: PromiseOrValue, overrides?: CallOverrides): Promise; + register(name: PromiseOrValue, owner: PromiseOrValue, duration: PromiseOrValue, secret: PromiseOrValue, resolver: PromiseOrValue, data: PromiseOrValue[], reverseRecord: PromiseOrValue, ownerControlledFuses: PromiseOrValue, overrides?: CallOverrides): Promise; + renew(name: PromiseOrValue, duration: PromiseOrValue, overrides?: CallOverrides): Promise; + renounceOwnership(overrides?: CallOverrides): Promise; + rentPrice(name: PromiseOrValue, duration: PromiseOrValue, overrides?: CallOverrides): Promise; + reverseRegistrar(overrides?: CallOverrides): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: CallOverrides): Promise; + valid(name: PromiseOrValue, overrides?: CallOverrides): Promise; + withdraw(overrides?: CallOverrides): Promise; + }; + filters: { + 'NameRegistered(string,bytes32,address,uint256,uint256,uint256)'(name?: null, label?: PromiseOrValue | null, owner?: PromiseOrValue | null, baseCost?: null, premium?: null, expires?: null): NameRegisteredEventFilter; + NameRegistered(name?: null, label?: PromiseOrValue | null, owner?: PromiseOrValue | null, baseCost?: null, premium?: null, expires?: null): NameRegisteredEventFilter; + 'NameRenewed(string,bytes32,uint256,uint256)'(name?: null, label?: PromiseOrValue | null, cost?: null, expires?: null): NameRenewedEventFilter; + NameRenewed(name?: null, label?: PromiseOrValue | null, cost?: null, expires?: null): NameRenewedEventFilter; + 'OwnershipTransferred(address,address)'(previousOwner?: PromiseOrValue | null, newOwner?: PromiseOrValue | null): OwnershipTransferredEventFilter; + OwnershipTransferred(previousOwner?: PromiseOrValue | null, newOwner?: PromiseOrValue | null): OwnershipTransferredEventFilter; + }; + estimateGas: { + MIN_REGISTRATION_DURATION(overrides?: CallOverrides): Promise; + available(name: PromiseOrValue, overrides?: CallOverrides): Promise; + commit(commitment: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + commitments(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + makeCommitment(name: PromiseOrValue, owner: PromiseOrValue, duration: PromiseOrValue, secret: PromiseOrValue, resolver: PromiseOrValue, data: PromiseOrValue[], reverseRecord: PromiseOrValue, ownerControlledFuses: PromiseOrValue, overrides?: CallOverrides): Promise; + maxCommitmentAge(overrides?: CallOverrides): Promise; + minCommitmentAge(overrides?: CallOverrides): Promise; + nameWrapper(overrides?: CallOverrides): Promise; + owner(overrides?: CallOverrides): Promise; + prices(overrides?: CallOverrides): Promise; + recoverFunds(_token: PromiseOrValue, _to: PromiseOrValue, _amount: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + register(name: PromiseOrValue, owner: PromiseOrValue, duration: PromiseOrValue, secret: PromiseOrValue, resolver: PromiseOrValue, data: PromiseOrValue[], reverseRecord: PromiseOrValue, ownerControlledFuses: PromiseOrValue, overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + renew(name: PromiseOrValue, duration: PromiseOrValue, overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + renounceOwnership(overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + rentPrice(name: PromiseOrValue, duration: PromiseOrValue, overrides?: CallOverrides): Promise; + reverseRegistrar(overrides?: CallOverrides): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + valid(name: PromiseOrValue, overrides?: CallOverrides): Promise; + withdraw(overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + }; + populateTransaction: { + MIN_REGISTRATION_DURATION(overrides?: CallOverrides): Promise; + available(name: PromiseOrValue, overrides?: CallOverrides): Promise; + commit(commitment: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + commitments(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + makeCommitment(name: PromiseOrValue, owner: PromiseOrValue, duration: PromiseOrValue, secret: PromiseOrValue, resolver: PromiseOrValue, data: PromiseOrValue[], reverseRecord: PromiseOrValue, ownerControlledFuses: PromiseOrValue, overrides?: CallOverrides): Promise; + maxCommitmentAge(overrides?: CallOverrides): Promise; + minCommitmentAge(overrides?: CallOverrides): Promise; + nameWrapper(overrides?: CallOverrides): Promise; + owner(overrides?: CallOverrides): Promise; + prices(overrides?: CallOverrides): Promise; + recoverFunds(_token: PromiseOrValue, _to: PromiseOrValue, _amount: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + register(name: PromiseOrValue, owner: PromiseOrValue, duration: PromiseOrValue, secret: PromiseOrValue, resolver: PromiseOrValue, data: PromiseOrValue[], reverseRecord: PromiseOrValue, ownerControlledFuses: PromiseOrValue, overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + renew(name: PromiseOrValue, duration: PromiseOrValue, overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + renounceOwnership(overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + rentPrice(name: PromiseOrValue, duration: PromiseOrValue, overrides?: CallOverrides): Promise; + reverseRegistrar(overrides?: CallOverrides): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + valid(name: PromiseOrValue, overrides?: CallOverrides): Promise; + withdraw(overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/Multicall.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/Multicall.d.ts new file mode 100644 index 000000000..98f39d21b --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/Multicall.d.ts @@ -0,0 +1,296 @@ +import type { FunctionFragment, Result } from '@ethersproject/abi'; +import { Interface } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/abstract-provider'; +import type { Signer } from '@ethersproject/abstract-signer'; +import type { BigNumber, BigNumberish } from '@ethersproject/bignumber'; +import type { BytesLike } from '@ethersproject/bytes'; +import type { BaseContract, CallOverrides, ContractTransaction, PayableOverrides, PopulatedTransaction } from '@ethersproject/contracts'; +import type { OnEvent, PromiseOrValue, TypedEvent, TypedEventFilter, TypedListener } from './common'; +export declare namespace Multicall3 { + type CallStruct = { + target: PromiseOrValue; + callData: PromiseOrValue; + }; + type CallStructOutput = [string, string] & { + target: string; + callData: string; + }; + type Call3Struct = { + target: PromiseOrValue; + allowFailure: PromiseOrValue; + callData: PromiseOrValue; + }; + type Call3StructOutput = [string, boolean, string] & { + target: string; + allowFailure: boolean; + callData: string; + }; + type ResultStruct = { + success: PromiseOrValue; + returnData: PromiseOrValue; + }; + type ResultStructOutput = [boolean, string] & { + success: boolean; + returnData: string; + }; + type Call3ValueStruct = { + target: PromiseOrValue; + allowFailure: PromiseOrValue; + value: PromiseOrValue; + callData: PromiseOrValue; + }; + type Call3ValueStructOutput = [string, boolean, BigNumber, string] & { + target: string; + allowFailure: boolean; + value: BigNumber; + callData: string; + }; +} +export interface MulticallInterface extends Interface { + functions: { + 'aggregate((address,bytes)[])': FunctionFragment; + 'aggregate3((address,bool,bytes)[])': FunctionFragment; + 'aggregate3Value((address,bool,uint256,bytes)[])': FunctionFragment; + 'blockAndAggregate((address,bytes)[])': FunctionFragment; + 'getBasefee()': FunctionFragment; + 'getBlockHash(uint256)': FunctionFragment; + 'getBlockNumber()': FunctionFragment; + 'getChainId()': FunctionFragment; + 'getCurrentBlockCoinbase()': FunctionFragment; + 'getCurrentBlockDifficulty()': FunctionFragment; + 'getCurrentBlockGasLimit()': FunctionFragment; + 'getCurrentBlockTimestamp()': FunctionFragment; + 'getEthBalance(address)': FunctionFragment; + 'getLastBlockHash()': FunctionFragment; + 'tryAggregate(bool,(address,bytes)[])': FunctionFragment; + 'tryBlockAndAggregate(bool,(address,bytes)[])': FunctionFragment; + }; + getFunction(nameOrSignatureOrTopic: 'aggregate' | 'aggregate3' | 'aggregate3Value' | 'blockAndAggregate' | 'getBasefee' | 'getBlockHash' | 'getBlockNumber' | 'getChainId' | 'getCurrentBlockCoinbase' | 'getCurrentBlockDifficulty' | 'getCurrentBlockGasLimit' | 'getCurrentBlockTimestamp' | 'getEthBalance' | 'getLastBlockHash' | 'tryAggregate' | 'tryBlockAndAggregate'): FunctionFragment; + encodeFunctionData(functionFragment: 'aggregate', values: [Multicall3.CallStruct[]]): string; + encodeFunctionData(functionFragment: 'aggregate3', values: [Multicall3.Call3Struct[]]): string; + encodeFunctionData(functionFragment: 'aggregate3Value', values: [Multicall3.Call3ValueStruct[]]): string; + encodeFunctionData(functionFragment: 'blockAndAggregate', values: [Multicall3.CallStruct[]]): string; + encodeFunctionData(functionFragment: 'getBasefee', values?: undefined): string; + encodeFunctionData(functionFragment: 'getBlockHash', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'getBlockNumber', values?: undefined): string; + encodeFunctionData(functionFragment: 'getChainId', values?: undefined): string; + encodeFunctionData(functionFragment: 'getCurrentBlockCoinbase', values?: undefined): string; + encodeFunctionData(functionFragment: 'getCurrentBlockDifficulty', values?: undefined): string; + encodeFunctionData(functionFragment: 'getCurrentBlockGasLimit', values?: undefined): string; + encodeFunctionData(functionFragment: 'getCurrentBlockTimestamp', values?: undefined): string; + encodeFunctionData(functionFragment: 'getEthBalance', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'getLastBlockHash', values?: undefined): string; + encodeFunctionData(functionFragment: 'tryAggregate', values: [PromiseOrValue, Multicall3.CallStruct[]]): string; + encodeFunctionData(functionFragment: 'tryBlockAndAggregate', values: [PromiseOrValue, Multicall3.CallStruct[]]): string; + decodeFunctionResult(functionFragment: 'aggregate', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'aggregate3', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'aggregate3Value', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'blockAndAggregate', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getBasefee', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getBlockHash', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getBlockNumber', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getChainId', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getCurrentBlockCoinbase', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getCurrentBlockDifficulty', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getCurrentBlockGasLimit', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getCurrentBlockTimestamp', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getEthBalance', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getLastBlockHash', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'tryAggregate', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'tryBlockAndAggregate', data: BytesLike): Result; + events: {}; +} +export interface Multicall extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + interface: MulticallInterface; + queryFilter(event: TypedEventFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>; + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + functions: { + aggregate(calls: Multicall3.CallStruct[], overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + aggregate3(calls: Multicall3.Call3Struct[], overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + aggregate3Value(calls: Multicall3.Call3ValueStruct[], overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + blockAndAggregate(calls: Multicall3.CallStruct[], overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + getBasefee(overrides?: CallOverrides): Promise<[BigNumber] & { + basefee: BigNumber; + }>; + getBlockHash(blockNumber: PromiseOrValue, overrides?: CallOverrides): Promise<[string] & { + blockHash: string; + }>; + getBlockNumber(overrides?: CallOverrides): Promise<[BigNumber] & { + blockNumber: BigNumber; + }>; + getChainId(overrides?: CallOverrides): Promise<[BigNumber] & { + chainid: BigNumber; + }>; + getCurrentBlockCoinbase(overrides?: CallOverrides): Promise<[string] & { + coinbase: string; + }>; + getCurrentBlockDifficulty(overrides?: CallOverrides): Promise<[BigNumber] & { + difficulty: BigNumber; + }>; + getCurrentBlockGasLimit(overrides?: CallOverrides): Promise<[BigNumber] & { + gaslimit: BigNumber; + }>; + getCurrentBlockTimestamp(overrides?: CallOverrides): Promise<[BigNumber] & { + timestamp: BigNumber; + }>; + getEthBalance(addr: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber] & { + balance: BigNumber; + }>; + getLastBlockHash(overrides?: CallOverrides): Promise<[string] & { + blockHash: string; + }>; + tryAggregate(requireSuccess: PromiseOrValue, calls: Multicall3.CallStruct[], overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + tryBlockAndAggregate(requireSuccess: PromiseOrValue, calls: Multicall3.CallStruct[], overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + }; + aggregate(calls: Multicall3.CallStruct[], overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + aggregate3(calls: Multicall3.Call3Struct[], overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + aggregate3Value(calls: Multicall3.Call3ValueStruct[], overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + blockAndAggregate(calls: Multicall3.CallStruct[], overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + getBasefee(overrides?: CallOverrides): Promise; + getBlockHash(blockNumber: PromiseOrValue, overrides?: CallOverrides): Promise; + getBlockNumber(overrides?: CallOverrides): Promise; + getChainId(overrides?: CallOverrides): Promise; + getCurrentBlockCoinbase(overrides?: CallOverrides): Promise; + getCurrentBlockDifficulty(overrides?: CallOverrides): Promise; + getCurrentBlockGasLimit(overrides?: CallOverrides): Promise; + getCurrentBlockTimestamp(overrides?: CallOverrides): Promise; + getEthBalance(addr: PromiseOrValue, overrides?: CallOverrides): Promise; + getLastBlockHash(overrides?: CallOverrides): Promise; + tryAggregate(requireSuccess: PromiseOrValue, calls: Multicall3.CallStruct[], overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + tryBlockAndAggregate(requireSuccess: PromiseOrValue, calls: Multicall3.CallStruct[], overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + callStatic: { + aggregate(calls: Multicall3.CallStruct[], overrides?: CallOverrides): Promise<[ + BigNumber, + string[] + ] & { + blockNumber: BigNumber; + returnData: string[]; + }>; + aggregate3(calls: Multicall3.Call3Struct[], overrides?: CallOverrides): Promise; + aggregate3Value(calls: Multicall3.Call3ValueStruct[], overrides?: CallOverrides): Promise; + blockAndAggregate(calls: Multicall3.CallStruct[], overrides?: CallOverrides): Promise<[ + BigNumber, + string, + Multicall3.ResultStructOutput[] + ] & { + blockNumber: BigNumber; + blockHash: string; + returnData: Multicall3.ResultStructOutput[]; + }>; + getBasefee(overrides?: CallOverrides): Promise; + getBlockHash(blockNumber: PromiseOrValue, overrides?: CallOverrides): Promise; + getBlockNumber(overrides?: CallOverrides): Promise; + getChainId(overrides?: CallOverrides): Promise; + getCurrentBlockCoinbase(overrides?: CallOverrides): Promise; + getCurrentBlockDifficulty(overrides?: CallOverrides): Promise; + getCurrentBlockGasLimit(overrides?: CallOverrides): Promise; + getCurrentBlockTimestamp(overrides?: CallOverrides): Promise; + getEthBalance(addr: PromiseOrValue, overrides?: CallOverrides): Promise; + getLastBlockHash(overrides?: CallOverrides): Promise; + tryAggregate(requireSuccess: PromiseOrValue, calls: Multicall3.CallStruct[], overrides?: CallOverrides): Promise; + tryBlockAndAggregate(requireSuccess: PromiseOrValue, calls: Multicall3.CallStruct[], overrides?: CallOverrides): Promise<[ + BigNumber, + string, + Multicall3.ResultStructOutput[] + ] & { + blockNumber: BigNumber; + blockHash: string; + returnData: Multicall3.ResultStructOutput[]; + }>; + }; + filters: {}; + estimateGas: { + aggregate(calls: Multicall3.CallStruct[], overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + aggregate3(calls: Multicall3.Call3Struct[], overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + aggregate3Value(calls: Multicall3.Call3ValueStruct[], overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + blockAndAggregate(calls: Multicall3.CallStruct[], overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + getBasefee(overrides?: CallOverrides): Promise; + getBlockHash(blockNumber: PromiseOrValue, overrides?: CallOverrides): Promise; + getBlockNumber(overrides?: CallOverrides): Promise; + getChainId(overrides?: CallOverrides): Promise; + getCurrentBlockCoinbase(overrides?: CallOverrides): Promise; + getCurrentBlockDifficulty(overrides?: CallOverrides): Promise; + getCurrentBlockGasLimit(overrides?: CallOverrides): Promise; + getCurrentBlockTimestamp(overrides?: CallOverrides): Promise; + getEthBalance(addr: PromiseOrValue, overrides?: CallOverrides): Promise; + getLastBlockHash(overrides?: CallOverrides): Promise; + tryAggregate(requireSuccess: PromiseOrValue, calls: Multicall3.CallStruct[], overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + tryBlockAndAggregate(requireSuccess: PromiseOrValue, calls: Multicall3.CallStruct[], overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + }; + populateTransaction: { + aggregate(calls: Multicall3.CallStruct[], overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + aggregate3(calls: Multicall3.Call3Struct[], overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + aggregate3Value(calls: Multicall3.Call3ValueStruct[], overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + blockAndAggregate(calls: Multicall3.CallStruct[], overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + getBasefee(overrides?: CallOverrides): Promise; + getBlockHash(blockNumber: PromiseOrValue, overrides?: CallOverrides): Promise; + getBlockNumber(overrides?: CallOverrides): Promise; + getChainId(overrides?: CallOverrides): Promise; + getCurrentBlockCoinbase(overrides?: CallOverrides): Promise; + getCurrentBlockDifficulty(overrides?: CallOverrides): Promise; + getCurrentBlockGasLimit(overrides?: CallOverrides): Promise; + getCurrentBlockTimestamp(overrides?: CallOverrides): Promise; + getEthBalance(addr: PromiseOrValue, overrides?: CallOverrides): Promise; + getLastBlockHash(overrides?: CallOverrides): Promise; + tryAggregate(requireSuccess: PromiseOrValue, calls: Multicall3.CallStruct[], overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + tryBlockAndAggregate(requireSuccess: PromiseOrValue, calls: Multicall3.CallStruct[], overrides?: PayableOverrides & { + from?: PromiseOrValue; + }): Promise; + }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/NameWrapper.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/NameWrapper.d.ts new file mode 100644 index 000000000..03a9cab95 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/NameWrapper.d.ts @@ -0,0 +1,859 @@ +import type { EventFragment, FunctionFragment, Result } from '@ethersproject/abi'; +import { Interface } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/abstract-provider'; +import type { Signer } from '@ethersproject/abstract-signer'; +import type { BigNumber, BigNumberish } from '@ethersproject/bignumber'; +import type { BytesLike } from '@ethersproject/bytes'; +import type { BaseContract, CallOverrides, ContractTransaction, Overrides, PopulatedTransaction } from '@ethersproject/contracts'; +import type { OnEvent, PromiseOrValue, TypedEvent, TypedEventFilter, TypedListener } from './common'; +export interface NameWrapperInterface extends Interface { + functions: { + '_tokens(uint256)': FunctionFragment; + 'allFusesBurned(bytes32,uint32)': FunctionFragment; + 'balanceOf(address,uint256)': FunctionFragment; + 'balanceOfBatch(address[],uint256[])': FunctionFragment; + 'canModifyName(bytes32,address)': FunctionFragment; + 'controllers(address)': FunctionFragment; + 'ens()': FunctionFragment; + 'extendExpiry(bytes32,bytes32,uint64)': FunctionFragment; + 'getData(uint256)': FunctionFragment; + 'isApprovedForAll(address,address)': FunctionFragment; + 'isWrapped(bytes32)': FunctionFragment; + 'metadataService()': FunctionFragment; + 'name()': FunctionFragment; + 'names(bytes32)': FunctionFragment; + 'onERC721Received(address,address,uint256,bytes)': FunctionFragment; + 'owner()': FunctionFragment; + 'ownerOf(uint256)': FunctionFragment; + 'recoverFunds(address,address,uint256)': FunctionFragment; + 'registerAndWrapETH2LD(string,address,uint256,address,uint16)': FunctionFragment; + 'registrar()': FunctionFragment; + 'renew(uint256,uint256)': FunctionFragment; + 'renounceOwnership()': FunctionFragment; + 'safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)': FunctionFragment; + 'safeTransferFrom(address,address,uint256,uint256,bytes)': FunctionFragment; + 'setApprovalForAll(address,bool)': FunctionFragment; + 'setChildFuses(bytes32,bytes32,uint32,uint64)': FunctionFragment; + 'setController(address,bool)': FunctionFragment; + 'setFuses(bytes32,uint16)': FunctionFragment; + 'setMetadataService(address)': FunctionFragment; + 'setRecord(bytes32,address,address,uint64)': FunctionFragment; + 'setResolver(bytes32,address)': FunctionFragment; + 'setSubnodeOwner(bytes32,string,address,uint32,uint64)': FunctionFragment; + 'setSubnodeRecord(bytes32,string,address,address,uint64,uint32,uint64)': FunctionFragment; + 'setTTL(bytes32,uint64)': FunctionFragment; + 'setUpgradeContract(address)': FunctionFragment; + 'supportsInterface(bytes4)': FunctionFragment; + 'transferOwnership(address)': FunctionFragment; + 'unwrap(bytes32,bytes32,address)': FunctionFragment; + 'unwrapETH2LD(bytes32,address,address)': FunctionFragment; + 'upgrade(bytes32,string,address,address)': FunctionFragment; + 'upgradeContract()': FunctionFragment; + 'upgradeETH2LD(string,address,address)': FunctionFragment; + 'uri(uint256)': FunctionFragment; + 'wrap(bytes,address,address)': FunctionFragment; + 'wrapETH2LD(string,address,uint16,address)': FunctionFragment; + }; + getFunction(nameOrSignatureOrTopic: '_tokens' | 'allFusesBurned' | 'balanceOf' | 'balanceOfBatch' | 'canModifyName' | 'controllers' | 'ens' | 'extendExpiry' | 'getData' | 'isApprovedForAll' | 'isWrapped' | 'metadataService' | 'name' | 'names' | 'onERC721Received' | 'owner' | 'ownerOf' | 'recoverFunds' | 'registerAndWrapETH2LD' | 'registrar' | 'renew' | 'renounceOwnership' | 'safeBatchTransferFrom' | 'safeTransferFrom' | 'setApprovalForAll' | 'setChildFuses' | 'setController' | 'setFuses' | 'setMetadataService' | 'setRecord' | 'setResolver' | 'setSubnodeOwner' | 'setSubnodeRecord' | 'setTTL' | 'setUpgradeContract' | 'supportsInterface' | 'transferOwnership' | 'unwrap' | 'unwrapETH2LD' | 'upgrade' | 'upgradeContract' | 'upgradeETH2LD' | 'uri' | 'wrap' | 'wrapETH2LD'): FunctionFragment; + encodeFunctionData(functionFragment: '_tokens', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'allFusesBurned', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'balanceOf', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'balanceOfBatch', values: [PromiseOrValue[], PromiseOrValue[]]): string; + encodeFunctionData(functionFragment: 'canModifyName', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'controllers', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'ens', values?: undefined): string; + encodeFunctionData(functionFragment: 'extendExpiry', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'getData', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'isApprovedForAll', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'isWrapped', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'metadataService', values?: undefined): string; + encodeFunctionData(functionFragment: 'name', values?: undefined): string; + encodeFunctionData(functionFragment: 'names', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'onERC721Received', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'owner', values?: undefined): string; + encodeFunctionData(functionFragment: 'ownerOf', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'recoverFunds', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'registerAndWrapETH2LD', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'registrar', values?: undefined): string; + encodeFunctionData(functionFragment: 'renew', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'renounceOwnership', values?: undefined): string; + encodeFunctionData(functionFragment: 'safeBatchTransferFrom', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue[], + PromiseOrValue[], + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'safeTransferFrom', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'setApprovalForAll', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setChildFuses', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'setController', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setFuses', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setMetadataService', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setRecord', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'setResolver', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setSubnodeOwner', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'setSubnodeRecord', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'setTTL', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setUpgradeContract', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'supportsInterface', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'transferOwnership', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'unwrap', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'unwrapETH2LD', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'upgrade', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'upgradeContract', values?: undefined): string; + encodeFunctionData(functionFragment: 'upgradeETH2LD', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'uri', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'wrap', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'wrapETH2LD', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + decodeFunctionResult(functionFragment: '_tokens', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'allFusesBurned', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'balanceOfBatch', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'canModifyName', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'controllers', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'ens', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'extendExpiry', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'getData', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'isApprovedForAll', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'isWrapped', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'metadataService', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'names', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'onERC721Received', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'ownerOf', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'recoverFunds', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'registerAndWrapETH2LD', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'registrar', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'renew', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'renounceOwnership', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'safeBatchTransferFrom', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'safeTransferFrom', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setApprovalForAll', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setChildFuses', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setController', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setFuses', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setMetadataService', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setRecord', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setResolver', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setSubnodeOwner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setSubnodeRecord', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setTTL', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setUpgradeContract', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'supportsInterface', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferOwnership', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'unwrap', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'unwrapETH2LD', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'upgrade', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'upgradeContract', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'upgradeETH2LD', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'uri', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'wrap', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'wrapETH2LD', data: BytesLike): Result; + events: { + 'ApprovalForAll(address,address,bool)': EventFragment; + 'ControllerChanged(address,bool)': EventFragment; + 'ExpiryExtended(bytes32,uint64)': EventFragment; + 'FusesSet(bytes32,uint32)': EventFragment; + 'NameUnwrapped(bytes32,address)': EventFragment; + 'NameWrapped(bytes32,bytes,address,uint32,uint64)': EventFragment; + 'OwnershipTransferred(address,address)': EventFragment; + 'TransferBatch(address,address,address,uint256[],uint256[])': EventFragment; + 'TransferSingle(address,address,address,uint256,uint256)': EventFragment; + 'URI(string,uint256)': EventFragment; + }; + getEvent(nameOrSignatureOrTopic: 'ApprovalForAll'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'ControllerChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'ExpiryExtended'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'FusesSet'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'NameUnwrapped'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'NameWrapped'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OwnershipTransferred'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'TransferBatch'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'TransferSingle'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'URI'): EventFragment; +} +export interface ApprovalForAllEventObject { + account: string; + operator: string; + approved: boolean; +} +export declare type ApprovalForAllEvent = TypedEvent<[ + string, + string, + boolean +], ApprovalForAllEventObject>; +export declare type ApprovalForAllEventFilter = TypedEventFilter; +export interface ControllerChangedEventObject { + controller: string; + active: boolean; +} +export declare type ControllerChangedEvent = TypedEvent<[ + string, + boolean +], ControllerChangedEventObject>; +export declare type ControllerChangedEventFilter = TypedEventFilter; +export interface ExpiryExtendedEventObject { + node: string; + expiry: BigNumber; +} +export declare type ExpiryExtendedEvent = TypedEvent<[ + string, + BigNumber +], ExpiryExtendedEventObject>; +export declare type ExpiryExtendedEventFilter = TypedEventFilter; +export interface FusesSetEventObject { + node: string; + fuses: number; +} +export declare type FusesSetEvent = TypedEvent<[string, number], FusesSetEventObject>; +export declare type FusesSetEventFilter = TypedEventFilter; +export interface NameUnwrappedEventObject { + node: string; + owner: string; +} +export declare type NameUnwrappedEvent = TypedEvent<[ + string, + string +], NameUnwrappedEventObject>; +export declare type NameUnwrappedEventFilter = TypedEventFilter; +export interface NameWrappedEventObject { + node: string; + name: string; + owner: string; + fuses: number; + expiry: BigNumber; +} +export declare type NameWrappedEvent = TypedEvent<[ + string, + string, + string, + number, + BigNumber +], NameWrappedEventObject>; +export declare type NameWrappedEventFilter = TypedEventFilter; +export interface OwnershipTransferredEventObject { + previousOwner: string; + newOwner: string; +} +export declare type OwnershipTransferredEvent = TypedEvent<[ + string, + string +], OwnershipTransferredEventObject>; +export declare type OwnershipTransferredEventFilter = TypedEventFilter; +export interface TransferBatchEventObject { + operator: string; + from: string; + to: string; + ids: BigNumber[]; + values: BigNumber[]; +} +export declare type TransferBatchEvent = TypedEvent<[ + string, + string, + string, + BigNumber[], + BigNumber[] +], TransferBatchEventObject>; +export declare type TransferBatchEventFilter = TypedEventFilter; +export interface TransferSingleEventObject { + operator: string; + from: string; + to: string; + id: BigNumber; + value: BigNumber; +} +export declare type TransferSingleEvent = TypedEvent<[ + string, + string, + string, + BigNumber, + BigNumber +], TransferSingleEventObject>; +export declare type TransferSingleEventFilter = TypedEventFilter; +export interface URIEventObject { + value: string; + id: BigNumber; +} +export declare type URIEvent = TypedEvent<[string, BigNumber], URIEventObject>; +export declare type URIEventFilter = TypedEventFilter; +export interface NameWrapper extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + interface: NameWrapperInterface; + queryFilter(event: TypedEventFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>; + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + functions: { + _tokens(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; + allFusesBurned(node: PromiseOrValue, fuseMask: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + balanceOf(account: PromiseOrValue, id: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; + balanceOfBatch(accounts: PromiseOrValue[], ids: PromiseOrValue[], overrides?: CallOverrides): Promise<[BigNumber[]]>; + canModifyName(node: PromiseOrValue, addr: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + controllers(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + ens(overrides?: CallOverrides): Promise<[string]>; + extendExpiry(parentNode: PromiseOrValue, labelhash: PromiseOrValue, expiry: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + getData(id: PromiseOrValue, overrides?: CallOverrides): Promise<[ + string, + number, + BigNumber + ] & { + owner: string; + fuses: number; + expiry: BigNumber; + }>; + isApprovedForAll(account: PromiseOrValue, operator: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + isWrapped(node: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + metadataService(overrides?: CallOverrides): Promise<[string]>; + name(overrides?: CallOverrides): Promise<[string]>; + names(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + onERC721Received(to: PromiseOrValue, arg1: PromiseOrValue, tokenId: PromiseOrValue, data: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + owner(overrides?: CallOverrides): Promise<[string]>; + ownerOf(id: PromiseOrValue, overrides?: CallOverrides): Promise<[string] & { + owner: string; + }>; + recoverFunds(_token: PromiseOrValue, _to: PromiseOrValue, _amount: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + registerAndWrapETH2LD(label: PromiseOrValue, wrappedOwner: PromiseOrValue, duration: PromiseOrValue, resolver: PromiseOrValue, ownerControlledFuses: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + registrar(overrides?: CallOverrides): Promise<[string]>; + renew(tokenId: PromiseOrValue, duration: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + renounceOwnership(overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + safeBatchTransferFrom(from: PromiseOrValue, to: PromiseOrValue, ids: PromiseOrValue[], amounts: PromiseOrValue[], data: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + safeTransferFrom(from: PromiseOrValue, to: PromiseOrValue, id: PromiseOrValue, amount: PromiseOrValue, data: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setApprovalForAll(operator: PromiseOrValue, approved: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setChildFuses(parentNode: PromiseOrValue, labelhash: PromiseOrValue, fuses: PromiseOrValue, expiry: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setController(controller: PromiseOrValue, active: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setFuses(node: PromiseOrValue, ownerControlledFuses: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setMetadataService(_metadataService: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setRecord(node: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, ttl: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setResolver(node: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setSubnodeOwner(parentNode: PromiseOrValue, label: PromiseOrValue, owner: PromiseOrValue, fuses: PromiseOrValue, expiry: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setSubnodeRecord(parentNode: PromiseOrValue, label: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, ttl: PromiseOrValue, fuses: PromiseOrValue, expiry: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setTTL(node: PromiseOrValue, ttl: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setUpgradeContract(_upgradeAddress: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + supportsInterface(interfaceId: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + transferOwnership(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + unwrap(parentNode: PromiseOrValue, labelhash: PromiseOrValue, controller: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + unwrapETH2LD(labelhash: PromiseOrValue, registrant: PromiseOrValue, controller: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + upgrade(parentNode: PromiseOrValue, label: PromiseOrValue, wrappedOwner: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + upgradeContract(overrides?: CallOverrides): Promise<[string]>; + upgradeETH2LD(label: PromiseOrValue, wrappedOwner: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + uri(tokenId: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + wrap(name: PromiseOrValue, wrappedOwner: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + wrapETH2LD(label: PromiseOrValue, wrappedOwner: PromiseOrValue, ownerControlledFuses: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + }; + _tokens(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + allFusesBurned(node: PromiseOrValue, fuseMask: PromiseOrValue, overrides?: CallOverrides): Promise; + balanceOf(account: PromiseOrValue, id: PromiseOrValue, overrides?: CallOverrides): Promise; + balanceOfBatch(accounts: PromiseOrValue[], ids: PromiseOrValue[], overrides?: CallOverrides): Promise; + canModifyName(node: PromiseOrValue, addr: PromiseOrValue, overrides?: CallOverrides): Promise; + controllers(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + ens(overrides?: CallOverrides): Promise; + extendExpiry(parentNode: PromiseOrValue, labelhash: PromiseOrValue, expiry: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + getData(id: PromiseOrValue, overrides?: CallOverrides): Promise<[ + string, + number, + BigNumber + ] & { + owner: string; + fuses: number; + expiry: BigNumber; + }>; + isApprovedForAll(account: PromiseOrValue, operator: PromiseOrValue, overrides?: CallOverrides): Promise; + isWrapped(node: PromiseOrValue, overrides?: CallOverrides): Promise; + metadataService(overrides?: CallOverrides): Promise; + name(overrides?: CallOverrides): Promise; + names(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + onERC721Received(to: PromiseOrValue, arg1: PromiseOrValue, tokenId: PromiseOrValue, data: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + owner(overrides?: CallOverrides): Promise; + ownerOf(id: PromiseOrValue, overrides?: CallOverrides): Promise; + recoverFunds(_token: PromiseOrValue, _to: PromiseOrValue, _amount: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + registerAndWrapETH2LD(label: PromiseOrValue, wrappedOwner: PromiseOrValue, duration: PromiseOrValue, resolver: PromiseOrValue, ownerControlledFuses: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + registrar(overrides?: CallOverrides): Promise; + renew(tokenId: PromiseOrValue, duration: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + renounceOwnership(overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + safeBatchTransferFrom(from: PromiseOrValue, to: PromiseOrValue, ids: PromiseOrValue[], amounts: PromiseOrValue[], data: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + safeTransferFrom(from: PromiseOrValue, to: PromiseOrValue, id: PromiseOrValue, amount: PromiseOrValue, data: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setApprovalForAll(operator: PromiseOrValue, approved: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setChildFuses(parentNode: PromiseOrValue, labelhash: PromiseOrValue, fuses: PromiseOrValue, expiry: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setController(controller: PromiseOrValue, active: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setFuses(node: PromiseOrValue, ownerControlledFuses: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setMetadataService(_metadataService: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setRecord(node: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, ttl: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setResolver(node: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setSubnodeOwner(parentNode: PromiseOrValue, label: PromiseOrValue, owner: PromiseOrValue, fuses: PromiseOrValue, expiry: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setSubnodeRecord(parentNode: PromiseOrValue, label: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, ttl: PromiseOrValue, fuses: PromiseOrValue, expiry: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setTTL(node: PromiseOrValue, ttl: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setUpgradeContract(_upgradeAddress: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + supportsInterface(interfaceId: PromiseOrValue, overrides?: CallOverrides): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + unwrap(parentNode: PromiseOrValue, labelhash: PromiseOrValue, controller: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + unwrapETH2LD(labelhash: PromiseOrValue, registrant: PromiseOrValue, controller: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + upgrade(parentNode: PromiseOrValue, label: PromiseOrValue, wrappedOwner: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + upgradeContract(overrides?: CallOverrides): Promise; + upgradeETH2LD(label: PromiseOrValue, wrappedOwner: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + uri(tokenId: PromiseOrValue, overrides?: CallOverrides): Promise; + wrap(name: PromiseOrValue, wrappedOwner: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + wrapETH2LD(label: PromiseOrValue, wrappedOwner: PromiseOrValue, ownerControlledFuses: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + callStatic: { + _tokens(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + allFusesBurned(node: PromiseOrValue, fuseMask: PromiseOrValue, overrides?: CallOverrides): Promise; + balanceOf(account: PromiseOrValue, id: PromiseOrValue, overrides?: CallOverrides): Promise; + balanceOfBatch(accounts: PromiseOrValue[], ids: PromiseOrValue[], overrides?: CallOverrides): Promise; + canModifyName(node: PromiseOrValue, addr: PromiseOrValue, overrides?: CallOverrides): Promise; + controllers(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + ens(overrides?: CallOverrides): Promise; + extendExpiry(parentNode: PromiseOrValue, labelhash: PromiseOrValue, expiry: PromiseOrValue, overrides?: CallOverrides): Promise; + getData(id: PromiseOrValue, overrides?: CallOverrides): Promise<[ + string, + number, + BigNumber + ] & { + owner: string; + fuses: number; + expiry: BigNumber; + }>; + isApprovedForAll(account: PromiseOrValue, operator: PromiseOrValue, overrides?: CallOverrides): Promise; + isWrapped(node: PromiseOrValue, overrides?: CallOverrides): Promise; + metadataService(overrides?: CallOverrides): Promise; + name(overrides?: CallOverrides): Promise; + names(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + onERC721Received(to: PromiseOrValue, arg1: PromiseOrValue, tokenId: PromiseOrValue, data: PromiseOrValue, overrides?: CallOverrides): Promise; + owner(overrides?: CallOverrides): Promise; + ownerOf(id: PromiseOrValue, overrides?: CallOverrides): Promise; + recoverFunds(_token: PromiseOrValue, _to: PromiseOrValue, _amount: PromiseOrValue, overrides?: CallOverrides): Promise; + registerAndWrapETH2LD(label: PromiseOrValue, wrappedOwner: PromiseOrValue, duration: PromiseOrValue, resolver: PromiseOrValue, ownerControlledFuses: PromiseOrValue, overrides?: CallOverrides): Promise; + registrar(overrides?: CallOverrides): Promise; + renew(tokenId: PromiseOrValue, duration: PromiseOrValue, overrides?: CallOverrides): Promise; + renounceOwnership(overrides?: CallOverrides): Promise; + safeBatchTransferFrom(from: PromiseOrValue, to: PromiseOrValue, ids: PromiseOrValue[], amounts: PromiseOrValue[], data: PromiseOrValue, overrides?: CallOverrides): Promise; + safeTransferFrom(from: PromiseOrValue, to: PromiseOrValue, id: PromiseOrValue, amount: PromiseOrValue, data: PromiseOrValue, overrides?: CallOverrides): Promise; + setApprovalForAll(operator: PromiseOrValue, approved: PromiseOrValue, overrides?: CallOverrides): Promise; + setChildFuses(parentNode: PromiseOrValue, labelhash: PromiseOrValue, fuses: PromiseOrValue, expiry: PromiseOrValue, overrides?: CallOverrides): Promise; + setController(controller: PromiseOrValue, active: PromiseOrValue, overrides?: CallOverrides): Promise; + setFuses(node: PromiseOrValue, ownerControlledFuses: PromiseOrValue, overrides?: CallOverrides): Promise; + setMetadataService(_metadataService: PromiseOrValue, overrides?: CallOverrides): Promise; + setRecord(node: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, ttl: PromiseOrValue, overrides?: CallOverrides): Promise; + setResolver(node: PromiseOrValue, resolver: PromiseOrValue, overrides?: CallOverrides): Promise; + setSubnodeOwner(parentNode: PromiseOrValue, label: PromiseOrValue, owner: PromiseOrValue, fuses: PromiseOrValue, expiry: PromiseOrValue, overrides?: CallOverrides): Promise; + setSubnodeRecord(parentNode: PromiseOrValue, label: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, ttl: PromiseOrValue, fuses: PromiseOrValue, expiry: PromiseOrValue, overrides?: CallOverrides): Promise; + setTTL(node: PromiseOrValue, ttl: PromiseOrValue, overrides?: CallOverrides): Promise; + setUpgradeContract(_upgradeAddress: PromiseOrValue, overrides?: CallOverrides): Promise; + supportsInterface(interfaceId: PromiseOrValue, overrides?: CallOverrides): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: CallOverrides): Promise; + unwrap(parentNode: PromiseOrValue, labelhash: PromiseOrValue, controller: PromiseOrValue, overrides?: CallOverrides): Promise; + unwrapETH2LD(labelhash: PromiseOrValue, registrant: PromiseOrValue, controller: PromiseOrValue, overrides?: CallOverrides): Promise; + upgrade(parentNode: PromiseOrValue, label: PromiseOrValue, wrappedOwner: PromiseOrValue, resolver: PromiseOrValue, overrides?: CallOverrides): Promise; + upgradeContract(overrides?: CallOverrides): Promise; + upgradeETH2LD(label: PromiseOrValue, wrappedOwner: PromiseOrValue, resolver: PromiseOrValue, overrides?: CallOverrides): Promise; + uri(tokenId: PromiseOrValue, overrides?: CallOverrides): Promise; + wrap(name: PromiseOrValue, wrappedOwner: PromiseOrValue, resolver: PromiseOrValue, overrides?: CallOverrides): Promise; + wrapETH2LD(label: PromiseOrValue, wrappedOwner: PromiseOrValue, ownerControlledFuses: PromiseOrValue, resolver: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + filters: { + 'ApprovalForAll(address,address,bool)'(account?: PromiseOrValue | null, operator?: PromiseOrValue | null, approved?: null): ApprovalForAllEventFilter; + ApprovalForAll(account?: PromiseOrValue | null, operator?: PromiseOrValue | null, approved?: null): ApprovalForAllEventFilter; + 'ControllerChanged(address,bool)'(controller?: PromiseOrValue | null, active?: null): ControllerChangedEventFilter; + ControllerChanged(controller?: PromiseOrValue | null, active?: null): ControllerChangedEventFilter; + 'ExpiryExtended(bytes32,uint64)'(node?: PromiseOrValue | null, expiry?: null): ExpiryExtendedEventFilter; + ExpiryExtended(node?: PromiseOrValue | null, expiry?: null): ExpiryExtendedEventFilter; + 'FusesSet(bytes32,uint32)'(node?: PromiseOrValue | null, fuses?: null): FusesSetEventFilter; + FusesSet(node?: PromiseOrValue | null, fuses?: null): FusesSetEventFilter; + 'NameUnwrapped(bytes32,address)'(node?: PromiseOrValue | null, owner?: null): NameUnwrappedEventFilter; + NameUnwrapped(node?: PromiseOrValue | null, owner?: null): NameUnwrappedEventFilter; + 'NameWrapped(bytes32,bytes,address,uint32,uint64)'(node?: PromiseOrValue | null, name?: null, owner?: null, fuses?: null, expiry?: null): NameWrappedEventFilter; + NameWrapped(node?: PromiseOrValue | null, name?: null, owner?: null, fuses?: null, expiry?: null): NameWrappedEventFilter; + 'OwnershipTransferred(address,address)'(previousOwner?: PromiseOrValue | null, newOwner?: PromiseOrValue | null): OwnershipTransferredEventFilter; + OwnershipTransferred(previousOwner?: PromiseOrValue | null, newOwner?: PromiseOrValue | null): OwnershipTransferredEventFilter; + 'TransferBatch(address,address,address,uint256[],uint256[])'(operator?: PromiseOrValue | null, from?: PromiseOrValue | null, to?: PromiseOrValue | null, ids?: null, values?: null): TransferBatchEventFilter; + TransferBatch(operator?: PromiseOrValue | null, from?: PromiseOrValue | null, to?: PromiseOrValue | null, ids?: null, values?: null): TransferBatchEventFilter; + 'TransferSingle(address,address,address,uint256,uint256)'(operator?: PromiseOrValue | null, from?: PromiseOrValue | null, to?: PromiseOrValue | null, id?: null, value?: null): TransferSingleEventFilter; + TransferSingle(operator?: PromiseOrValue | null, from?: PromiseOrValue | null, to?: PromiseOrValue | null, id?: null, value?: null): TransferSingleEventFilter; + 'URI(string,uint256)'(value?: null, id?: PromiseOrValue | null): URIEventFilter; + URI(value?: null, id?: PromiseOrValue | null): URIEventFilter; + }; + estimateGas: { + _tokens(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + allFusesBurned(node: PromiseOrValue, fuseMask: PromiseOrValue, overrides?: CallOverrides): Promise; + balanceOf(account: PromiseOrValue, id: PromiseOrValue, overrides?: CallOverrides): Promise; + balanceOfBatch(accounts: PromiseOrValue[], ids: PromiseOrValue[], overrides?: CallOverrides): Promise; + canModifyName(node: PromiseOrValue, addr: PromiseOrValue, overrides?: CallOverrides): Promise; + controllers(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + ens(overrides?: CallOverrides): Promise; + extendExpiry(parentNode: PromiseOrValue, labelhash: PromiseOrValue, expiry: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + getData(id: PromiseOrValue, overrides?: CallOverrides): Promise; + isApprovedForAll(account: PromiseOrValue, operator: PromiseOrValue, overrides?: CallOverrides): Promise; + isWrapped(node: PromiseOrValue, overrides?: CallOverrides): Promise; + metadataService(overrides?: CallOverrides): Promise; + name(overrides?: CallOverrides): Promise; + names(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + onERC721Received(to: PromiseOrValue, arg1: PromiseOrValue, tokenId: PromiseOrValue, data: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + owner(overrides?: CallOverrides): Promise; + ownerOf(id: PromiseOrValue, overrides?: CallOverrides): Promise; + recoverFunds(_token: PromiseOrValue, _to: PromiseOrValue, _amount: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + registerAndWrapETH2LD(label: PromiseOrValue, wrappedOwner: PromiseOrValue, duration: PromiseOrValue, resolver: PromiseOrValue, ownerControlledFuses: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + registrar(overrides?: CallOverrides): Promise; + renew(tokenId: PromiseOrValue, duration: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + renounceOwnership(overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + safeBatchTransferFrom(from: PromiseOrValue, to: PromiseOrValue, ids: PromiseOrValue[], amounts: PromiseOrValue[], data: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + safeTransferFrom(from: PromiseOrValue, to: PromiseOrValue, id: PromiseOrValue, amount: PromiseOrValue, data: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setApprovalForAll(operator: PromiseOrValue, approved: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setChildFuses(parentNode: PromiseOrValue, labelhash: PromiseOrValue, fuses: PromiseOrValue, expiry: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setController(controller: PromiseOrValue, active: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setFuses(node: PromiseOrValue, ownerControlledFuses: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setMetadataService(_metadataService: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setRecord(node: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, ttl: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setResolver(node: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setSubnodeOwner(parentNode: PromiseOrValue, label: PromiseOrValue, owner: PromiseOrValue, fuses: PromiseOrValue, expiry: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setSubnodeRecord(parentNode: PromiseOrValue, label: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, ttl: PromiseOrValue, fuses: PromiseOrValue, expiry: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setTTL(node: PromiseOrValue, ttl: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setUpgradeContract(_upgradeAddress: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + supportsInterface(interfaceId: PromiseOrValue, overrides?: CallOverrides): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + unwrap(parentNode: PromiseOrValue, labelhash: PromiseOrValue, controller: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + unwrapETH2LD(labelhash: PromiseOrValue, registrant: PromiseOrValue, controller: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + upgrade(parentNode: PromiseOrValue, label: PromiseOrValue, wrappedOwner: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + upgradeContract(overrides?: CallOverrides): Promise; + upgradeETH2LD(label: PromiseOrValue, wrappedOwner: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + uri(tokenId: PromiseOrValue, overrides?: CallOverrides): Promise; + wrap(name: PromiseOrValue, wrappedOwner: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + wrapETH2LD(label: PromiseOrValue, wrappedOwner: PromiseOrValue, ownerControlledFuses: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + }; + populateTransaction: { + _tokens(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + allFusesBurned(node: PromiseOrValue, fuseMask: PromiseOrValue, overrides?: CallOverrides): Promise; + balanceOf(account: PromiseOrValue, id: PromiseOrValue, overrides?: CallOverrides): Promise; + balanceOfBatch(accounts: PromiseOrValue[], ids: PromiseOrValue[], overrides?: CallOverrides): Promise; + canModifyName(node: PromiseOrValue, addr: PromiseOrValue, overrides?: CallOverrides): Promise; + controllers(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + ens(overrides?: CallOverrides): Promise; + extendExpiry(parentNode: PromiseOrValue, labelhash: PromiseOrValue, expiry: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + getData(id: PromiseOrValue, overrides?: CallOverrides): Promise; + isApprovedForAll(account: PromiseOrValue, operator: PromiseOrValue, overrides?: CallOverrides): Promise; + isWrapped(node: PromiseOrValue, overrides?: CallOverrides): Promise; + metadataService(overrides?: CallOverrides): Promise; + name(overrides?: CallOverrides): Promise; + names(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + onERC721Received(to: PromiseOrValue, arg1: PromiseOrValue, tokenId: PromiseOrValue, data: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + owner(overrides?: CallOverrides): Promise; + ownerOf(id: PromiseOrValue, overrides?: CallOverrides): Promise; + recoverFunds(_token: PromiseOrValue, _to: PromiseOrValue, _amount: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + registerAndWrapETH2LD(label: PromiseOrValue, wrappedOwner: PromiseOrValue, duration: PromiseOrValue, resolver: PromiseOrValue, ownerControlledFuses: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + registrar(overrides?: CallOverrides): Promise; + renew(tokenId: PromiseOrValue, duration: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + renounceOwnership(overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + safeBatchTransferFrom(from: PromiseOrValue, to: PromiseOrValue, ids: PromiseOrValue[], amounts: PromiseOrValue[], data: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + safeTransferFrom(from: PromiseOrValue, to: PromiseOrValue, id: PromiseOrValue, amount: PromiseOrValue, data: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setApprovalForAll(operator: PromiseOrValue, approved: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setChildFuses(parentNode: PromiseOrValue, labelhash: PromiseOrValue, fuses: PromiseOrValue, expiry: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setController(controller: PromiseOrValue, active: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setFuses(node: PromiseOrValue, ownerControlledFuses: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setMetadataService(_metadataService: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setRecord(node: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, ttl: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setResolver(node: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setSubnodeOwner(parentNode: PromiseOrValue, label: PromiseOrValue, owner: PromiseOrValue, fuses: PromiseOrValue, expiry: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setSubnodeRecord(parentNode: PromiseOrValue, label: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, ttl: PromiseOrValue, fuses: PromiseOrValue, expiry: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setTTL(node: PromiseOrValue, ttl: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setUpgradeContract(_upgradeAddress: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + supportsInterface(interfaceId: PromiseOrValue, overrides?: CallOverrides): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + unwrap(parentNode: PromiseOrValue, labelhash: PromiseOrValue, controller: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + unwrapETH2LD(labelhash: PromiseOrValue, registrant: PromiseOrValue, controller: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + upgrade(parentNode: PromiseOrValue, label: PromiseOrValue, wrappedOwner: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + upgradeContract(overrides?: CallOverrides): Promise; + upgradeETH2LD(label: PromiseOrValue, wrappedOwner: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + uri(tokenId: PromiseOrValue, overrides?: CallOverrides): Promise; + wrap(name: PromiseOrValue, wrappedOwner: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + wrapETH2LD(label: PromiseOrValue, wrappedOwner: PromiseOrValue, ownerControlledFuses: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/P256SHA256Algorithm.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/P256SHA256Algorithm.d.ts new file mode 100644 index 000000000..1dddfdaf5 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/P256SHA256Algorithm.d.ts @@ -0,0 +1,80 @@ +import type { FunctionFragment, Result } from '@ethersproject/abi'; +import { Interface } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/abstract-provider'; +import type { Signer } from '@ethersproject/abstract-signer'; +import type { BigNumber } from '@ethersproject/bignumber'; +import type { BytesLike } from '@ethersproject/bytes'; +import type { BaseContract, CallOverrides, PopulatedTransaction } from '@ethersproject/contracts'; +import type { OnEvent, PromiseOrValue, TypedEvent, TypedEventFilter, TypedListener } from './common'; +export interface P256SHA256AlgorithmInterface extends Interface { + functions: { + 'verify(bytes,bytes,bytes)': FunctionFragment; + }; + getFunction(nameOrSignatureOrTopic: 'verify'): FunctionFragment; + encodeFunctionData(functionFragment: 'verify', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + decodeFunctionResult(functionFragment: 'verify', data: BytesLike): Result; + events: {}; +} +export interface P256SHA256Algorithm extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + interface: P256SHA256AlgorithmInterface; + queryFilter(event: TypedEventFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>; + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + functions: { + /** + * Verifies a signature. + * @param data The signed data to verify. + * @param key The public key to verify with. + * @param signature The signature to verify. + */ + verify(key: PromiseOrValue, data: PromiseOrValue, signature: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + }; + /** + * Verifies a signature. + * @param data The signed data to verify. + * @param key The public key to verify with. + * @param signature The signature to verify. + */ + verify(key: PromiseOrValue, data: PromiseOrValue, signature: PromiseOrValue, overrides?: CallOverrides): Promise; + callStatic: { + /** + * Verifies a signature. + * @param data The signed data to verify. + * @param key The public key to verify with. + * @param signature The signature to verify. + */ + verify(key: PromiseOrValue, data: PromiseOrValue, signature: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + filters: {}; + estimateGas: { + /** + * Verifies a signature. + * @param data The signed data to verify. + * @param key The public key to verify with. + * @param signature The signature to verify. + */ + verify(key: PromiseOrValue, data: PromiseOrValue, signature: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + populateTransaction: { + /** + * Verifies a signature. + * @param data The signed data to verify. + * @param key The public key to verify with. + * @param signature The signature to verify. + */ + verify(key: PromiseOrValue, data: PromiseOrValue, signature: PromiseOrValue, overrides?: CallOverrides): Promise; + }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/PublicResolver.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/PublicResolver.d.ts new file mode 100644 index 000000000..3f1d39a91 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/PublicResolver.d.ts @@ -0,0 +1,647 @@ +import type { EventFragment, FunctionFragment, Result } from '@ethersproject/abi'; +import { Interface } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/abstract-provider'; +import type { Signer } from '@ethersproject/abstract-signer'; +import type { BigNumber, BigNumberish } from '@ethersproject/bignumber'; +import type { BytesLike } from '@ethersproject/bytes'; +import type { BaseContract, CallOverrides, ContractTransaction, Overrides, PopulatedTransaction } from '@ethersproject/contracts'; +import type { OnEvent, PromiseOrValue, TypedEvent, TypedEventFilter, TypedListener } from './common'; +export interface PublicResolverInterface extends Interface { + functions: { + 'ABI(bytes32,uint256)': FunctionFragment; + 'addr(bytes32)': FunctionFragment; + 'addr(bytes32,uint256)': FunctionFragment; + 'approve(bytes32,address,bool)': FunctionFragment; + 'clearRecords(bytes32)': FunctionFragment; + 'contenthash(bytes32)': FunctionFragment; + 'dnsRecord(bytes32,bytes32,uint16)': FunctionFragment; + 'hasDNSRecords(bytes32,bytes32)': FunctionFragment; + 'interfaceImplementer(bytes32,bytes4)': FunctionFragment; + 'isApprovedFor(address,bytes32,address)': FunctionFragment; + 'isApprovedForAll(address,address)': FunctionFragment; + 'multicall(bytes[])': FunctionFragment; + 'multicallWithNodeCheck(bytes32,bytes[])': FunctionFragment; + 'name(bytes32)': FunctionFragment; + 'pubkey(bytes32)': FunctionFragment; + 'recordVersions(bytes32)': FunctionFragment; + 'setABI(bytes32,uint256,bytes)': FunctionFragment; + 'setAddr(bytes32,uint256,bytes)': FunctionFragment; + 'setAddr(bytes32,address)': FunctionFragment; + 'setApprovalForAll(address,bool)': FunctionFragment; + 'setContenthash(bytes32,bytes)': FunctionFragment; + 'setDNSRecords(bytes32,bytes)': FunctionFragment; + 'setInterface(bytes32,bytes4,address)': FunctionFragment; + 'setName(bytes32,string)': FunctionFragment; + 'setPubkey(bytes32,bytes32,bytes32)': FunctionFragment; + 'setText(bytes32,string,string)': FunctionFragment; + 'setZonehash(bytes32,bytes)': FunctionFragment; + 'supportsInterface(bytes4)': FunctionFragment; + 'text(bytes32,string)': FunctionFragment; + 'zonehash(bytes32)': FunctionFragment; + }; + getFunction(nameOrSignatureOrTopic: 'ABI' | 'addr(bytes32)' | 'addr(bytes32,uint256)' | 'approve' | 'clearRecords' | 'contenthash' | 'dnsRecord' | 'hasDNSRecords' | 'interfaceImplementer' | 'isApprovedFor' | 'isApprovedForAll' | 'multicall' | 'multicallWithNodeCheck' | 'name' | 'pubkey' | 'recordVersions' | 'setABI' | 'setAddr(bytes32,uint256,bytes)' | 'setAddr(bytes32,address)' | 'setApprovalForAll' | 'setContenthash' | 'setDNSRecords' | 'setInterface' | 'setName' | 'setPubkey' | 'setText' | 'setZonehash' | 'supportsInterface' | 'text' | 'zonehash'): FunctionFragment; + encodeFunctionData(functionFragment: 'ABI', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'addr(bytes32)', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'addr(bytes32,uint256)', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'approve', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'clearRecords', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'contenthash', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'dnsRecord', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'hasDNSRecords', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'interfaceImplementer', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'isApprovedFor', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'isApprovedForAll', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'multicall', values: [PromiseOrValue[]]): string; + encodeFunctionData(functionFragment: 'multicallWithNodeCheck', values: [PromiseOrValue, PromiseOrValue[]]): string; + encodeFunctionData(functionFragment: 'name', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'pubkey', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'recordVersions', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setABI', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'setAddr(bytes32,uint256,bytes)', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'setAddr(bytes32,address)', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setApprovalForAll', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setContenthash', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setDNSRecords', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setInterface', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'setName', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setPubkey', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'setText', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'setZonehash', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'supportsInterface', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'text', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'zonehash', values: [PromiseOrValue]): string; + decodeFunctionResult(functionFragment: 'ABI', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'addr(bytes32)', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'addr(bytes32,uint256)', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'approve', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'clearRecords', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'contenthash', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'dnsRecord', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'hasDNSRecords', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'interfaceImplementer', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'isApprovedFor', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'isApprovedForAll', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'multicall', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'multicallWithNodeCheck', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'pubkey', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'recordVersions', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setABI', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setAddr(bytes32,uint256,bytes)', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setAddr(bytes32,address)', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setApprovalForAll', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setContenthash', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setDNSRecords', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setInterface', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setName', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setPubkey', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setText', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setZonehash', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'supportsInterface', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'text', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'zonehash', data: BytesLike): Result; + events: { + 'ABIChanged(bytes32,uint256)': EventFragment; + 'AddrChanged(bytes32,address)': EventFragment; + 'AddressChanged(bytes32,uint256,bytes)': EventFragment; + 'ApprovalForAll(address,address,bool)': EventFragment; + 'Approved(address,bytes32,address,bool)': EventFragment; + 'ContenthashChanged(bytes32,bytes)': EventFragment; + 'DNSRecordChanged(bytes32,bytes,uint16,bytes)': EventFragment; + 'DNSRecordDeleted(bytes32,bytes,uint16)': EventFragment; + 'DNSZonehashChanged(bytes32,bytes,bytes)': EventFragment; + 'InterfaceChanged(bytes32,bytes4,address)': EventFragment; + 'NameChanged(bytes32,string)': EventFragment; + 'PubkeyChanged(bytes32,bytes32,bytes32)': EventFragment; + 'TextChanged(bytes32,string,string,string)': EventFragment; + 'VersionChanged(bytes32,uint64)': EventFragment; + }; + getEvent(nameOrSignatureOrTopic: 'ABIChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'AddrChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'AddressChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'ApprovalForAll'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'Approved'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'ContenthashChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'DNSRecordChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'DNSRecordDeleted'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'DNSZonehashChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'InterfaceChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'NameChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'PubkeyChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'TextChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'VersionChanged'): EventFragment; +} +export interface ABIChangedEventObject { + node: string; + contentType: BigNumber; +} +export declare type ABIChangedEvent = TypedEvent<[ + string, + BigNumber +], ABIChangedEventObject>; +export declare type ABIChangedEventFilter = TypedEventFilter; +export interface AddrChangedEventObject { + node: string; + a: string; +} +export declare type AddrChangedEvent = TypedEvent<[ + string, + string +], AddrChangedEventObject>; +export declare type AddrChangedEventFilter = TypedEventFilter; +export interface AddressChangedEventObject { + node: string; + coinType: BigNumber; + newAddress: string; +} +export declare type AddressChangedEvent = TypedEvent<[ + string, + BigNumber, + string +], AddressChangedEventObject>; +export declare type AddressChangedEventFilter = TypedEventFilter; +export interface ApprovalForAllEventObject { + owner: string; + operator: string; + approved: boolean; +} +export declare type ApprovalForAllEvent = TypedEvent<[ + string, + string, + boolean +], ApprovalForAllEventObject>; +export declare type ApprovalForAllEventFilter = TypedEventFilter; +export interface ApprovedEventObject { + owner: string; + node: string; + delegate: string; + approved: boolean; +} +export declare type ApprovedEvent = TypedEvent<[ + string, + string, + string, + boolean +], ApprovedEventObject>; +export declare type ApprovedEventFilter = TypedEventFilter; +export interface ContenthashChangedEventObject { + node: string; + hash: string; +} +export declare type ContenthashChangedEvent = TypedEvent<[ + string, + string +], ContenthashChangedEventObject>; +export declare type ContenthashChangedEventFilter = TypedEventFilter; +export interface DNSRecordChangedEventObject { + node: string; + name: string; + resource: number; + record: string; +} +export declare type DNSRecordChangedEvent = TypedEvent<[ + string, + string, + number, + string +], DNSRecordChangedEventObject>; +export declare type DNSRecordChangedEventFilter = TypedEventFilter; +export interface DNSRecordDeletedEventObject { + node: string; + name: string; + resource: number; +} +export declare type DNSRecordDeletedEvent = TypedEvent<[ + string, + string, + number +], DNSRecordDeletedEventObject>; +export declare type DNSRecordDeletedEventFilter = TypedEventFilter; +export interface DNSZonehashChangedEventObject { + node: string; + lastzonehash: string; + zonehash: string; +} +export declare type DNSZonehashChangedEvent = TypedEvent<[ + string, + string, + string +], DNSZonehashChangedEventObject>; +export declare type DNSZonehashChangedEventFilter = TypedEventFilter; +export interface InterfaceChangedEventObject { + node: string; + interfaceID: string; + implementer: string; +} +export declare type InterfaceChangedEvent = TypedEvent<[ + string, + string, + string +], InterfaceChangedEventObject>; +export declare type InterfaceChangedEventFilter = TypedEventFilter; +export interface NameChangedEventObject { + node: string; + name: string; +} +export declare type NameChangedEvent = TypedEvent<[ + string, + string +], NameChangedEventObject>; +export declare type NameChangedEventFilter = TypedEventFilter; +export interface PubkeyChangedEventObject { + node: string; + x: string; + y: string; +} +export declare type PubkeyChangedEvent = TypedEvent<[ + string, + string, + string +], PubkeyChangedEventObject>; +export declare type PubkeyChangedEventFilter = TypedEventFilter; +export interface TextChangedEventObject { + node: string; + indexedKey: string; + key: string; + value: string; +} +export declare type TextChangedEvent = TypedEvent<[ + string, + string, + string, + string +], TextChangedEventObject>; +export declare type TextChangedEventFilter = TypedEventFilter; +export interface VersionChangedEventObject { + node: string; + newVersion: BigNumber; +} +export declare type VersionChangedEvent = TypedEvent<[ + string, + BigNumber +], VersionChangedEventObject>; +export declare type VersionChangedEventFilter = TypedEventFilter; +export interface PublicResolver extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + interface: PublicResolverInterface; + queryFilter(event: TypedEventFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>; + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + functions: { + ABI(node: PromiseOrValue, contentTypes: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber, string]>; + 'addr(bytes32)'(node: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + 'addr(bytes32,uint256)'(node: PromiseOrValue, coinType: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + approve(node: PromiseOrValue, delegate: PromiseOrValue, approved: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + clearRecords(node: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + contenthash(node: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + dnsRecord(node: PromiseOrValue, name: PromiseOrValue, resource: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + hasDNSRecords(node: PromiseOrValue, name: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + interfaceImplementer(node: PromiseOrValue, interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + isApprovedFor(owner: PromiseOrValue, node: PromiseOrValue, delegate: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + isApprovedForAll(account: PromiseOrValue, operator: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + multicall(data: PromiseOrValue[], overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + multicallWithNodeCheck(nodehash: PromiseOrValue, data: PromiseOrValue[], overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + name(node: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + pubkey(node: PromiseOrValue, overrides?: CallOverrides): Promise<[string, string] & { + x: string; + y: string; + }>; + recordVersions(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber]>; + setABI(node: PromiseOrValue, contentType: PromiseOrValue, data: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + 'setAddr(bytes32,uint256,bytes)'(node: PromiseOrValue, coinType: PromiseOrValue, a: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + 'setAddr(bytes32,address)'(node: PromiseOrValue, a: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setApprovalForAll(operator: PromiseOrValue, approved: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setContenthash(node: PromiseOrValue, hash: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setDNSRecords(node: PromiseOrValue, data: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setInterface(node: PromiseOrValue, interfaceID: PromiseOrValue, implementer: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setName(node: PromiseOrValue, newName: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setPubkey(node: PromiseOrValue, x: PromiseOrValue, y: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setText(node: PromiseOrValue, key: PromiseOrValue, value: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setZonehash(node: PromiseOrValue, hash: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + text(node: PromiseOrValue, key: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + zonehash(node: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + }; + ABI(node: PromiseOrValue, contentTypes: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber, string]>; + 'addr(bytes32)'(node: PromiseOrValue, overrides?: CallOverrides): Promise; + 'addr(bytes32,uint256)'(node: PromiseOrValue, coinType: PromiseOrValue, overrides?: CallOverrides): Promise; + approve(node: PromiseOrValue, delegate: PromiseOrValue, approved: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + clearRecords(node: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + contenthash(node: PromiseOrValue, overrides?: CallOverrides): Promise; + dnsRecord(node: PromiseOrValue, name: PromiseOrValue, resource: PromiseOrValue, overrides?: CallOverrides): Promise; + hasDNSRecords(node: PromiseOrValue, name: PromiseOrValue, overrides?: CallOverrides): Promise; + interfaceImplementer(node: PromiseOrValue, interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + isApprovedFor(owner: PromiseOrValue, node: PromiseOrValue, delegate: PromiseOrValue, overrides?: CallOverrides): Promise; + isApprovedForAll(account: PromiseOrValue, operator: PromiseOrValue, overrides?: CallOverrides): Promise; + multicall(data: PromiseOrValue[], overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + multicallWithNodeCheck(nodehash: PromiseOrValue, data: PromiseOrValue[], overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + name(node: PromiseOrValue, overrides?: CallOverrides): Promise; + pubkey(node: PromiseOrValue, overrides?: CallOverrides): Promise<[string, string] & { + x: string; + y: string; + }>; + recordVersions(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + setABI(node: PromiseOrValue, contentType: PromiseOrValue, data: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + 'setAddr(bytes32,uint256,bytes)'(node: PromiseOrValue, coinType: PromiseOrValue, a: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + 'setAddr(bytes32,address)'(node: PromiseOrValue, a: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setApprovalForAll(operator: PromiseOrValue, approved: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setContenthash(node: PromiseOrValue, hash: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setDNSRecords(node: PromiseOrValue, data: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setInterface(node: PromiseOrValue, interfaceID: PromiseOrValue, implementer: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setName(node: PromiseOrValue, newName: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setPubkey(node: PromiseOrValue, x: PromiseOrValue, y: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setText(node: PromiseOrValue, key: PromiseOrValue, value: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setZonehash(node: PromiseOrValue, hash: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + text(node: PromiseOrValue, key: PromiseOrValue, overrides?: CallOverrides): Promise; + zonehash(node: PromiseOrValue, overrides?: CallOverrides): Promise; + callStatic: { + ABI(node: PromiseOrValue, contentTypes: PromiseOrValue, overrides?: CallOverrides): Promise<[BigNumber, string]>; + 'addr(bytes32)'(node: PromiseOrValue, overrides?: CallOverrides): Promise; + 'addr(bytes32,uint256)'(node: PromiseOrValue, coinType: PromiseOrValue, overrides?: CallOverrides): Promise; + approve(node: PromiseOrValue, delegate: PromiseOrValue, approved: PromiseOrValue, overrides?: CallOverrides): Promise; + clearRecords(node: PromiseOrValue, overrides?: CallOverrides): Promise; + contenthash(node: PromiseOrValue, overrides?: CallOverrides): Promise; + dnsRecord(node: PromiseOrValue, name: PromiseOrValue, resource: PromiseOrValue, overrides?: CallOverrides): Promise; + hasDNSRecords(node: PromiseOrValue, name: PromiseOrValue, overrides?: CallOverrides): Promise; + interfaceImplementer(node: PromiseOrValue, interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + isApprovedFor(owner: PromiseOrValue, node: PromiseOrValue, delegate: PromiseOrValue, overrides?: CallOverrides): Promise; + isApprovedForAll(account: PromiseOrValue, operator: PromiseOrValue, overrides?: CallOverrides): Promise; + multicall(data: PromiseOrValue[], overrides?: CallOverrides): Promise; + multicallWithNodeCheck(nodehash: PromiseOrValue, data: PromiseOrValue[], overrides?: CallOverrides): Promise; + name(node: PromiseOrValue, overrides?: CallOverrides): Promise; + pubkey(node: PromiseOrValue, overrides?: CallOverrides): Promise<[string, string] & { + x: string; + y: string; + }>; + recordVersions(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + setABI(node: PromiseOrValue, contentType: PromiseOrValue, data: PromiseOrValue, overrides?: CallOverrides): Promise; + 'setAddr(bytes32,uint256,bytes)'(node: PromiseOrValue, coinType: PromiseOrValue, a: PromiseOrValue, overrides?: CallOverrides): Promise; + 'setAddr(bytes32,address)'(node: PromiseOrValue, a: PromiseOrValue, overrides?: CallOverrides): Promise; + setApprovalForAll(operator: PromiseOrValue, approved: PromiseOrValue, overrides?: CallOverrides): Promise; + setContenthash(node: PromiseOrValue, hash: PromiseOrValue, overrides?: CallOverrides): Promise; + setDNSRecords(node: PromiseOrValue, data: PromiseOrValue, overrides?: CallOverrides): Promise; + setInterface(node: PromiseOrValue, interfaceID: PromiseOrValue, implementer: PromiseOrValue, overrides?: CallOverrides): Promise; + setName(node: PromiseOrValue, newName: PromiseOrValue, overrides?: CallOverrides): Promise; + setPubkey(node: PromiseOrValue, x: PromiseOrValue, y: PromiseOrValue, overrides?: CallOverrides): Promise; + setText(node: PromiseOrValue, key: PromiseOrValue, value: PromiseOrValue, overrides?: CallOverrides): Promise; + setZonehash(node: PromiseOrValue, hash: PromiseOrValue, overrides?: CallOverrides): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + text(node: PromiseOrValue, key: PromiseOrValue, overrides?: CallOverrides): Promise; + zonehash(node: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + filters: { + 'ABIChanged(bytes32,uint256)'(node?: PromiseOrValue | null, contentType?: PromiseOrValue | null): ABIChangedEventFilter; + ABIChanged(node?: PromiseOrValue | null, contentType?: PromiseOrValue | null): ABIChangedEventFilter; + 'AddrChanged(bytes32,address)'(node?: PromiseOrValue | null, a?: null): AddrChangedEventFilter; + AddrChanged(node?: PromiseOrValue | null, a?: null): AddrChangedEventFilter; + 'AddressChanged(bytes32,uint256,bytes)'(node?: PromiseOrValue | null, coinType?: null, newAddress?: null): AddressChangedEventFilter; + AddressChanged(node?: PromiseOrValue | null, coinType?: null, newAddress?: null): AddressChangedEventFilter; + 'ApprovalForAll(address,address,bool)'(owner?: PromiseOrValue | null, operator?: PromiseOrValue | null, approved?: null): ApprovalForAllEventFilter; + ApprovalForAll(owner?: PromiseOrValue | null, operator?: PromiseOrValue | null, approved?: null): ApprovalForAllEventFilter; + 'Approved(address,bytes32,address,bool)'(owner?: null, node?: PromiseOrValue | null, delegate?: PromiseOrValue | null, approved?: PromiseOrValue | null): ApprovedEventFilter; + Approved(owner?: null, node?: PromiseOrValue | null, delegate?: PromiseOrValue | null, approved?: PromiseOrValue | null): ApprovedEventFilter; + 'ContenthashChanged(bytes32,bytes)'(node?: PromiseOrValue | null, hash?: null): ContenthashChangedEventFilter; + ContenthashChanged(node?: PromiseOrValue | null, hash?: null): ContenthashChangedEventFilter; + 'DNSRecordChanged(bytes32,bytes,uint16,bytes)'(node?: PromiseOrValue | null, name?: null, resource?: null, record?: null): DNSRecordChangedEventFilter; + DNSRecordChanged(node?: PromiseOrValue | null, name?: null, resource?: null, record?: null): DNSRecordChangedEventFilter; + 'DNSRecordDeleted(bytes32,bytes,uint16)'(node?: PromiseOrValue | null, name?: null, resource?: null): DNSRecordDeletedEventFilter; + DNSRecordDeleted(node?: PromiseOrValue | null, name?: null, resource?: null): DNSRecordDeletedEventFilter; + 'DNSZonehashChanged(bytes32,bytes,bytes)'(node?: PromiseOrValue | null, lastzonehash?: null, zonehash?: null): DNSZonehashChangedEventFilter; + DNSZonehashChanged(node?: PromiseOrValue | null, lastzonehash?: null, zonehash?: null): DNSZonehashChangedEventFilter; + 'InterfaceChanged(bytes32,bytes4,address)'(node?: PromiseOrValue | null, interfaceID?: PromiseOrValue | null, implementer?: null): InterfaceChangedEventFilter; + InterfaceChanged(node?: PromiseOrValue | null, interfaceID?: PromiseOrValue | null, implementer?: null): InterfaceChangedEventFilter; + 'NameChanged(bytes32,string)'(node?: PromiseOrValue | null, name?: null): NameChangedEventFilter; + NameChanged(node?: PromiseOrValue | null, name?: null): NameChangedEventFilter; + 'PubkeyChanged(bytes32,bytes32,bytes32)'(node?: PromiseOrValue | null, x?: null, y?: null): PubkeyChangedEventFilter; + PubkeyChanged(node?: PromiseOrValue | null, x?: null, y?: null): PubkeyChangedEventFilter; + 'TextChanged(bytes32,string,string,string)'(node?: PromiseOrValue | null, indexedKey?: PromiseOrValue | null, key?: null, value?: null): TextChangedEventFilter; + TextChanged(node?: PromiseOrValue | null, indexedKey?: PromiseOrValue | null, key?: null, value?: null): TextChangedEventFilter; + 'VersionChanged(bytes32,uint64)'(node?: PromiseOrValue | null, newVersion?: null): VersionChangedEventFilter; + VersionChanged(node?: PromiseOrValue | null, newVersion?: null): VersionChangedEventFilter; + }; + estimateGas: { + ABI(node: PromiseOrValue, contentTypes: PromiseOrValue, overrides?: CallOverrides): Promise; + 'addr(bytes32)'(node: PromiseOrValue, overrides?: CallOverrides): Promise; + 'addr(bytes32,uint256)'(node: PromiseOrValue, coinType: PromiseOrValue, overrides?: CallOverrides): Promise; + approve(node: PromiseOrValue, delegate: PromiseOrValue, approved: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + clearRecords(node: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + contenthash(node: PromiseOrValue, overrides?: CallOverrides): Promise; + dnsRecord(node: PromiseOrValue, name: PromiseOrValue, resource: PromiseOrValue, overrides?: CallOverrides): Promise; + hasDNSRecords(node: PromiseOrValue, name: PromiseOrValue, overrides?: CallOverrides): Promise; + interfaceImplementer(node: PromiseOrValue, interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + isApprovedFor(owner: PromiseOrValue, node: PromiseOrValue, delegate: PromiseOrValue, overrides?: CallOverrides): Promise; + isApprovedForAll(account: PromiseOrValue, operator: PromiseOrValue, overrides?: CallOverrides): Promise; + multicall(data: PromiseOrValue[], overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + multicallWithNodeCheck(nodehash: PromiseOrValue, data: PromiseOrValue[], overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + name(node: PromiseOrValue, overrides?: CallOverrides): Promise; + pubkey(node: PromiseOrValue, overrides?: CallOverrides): Promise; + recordVersions(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + setABI(node: PromiseOrValue, contentType: PromiseOrValue, data: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + 'setAddr(bytes32,uint256,bytes)'(node: PromiseOrValue, coinType: PromiseOrValue, a: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + 'setAddr(bytes32,address)'(node: PromiseOrValue, a: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setApprovalForAll(operator: PromiseOrValue, approved: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setContenthash(node: PromiseOrValue, hash: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setDNSRecords(node: PromiseOrValue, data: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setInterface(node: PromiseOrValue, interfaceID: PromiseOrValue, implementer: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setName(node: PromiseOrValue, newName: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setPubkey(node: PromiseOrValue, x: PromiseOrValue, y: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setText(node: PromiseOrValue, key: PromiseOrValue, value: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setZonehash(node: PromiseOrValue, hash: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + text(node: PromiseOrValue, key: PromiseOrValue, overrides?: CallOverrides): Promise; + zonehash(node: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + populateTransaction: { + ABI(node: PromiseOrValue, contentTypes: PromiseOrValue, overrides?: CallOverrides): Promise; + 'addr(bytes32)'(node: PromiseOrValue, overrides?: CallOverrides): Promise; + 'addr(bytes32,uint256)'(node: PromiseOrValue, coinType: PromiseOrValue, overrides?: CallOverrides): Promise; + approve(node: PromiseOrValue, delegate: PromiseOrValue, approved: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + clearRecords(node: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + contenthash(node: PromiseOrValue, overrides?: CallOverrides): Promise; + dnsRecord(node: PromiseOrValue, name: PromiseOrValue, resource: PromiseOrValue, overrides?: CallOverrides): Promise; + hasDNSRecords(node: PromiseOrValue, name: PromiseOrValue, overrides?: CallOverrides): Promise; + interfaceImplementer(node: PromiseOrValue, interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + isApprovedFor(owner: PromiseOrValue, node: PromiseOrValue, delegate: PromiseOrValue, overrides?: CallOverrides): Promise; + isApprovedForAll(account: PromiseOrValue, operator: PromiseOrValue, overrides?: CallOverrides): Promise; + multicall(data: PromiseOrValue[], overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + multicallWithNodeCheck(nodehash: PromiseOrValue, data: PromiseOrValue[], overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + name(node: PromiseOrValue, overrides?: CallOverrides): Promise; + pubkey(node: PromiseOrValue, overrides?: CallOverrides): Promise; + recordVersions(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + setABI(node: PromiseOrValue, contentType: PromiseOrValue, data: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + 'setAddr(bytes32,uint256,bytes)'(node: PromiseOrValue, coinType: PromiseOrValue, a: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + 'setAddr(bytes32,address)'(node: PromiseOrValue, a: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setApprovalForAll(operator: PromiseOrValue, approved: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setContenthash(node: PromiseOrValue, hash: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setDNSRecords(node: PromiseOrValue, data: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setInterface(node: PromiseOrValue, interfaceID: PromiseOrValue, implementer: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setName(node: PromiseOrValue, newName: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setPubkey(node: PromiseOrValue, x: PromiseOrValue, y: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setText(node: PromiseOrValue, key: PromiseOrValue, value: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setZonehash(node: PromiseOrValue, hash: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + text(node: PromiseOrValue, key: PromiseOrValue, overrides?: CallOverrides): Promise; + zonehash(node: PromiseOrValue, overrides?: CallOverrides): Promise; + }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/RSASHA1Algorithm.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/RSASHA1Algorithm.d.ts new file mode 100644 index 000000000..62683d84c --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/RSASHA1Algorithm.d.ts @@ -0,0 +1,50 @@ +import type { FunctionFragment, Result } from '@ethersproject/abi'; +import { Interface } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/abstract-provider'; +import type { Signer } from '@ethersproject/abstract-signer'; +import type { BigNumber } from '@ethersproject/bignumber'; +import type { BytesLike } from '@ethersproject/bytes'; +import type { BaseContract, CallOverrides, PopulatedTransaction } from '@ethersproject/contracts'; +import type { OnEvent, PromiseOrValue, TypedEvent, TypedEventFilter, TypedListener } from './common'; +export interface RSASHA1AlgorithmInterface extends Interface { + functions: { + 'verify(bytes,bytes,bytes)': FunctionFragment; + }; + getFunction(nameOrSignatureOrTopic: 'verify'): FunctionFragment; + encodeFunctionData(functionFragment: 'verify', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + decodeFunctionResult(functionFragment: 'verify', data: BytesLike): Result; + events: {}; +} +export interface RSASHA1Algorithm extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + interface: RSASHA1AlgorithmInterface; + queryFilter(event: TypedEventFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>; + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + functions: { + verify(key: PromiseOrValue, data: PromiseOrValue, sig: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + }; + verify(key: PromiseOrValue, data: PromiseOrValue, sig: PromiseOrValue, overrides?: CallOverrides): Promise; + callStatic: { + verify(key: PromiseOrValue, data: PromiseOrValue, sig: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + filters: {}; + estimateGas: { + verify(key: PromiseOrValue, data: PromiseOrValue, sig: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + populateTransaction: { + verify(key: PromiseOrValue, data: PromiseOrValue, sig: PromiseOrValue, overrides?: CallOverrides): Promise; + }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/RSASHA256Algorithm.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/RSASHA256Algorithm.d.ts new file mode 100644 index 000000000..0d802500f --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/RSASHA256Algorithm.d.ts @@ -0,0 +1,50 @@ +import type { FunctionFragment, Result } from '@ethersproject/abi'; +import { Interface } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/abstract-provider'; +import type { Signer } from '@ethersproject/abstract-signer'; +import type { BigNumber } from '@ethersproject/bignumber'; +import type { BytesLike } from '@ethersproject/bytes'; +import type { BaseContract, CallOverrides, PopulatedTransaction } from '@ethersproject/contracts'; +import type { OnEvent, PromiseOrValue, TypedEvent, TypedEventFilter, TypedListener } from './common'; +export interface RSASHA256AlgorithmInterface extends Interface { + functions: { + 'verify(bytes,bytes,bytes)': FunctionFragment; + }; + getFunction(nameOrSignatureOrTopic: 'verify'): FunctionFragment; + encodeFunctionData(functionFragment: 'verify', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + decodeFunctionResult(functionFragment: 'verify', data: BytesLike): Result; + events: {}; +} +export interface RSASHA256Algorithm extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + interface: RSASHA256AlgorithmInterface; + queryFilter(event: TypedEventFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>; + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + functions: { + verify(key: PromiseOrValue, data: PromiseOrValue, sig: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + }; + verify(key: PromiseOrValue, data: PromiseOrValue, sig: PromiseOrValue, overrides?: CallOverrides): Promise; + callStatic: { + verify(key: PromiseOrValue, data: PromiseOrValue, sig: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + filters: {}; + estimateGas: { + verify(key: PromiseOrValue, data: PromiseOrValue, sig: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + populateTransaction: { + verify(key: PromiseOrValue, data: PromiseOrValue, sig: PromiseOrValue, overrides?: CallOverrides): Promise; + }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/ReverseRegistrar.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/ReverseRegistrar.d.ts new file mode 100644 index 000000000..31b8e0b9b --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/ReverseRegistrar.d.ts @@ -0,0 +1,283 @@ +import type { EventFragment, FunctionFragment, Result } from '@ethersproject/abi'; +import { Interface } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/abstract-provider'; +import type { Signer } from '@ethersproject/abstract-signer'; +import type { BigNumber } from '@ethersproject/bignumber'; +import type { BytesLike } from '@ethersproject/bytes'; +import type { BaseContract, CallOverrides, ContractTransaction, Overrides, PopulatedTransaction } from '@ethersproject/contracts'; +import type { OnEvent, PromiseOrValue, TypedEvent, TypedEventFilter, TypedListener } from './common'; +export interface ReverseRegistrarInterface extends Interface { + functions: { + 'claim(address)': FunctionFragment; + 'claimForAddr(address,address,address)': FunctionFragment; + 'claimWithResolver(address,address)': FunctionFragment; + 'controllers(address)': FunctionFragment; + 'defaultResolver()': FunctionFragment; + 'ens()': FunctionFragment; + 'node(address)': FunctionFragment; + 'owner()': FunctionFragment; + 'renounceOwnership()': FunctionFragment; + 'setController(address,bool)': FunctionFragment; + 'setDefaultResolver(address)': FunctionFragment; + 'setName(string)': FunctionFragment; + 'setNameForAddr(address,address,address,string)': FunctionFragment; + 'transferOwnership(address)': FunctionFragment; + }; + getFunction(nameOrSignatureOrTopic: 'claim' | 'claimForAddr' | 'claimWithResolver' | 'controllers' | 'defaultResolver' | 'ens' | 'node' | 'owner' | 'renounceOwnership' | 'setController' | 'setDefaultResolver' | 'setName' | 'setNameForAddr' | 'transferOwnership'): FunctionFragment; + encodeFunctionData(functionFragment: 'claim', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'claimForAddr', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'claimWithResolver', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'controllers', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'defaultResolver', values?: undefined): string; + encodeFunctionData(functionFragment: 'ens', values?: undefined): string; + encodeFunctionData(functionFragment: 'node', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'owner', values?: undefined): string; + encodeFunctionData(functionFragment: 'renounceOwnership', values?: undefined): string; + encodeFunctionData(functionFragment: 'setController', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setDefaultResolver', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setName', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setNameForAddr', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'transferOwnership', values: [PromiseOrValue]): string; + decodeFunctionResult(functionFragment: 'claim', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'claimForAddr', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'claimWithResolver', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'controllers', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'defaultResolver', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'ens', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'node', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'renounceOwnership', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setController', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setDefaultResolver', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setName', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setNameForAddr', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferOwnership', data: BytesLike): Result; + events: { + 'ControllerChanged(address,bool)': EventFragment; + 'DefaultResolverChanged(address)': EventFragment; + 'OwnershipTransferred(address,address)': EventFragment; + 'ReverseClaimed(address,bytes32)': EventFragment; + }; + getEvent(nameOrSignatureOrTopic: 'ControllerChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'DefaultResolverChanged'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'OwnershipTransferred'): EventFragment; + getEvent(nameOrSignatureOrTopic: 'ReverseClaimed'): EventFragment; +} +export interface ControllerChangedEventObject { + controller: string; + enabled: boolean; +} +export declare type ControllerChangedEvent = TypedEvent<[ + string, + boolean +], ControllerChangedEventObject>; +export declare type ControllerChangedEventFilter = TypedEventFilter; +export interface DefaultResolverChangedEventObject { + resolver: string; +} +export declare type DefaultResolverChangedEvent = TypedEvent<[ + string +], DefaultResolverChangedEventObject>; +export declare type DefaultResolverChangedEventFilter = TypedEventFilter; +export interface OwnershipTransferredEventObject { + previousOwner: string; + newOwner: string; +} +export declare type OwnershipTransferredEvent = TypedEvent<[ + string, + string +], OwnershipTransferredEventObject>; +export declare type OwnershipTransferredEventFilter = TypedEventFilter; +export interface ReverseClaimedEventObject { + addr: string; + node: string; +} +export declare type ReverseClaimedEvent = TypedEvent<[ + string, + string +], ReverseClaimedEventObject>; +export declare type ReverseClaimedEventFilter = TypedEventFilter; +export interface ReverseRegistrar extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + interface: ReverseRegistrarInterface; + queryFilter(event: TypedEventFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>; + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + functions: { + claim(owner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + claimForAddr(addr: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + claimWithResolver(owner: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + controllers(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + defaultResolver(overrides?: CallOverrides): Promise<[string]>; + ens(overrides?: CallOverrides): Promise<[string]>; + node(addr: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + owner(overrides?: CallOverrides): Promise<[string]>; + renounceOwnership(overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setController(controller: PromiseOrValue, enabled: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setDefaultResolver(resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setName(name: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setNameForAddr(addr: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, name: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + }; + claim(owner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + claimForAddr(addr: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + claimWithResolver(owner: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + controllers(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + defaultResolver(overrides?: CallOverrides): Promise; + ens(overrides?: CallOverrides): Promise; + node(addr: PromiseOrValue, overrides?: CallOverrides): Promise; + owner(overrides?: CallOverrides): Promise; + renounceOwnership(overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setController(controller: PromiseOrValue, enabled: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setDefaultResolver(resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setName(name: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setNameForAddr(addr: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, name: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + callStatic: { + claim(owner: PromiseOrValue, overrides?: CallOverrides): Promise; + claimForAddr(addr: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, overrides?: CallOverrides): Promise; + claimWithResolver(owner: PromiseOrValue, resolver: PromiseOrValue, overrides?: CallOverrides): Promise; + controllers(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + defaultResolver(overrides?: CallOverrides): Promise; + ens(overrides?: CallOverrides): Promise; + node(addr: PromiseOrValue, overrides?: CallOverrides): Promise; + owner(overrides?: CallOverrides): Promise; + renounceOwnership(overrides?: CallOverrides): Promise; + setController(controller: PromiseOrValue, enabled: PromiseOrValue, overrides?: CallOverrides): Promise; + setDefaultResolver(resolver: PromiseOrValue, overrides?: CallOverrides): Promise; + setName(name: PromiseOrValue, overrides?: CallOverrides): Promise; + setNameForAddr(addr: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, name: PromiseOrValue, overrides?: CallOverrides): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + filters: { + 'ControllerChanged(address,bool)'(controller?: PromiseOrValue | null, enabled?: null): ControllerChangedEventFilter; + ControllerChanged(controller?: PromiseOrValue | null, enabled?: null): ControllerChangedEventFilter; + 'DefaultResolverChanged(address)'(resolver?: PromiseOrValue | null): DefaultResolverChangedEventFilter; + DefaultResolverChanged(resolver?: PromiseOrValue | null): DefaultResolverChangedEventFilter; + 'OwnershipTransferred(address,address)'(previousOwner?: PromiseOrValue | null, newOwner?: PromiseOrValue | null): OwnershipTransferredEventFilter; + OwnershipTransferred(previousOwner?: PromiseOrValue | null, newOwner?: PromiseOrValue | null): OwnershipTransferredEventFilter; + 'ReverseClaimed(address,bytes32)'(addr?: PromiseOrValue | null, node?: PromiseOrValue | null): ReverseClaimedEventFilter; + ReverseClaimed(addr?: PromiseOrValue | null, node?: PromiseOrValue | null): ReverseClaimedEventFilter; + }; + estimateGas: { + claim(owner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + claimForAddr(addr: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + claimWithResolver(owner: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + controllers(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + defaultResolver(overrides?: CallOverrides): Promise; + ens(overrides?: CallOverrides): Promise; + node(addr: PromiseOrValue, overrides?: CallOverrides): Promise; + owner(overrides?: CallOverrides): Promise; + renounceOwnership(overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setController(controller: PromiseOrValue, enabled: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setDefaultResolver(resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setName(name: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setNameForAddr(addr: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, name: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + }; + populateTransaction: { + claim(owner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + claimForAddr(addr: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + claimWithResolver(owner: PromiseOrValue, resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + controllers(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + defaultResolver(overrides?: CallOverrides): Promise; + ens(overrides?: CallOverrides): Promise; + node(addr: PromiseOrValue, overrides?: CallOverrides): Promise; + owner(overrides?: CallOverrides): Promise; + renounceOwnership(overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setController(controller: PromiseOrValue, enabled: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setDefaultResolver(resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setName(name: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setNameForAddr(addr: PromiseOrValue, owner: PromiseOrValue, resolver: PromiseOrValue, name: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/Root.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/Root.d.ts new file mode 100644 index 000000000..31dcc9e2c --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/Root.d.ts @@ -0,0 +1,177 @@ +import type { EventFragment, FunctionFragment, Result } from '@ethersproject/abi'; +import { Interface } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/abstract-provider'; +import type { Signer } from '@ethersproject/abstract-signer'; +import type { BigNumber } from '@ethersproject/bignumber'; +import type { BytesLike } from '@ethersproject/bytes'; +import type { BaseContract, CallOverrides, ContractTransaction, Overrides, PopulatedTransaction } from '@ethersproject/contracts'; +import type { OnEvent, PromiseOrValue, TypedEvent, TypedEventFilter, TypedListener } from './common'; +export interface RootInterface extends Interface { + functions: { + 'controllers(address)': FunctionFragment; + 'ens()': FunctionFragment; + 'isOwner(address)': FunctionFragment; + 'lock(bytes32)': FunctionFragment; + 'locked(bytes32)': FunctionFragment; + 'owner()': FunctionFragment; + 'setController(address,bool)': FunctionFragment; + 'setResolver(address)': FunctionFragment; + 'setSubnodeOwner(bytes32,address)': FunctionFragment; + 'supportsInterface(bytes4)': FunctionFragment; + 'transferOwnership(address)': FunctionFragment; + }; + getFunction(nameOrSignatureOrTopic: 'controllers' | 'ens' | 'isOwner' | 'lock' | 'locked' | 'owner' | 'setController' | 'setResolver' | 'setSubnodeOwner' | 'supportsInterface' | 'transferOwnership'): FunctionFragment; + encodeFunctionData(functionFragment: 'controllers', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'ens', values?: undefined): string; + encodeFunctionData(functionFragment: 'isOwner', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'lock', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'locked', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'owner', values?: undefined): string; + encodeFunctionData(functionFragment: 'setController', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setResolver', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setSubnodeOwner', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'supportsInterface', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'transferOwnership', values: [PromiseOrValue]): string; + decodeFunctionResult(functionFragment: 'controllers', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'ens', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'isOwner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'lock', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'locked', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setController', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setResolver', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setSubnodeOwner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'supportsInterface', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferOwnership', data: BytesLike): Result; + events: { + 'TLDLocked(bytes32)': EventFragment; + }; + getEvent(nameOrSignatureOrTopic: 'TLDLocked'): EventFragment; +} +export interface TLDLockedEventObject { + label: string; +} +export declare type TLDLockedEvent = TypedEvent<[string], TLDLockedEventObject>; +export declare type TLDLockedEventFilter = TypedEventFilter; +export interface Root extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + interface: RootInterface; + queryFilter(event: TypedEventFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>; + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + functions: { + controllers(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + ens(overrides?: CallOverrides): Promise<[string]>; + isOwner(addr: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + lock(label: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + locked(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + owner(overrides?: CallOverrides): Promise<[string]>; + setController(controller: PromiseOrValue, enabled: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setResolver(resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setSubnodeOwner(label: PromiseOrValue, owner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + transferOwnership(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + }; + controllers(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + ens(overrides?: CallOverrides): Promise; + isOwner(addr: PromiseOrValue, overrides?: CallOverrides): Promise; + lock(label: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + locked(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + owner(overrides?: CallOverrides): Promise; + setController(controller: PromiseOrValue, enabled: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setResolver(resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setSubnodeOwner(label: PromiseOrValue, owner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + callStatic: { + controllers(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + ens(overrides?: CallOverrides): Promise; + isOwner(addr: PromiseOrValue, overrides?: CallOverrides): Promise; + lock(label: PromiseOrValue, overrides?: CallOverrides): Promise; + locked(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + owner(overrides?: CallOverrides): Promise; + setController(controller: PromiseOrValue, enabled: PromiseOrValue, overrides?: CallOverrides): Promise; + setResolver(resolver: PromiseOrValue, overrides?: CallOverrides): Promise; + setSubnodeOwner(label: PromiseOrValue, owner: PromiseOrValue, overrides?: CallOverrides): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + filters: { + 'TLDLocked(bytes32)'(label?: PromiseOrValue | null): TLDLockedEventFilter; + TLDLocked(label?: PromiseOrValue | null): TLDLockedEventFilter; + }; + estimateGas: { + controllers(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + ens(overrides?: CallOverrides): Promise; + isOwner(addr: PromiseOrValue, overrides?: CallOverrides): Promise; + lock(label: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + locked(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + owner(overrides?: CallOverrides): Promise; + setController(controller: PromiseOrValue, enabled: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setResolver(resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setSubnodeOwner(label: PromiseOrValue, owner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + }; + populateTransaction: { + controllers(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + ens(overrides?: CallOverrides): Promise; + isOwner(addr: PromiseOrValue, overrides?: CallOverrides): Promise; + lock(label: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + locked(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + owner(overrides?: CallOverrides): Promise; + setController(controller: PromiseOrValue, enabled: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setResolver(resolver: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + setSubnodeOwner(label: PromiseOrValue, owner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + supportsInterface(interfaceID: PromiseOrValue, overrides?: CallOverrides): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/SHA1Digest.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/SHA1Digest.d.ts new file mode 100644 index 000000000..56b0da26f --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/SHA1Digest.d.ts @@ -0,0 +1,71 @@ +import type { FunctionFragment, Result } from '@ethersproject/abi'; +import { Interface } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/abstract-provider'; +import type { Signer } from '@ethersproject/abstract-signer'; +import type { BigNumber } from '@ethersproject/bignumber'; +import type { BytesLike } from '@ethersproject/bytes'; +import type { BaseContract, CallOverrides, PopulatedTransaction } from '@ethersproject/contracts'; +import type { OnEvent, PromiseOrValue, TypedEvent, TypedEventFilter, TypedListener } from './common'; +export interface SHA1DigestInterface extends Interface { + functions: { + 'verify(bytes,bytes)': FunctionFragment; + }; + getFunction(nameOrSignatureOrTopic: 'verify'): FunctionFragment; + encodeFunctionData(functionFragment: 'verify', values: [PromiseOrValue, PromiseOrValue]): string; + decodeFunctionResult(functionFragment: 'verify', data: BytesLike): Result; + events: {}; +} +export interface SHA1Digest extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + interface: SHA1DigestInterface; + queryFilter(event: TypedEventFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>; + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + functions: { + /** + * Verifies a cryptographic hash. + * @param data The data to hash. + * @param hash The hash to compare to. + */ + verify(data: PromiseOrValue, hash: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + }; + /** + * Verifies a cryptographic hash. + * @param data The data to hash. + * @param hash The hash to compare to. + */ + verify(data: PromiseOrValue, hash: PromiseOrValue, overrides?: CallOverrides): Promise; + callStatic: { + /** + * Verifies a cryptographic hash. + * @param data The data to hash. + * @param hash The hash to compare to. + */ + verify(data: PromiseOrValue, hash: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + filters: {}; + estimateGas: { + /** + * Verifies a cryptographic hash. + * @param data The data to hash. + * @param hash The hash to compare to. + */ + verify(data: PromiseOrValue, hash: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + populateTransaction: { + /** + * Verifies a cryptographic hash. + * @param data The data to hash. + * @param hash The hash to compare to. + */ + verify(data: PromiseOrValue, hash: PromiseOrValue, overrides?: CallOverrides): Promise; + }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/SHA1NSEC3Digest.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/SHA1NSEC3Digest.d.ts new file mode 100644 index 000000000..a69a14b8d --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/SHA1NSEC3Digest.d.ts @@ -0,0 +1,80 @@ +import type { FunctionFragment, Result } from '@ethersproject/abi'; +import { Interface } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/abstract-provider'; +import type { Signer } from '@ethersproject/abstract-signer'; +import type { BigNumber, BigNumberish } from '@ethersproject/bignumber'; +import type { BytesLike } from '@ethersproject/bytes'; +import type { BaseContract, CallOverrides, PopulatedTransaction } from '@ethersproject/contracts'; +import type { OnEvent, PromiseOrValue, TypedEvent, TypedEventFilter, TypedListener } from './common'; +export interface SHA1NSEC3DigestInterface extends Interface { + functions: { + 'hash(bytes,bytes,uint256)': FunctionFragment; + }; + getFunction(nameOrSignatureOrTopic: 'hash'): FunctionFragment; + encodeFunctionData(functionFragment: 'hash', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue + ]): string; + decodeFunctionResult(functionFragment: 'hash', data: BytesLike): Result; + events: {}; +} +export interface SHA1NSEC3Digest extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + interface: SHA1NSEC3DigestInterface; + queryFilter(event: TypedEventFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>; + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + functions: { + /** + * Performs an NSEC3 iterated hash. + * @param data The data to hash. + * @param iterations The number of iterations to perform. + * @param salt The salt value to use on each iteration. + */ + hash(salt: PromiseOrValue, data: PromiseOrValue, iterations: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + }; + /** + * Performs an NSEC3 iterated hash. + * @param data The data to hash. + * @param iterations The number of iterations to perform. + * @param salt The salt value to use on each iteration. + */ + hash(salt: PromiseOrValue, data: PromiseOrValue, iterations: PromiseOrValue, overrides?: CallOverrides): Promise; + callStatic: { + /** + * Performs an NSEC3 iterated hash. + * @param data The data to hash. + * @param iterations The number of iterations to perform. + * @param salt The salt value to use on each iteration. + */ + hash(salt: PromiseOrValue, data: PromiseOrValue, iterations: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + filters: {}; + estimateGas: { + /** + * Performs an NSEC3 iterated hash. + * @param data The data to hash. + * @param iterations The number of iterations to perform. + * @param salt The salt value to use on each iteration. + */ + hash(salt: PromiseOrValue, data: PromiseOrValue, iterations: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + populateTransaction: { + /** + * Performs an NSEC3 iterated hash. + * @param data The data to hash. + * @param iterations The number of iterations to perform. + * @param salt The salt value to use on each iteration. + */ + hash(salt: PromiseOrValue, data: PromiseOrValue, iterations: PromiseOrValue, overrides?: CallOverrides): Promise; + }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/SHA256Digest.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/SHA256Digest.d.ts new file mode 100644 index 000000000..73eadf3e2 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/SHA256Digest.d.ts @@ -0,0 +1,71 @@ +import type { FunctionFragment, Result } from '@ethersproject/abi'; +import { Interface } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/abstract-provider'; +import type { Signer } from '@ethersproject/abstract-signer'; +import type { BigNumber } from '@ethersproject/bignumber'; +import type { BytesLike } from '@ethersproject/bytes'; +import type { BaseContract, CallOverrides, PopulatedTransaction } from '@ethersproject/contracts'; +import type { OnEvent, PromiseOrValue, TypedEvent, TypedEventFilter, TypedListener } from './common'; +export interface SHA256DigestInterface extends Interface { + functions: { + 'verify(bytes,bytes)': FunctionFragment; + }; + getFunction(nameOrSignatureOrTopic: 'verify'): FunctionFragment; + encodeFunctionData(functionFragment: 'verify', values: [PromiseOrValue, PromiseOrValue]): string; + decodeFunctionResult(functionFragment: 'verify', data: BytesLike): Result; + events: {}; +} +export interface SHA256Digest extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + interface: SHA256DigestInterface; + queryFilter(event: TypedEventFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>; + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + functions: { + /** + * Verifies a cryptographic hash. + * @param data The data to hash. + * @param hash The hash to compare to. + */ + verify(data: PromiseOrValue, hash: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + }; + /** + * Verifies a cryptographic hash. + * @param data The data to hash. + * @param hash The hash to compare to. + */ + verify(data: PromiseOrValue, hash: PromiseOrValue, overrides?: CallOverrides): Promise; + callStatic: { + /** + * Verifies a cryptographic hash. + * @param data The data to hash. + * @param hash The hash to compare to. + */ + verify(data: PromiseOrValue, hash: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + filters: {}; + estimateGas: { + /** + * Verifies a cryptographic hash. + * @param data The data to hash. + * @param hash The hash to compare to. + */ + verify(data: PromiseOrValue, hash: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + populateTransaction: { + /** + * Verifies a cryptographic hash. + * @param data The data to hash. + * @param hash The hash to compare to. + */ + verify(data: PromiseOrValue, hash: PromiseOrValue, overrides?: CallOverrides): Promise; + }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/StaticMetadataService.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/StaticMetadataService.d.ts new file mode 100644 index 000000000..580db4502 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/StaticMetadataService.d.ts @@ -0,0 +1,46 @@ +import type { FunctionFragment, Result } from '@ethersproject/abi'; +import { Interface } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/abstract-provider'; +import type { Signer } from '@ethersproject/abstract-signer'; +import type { BigNumber, BigNumberish } from '@ethersproject/bignumber'; +import type { BytesLike } from '@ethersproject/bytes'; +import type { BaseContract, CallOverrides, PopulatedTransaction } from '@ethersproject/contracts'; +import type { OnEvent, PromiseOrValue, TypedEvent, TypedEventFilter, TypedListener } from './common'; +export interface StaticMetadataServiceInterface extends Interface { + functions: { + 'uri(uint256)': FunctionFragment; + }; + getFunction(nameOrSignatureOrTopic: 'uri'): FunctionFragment; + encodeFunctionData(functionFragment: 'uri', values: [PromiseOrValue]): string; + decodeFunctionResult(functionFragment: 'uri', data: BytesLike): Result; + events: {}; +} +export interface StaticMetadataService extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + interface: StaticMetadataServiceInterface; + queryFilter(event: TypedEventFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>; + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + functions: { + uri(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + }; + uri(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + callStatic: { + uri(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + filters: {}; + estimateGas: { + uri(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + populateTransaction: { + uri(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/TLDPublicSuffixList.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/TLDPublicSuffixList.d.ts new file mode 100644 index 000000000..15a9680e8 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/TLDPublicSuffixList.d.ts @@ -0,0 +1,46 @@ +import type { FunctionFragment, Result } from '@ethersproject/abi'; +import { Interface } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/abstract-provider'; +import type { Signer } from '@ethersproject/abstract-signer'; +import type { BigNumber } from '@ethersproject/bignumber'; +import type { BytesLike } from '@ethersproject/bytes'; +import type { BaseContract, CallOverrides, PopulatedTransaction } from '@ethersproject/contracts'; +import type { OnEvent, PromiseOrValue, TypedEvent, TypedEventFilter, TypedListener } from './common'; +export interface TLDPublicSuffixListInterface extends Interface { + functions: { + 'isPublicSuffix(bytes)': FunctionFragment; + }; + getFunction(nameOrSignatureOrTopic: 'isPublicSuffix'): FunctionFragment; + encodeFunctionData(functionFragment: 'isPublicSuffix', values: [PromiseOrValue]): string; + decodeFunctionResult(functionFragment: 'isPublicSuffix', data: BytesLike): Result; + events: {}; +} +export interface TLDPublicSuffixList extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + interface: TLDPublicSuffixListInterface; + queryFilter(event: TypedEventFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>; + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + functions: { + isPublicSuffix(name: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + }; + isPublicSuffix(name: PromiseOrValue, overrides?: CallOverrides): Promise; + callStatic: { + isPublicSuffix(name: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + filters: {}; + estimateGas: { + isPublicSuffix(name: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + populateTransaction: { + isPublicSuffix(name: PromiseOrValue, overrides?: CallOverrides): Promise; + }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/UniversalResolver.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/UniversalResolver.d.ts new file mode 100644 index 000000000..9f3800798 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/UniversalResolver.d.ts @@ -0,0 +1,235 @@ +import type { EventFragment, FunctionFragment, Result } from '@ethersproject/abi'; +import { Interface } from '@ethersproject/abi'; +import type { Listener, Provider } from '@ethersproject/abstract-provider'; +import type { Signer } from '@ethersproject/abstract-signer'; +import type { BigNumber, BigNumberish } from '@ethersproject/bignumber'; +import type { BytesLike } from '@ethersproject/bytes'; +import type { BaseContract, CallOverrides, ContractTransaction, Overrides, PopulatedTransaction } from '@ethersproject/contracts'; +import type { OnEvent, PromiseOrValue, TypedEvent, TypedEventFilter, TypedListener } from './common'; +export interface UniversalResolverInterface extends Interface { + functions: { + '_resolveSingle(bytes,bytes,string[],bytes4,bytes)': FunctionFragment; + 'batchGatewayURLs(uint256)': FunctionFragment; + 'findResolver(bytes)': FunctionFragment; + 'owner()': FunctionFragment; + 'registry()': FunctionFragment; + 'renounceOwnership()': FunctionFragment; + 'resolve(bytes,bytes,string[])': FunctionFragment; + 'resolve(bytes,bytes[])': FunctionFragment; + 'resolve(bytes,bytes[],string[])': FunctionFragment; + 'resolve(bytes,bytes)': FunctionFragment; + 'resolveCallback(bytes,bytes)': FunctionFragment; + 'resolveSingleCallback(bytes,bytes)': FunctionFragment; + 'reverse(bytes,string[])': FunctionFragment; + 'reverse(bytes)': FunctionFragment; + 'reverseCallback(bytes,bytes)': FunctionFragment; + 'setGatewayURLs(string[])': FunctionFragment; + 'supportsInterface(bytes4)': FunctionFragment; + 'transferOwnership(address)': FunctionFragment; + }; + getFunction(nameOrSignatureOrTopic: '_resolveSingle' | 'batchGatewayURLs' | 'findResolver' | 'owner' | 'registry' | 'renounceOwnership' | 'resolve(bytes,bytes,string[])' | 'resolve(bytes,bytes[])' | 'resolve(bytes,bytes[],string[])' | 'resolve(bytes,bytes)' | 'resolveCallback' | 'resolveSingleCallback' | 'reverse(bytes,string[])' | 'reverse(bytes)' | 'reverseCallback' | 'setGatewayURLs' | 'supportsInterface' | 'transferOwnership'): FunctionFragment; + encodeFunctionData(functionFragment: '_resolveSingle', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue[], + PromiseOrValue, + PromiseOrValue + ]): string; + encodeFunctionData(functionFragment: 'batchGatewayURLs', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'findResolver', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'owner', values?: undefined): string; + encodeFunctionData(functionFragment: 'registry', values?: undefined): string; + encodeFunctionData(functionFragment: 'renounceOwnership', values?: undefined): string; + encodeFunctionData(functionFragment: 'resolve(bytes,bytes,string[])', values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue[] + ]): string; + encodeFunctionData(functionFragment: 'resolve(bytes,bytes[])', values: [PromiseOrValue, PromiseOrValue[]]): string; + encodeFunctionData(functionFragment: 'resolve(bytes,bytes[],string[])', values: [ + PromiseOrValue, + PromiseOrValue[], + PromiseOrValue[] + ]): string; + encodeFunctionData(functionFragment: 'resolve(bytes,bytes)', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'resolveCallback', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'resolveSingleCallback', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'reverse(bytes,string[])', values: [PromiseOrValue, PromiseOrValue[]]): string; + encodeFunctionData(functionFragment: 'reverse(bytes)', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'reverseCallback', values: [PromiseOrValue, PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'setGatewayURLs', values: [PromiseOrValue[]]): string; + encodeFunctionData(functionFragment: 'supportsInterface', values: [PromiseOrValue]): string; + encodeFunctionData(functionFragment: 'transferOwnership', values: [PromiseOrValue]): string; + decodeFunctionResult(functionFragment: '_resolveSingle', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'batchGatewayURLs', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'findResolver', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'registry', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'renounceOwnership', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'resolve(bytes,bytes,string[])', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'resolve(bytes,bytes[])', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'resolve(bytes,bytes[],string[])', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'resolve(bytes,bytes)', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'resolveCallback', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'resolveSingleCallback', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'reverse(bytes,string[])', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'reverse(bytes)', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'reverseCallback', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'setGatewayURLs', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'supportsInterface', data: BytesLike): Result; + decodeFunctionResult(functionFragment: 'transferOwnership', data: BytesLike): Result; + events: { + 'OwnershipTransferred(address,address)': EventFragment; + }; + getEvent(nameOrSignatureOrTopic: 'OwnershipTransferred'): EventFragment; +} +export interface OwnershipTransferredEventObject { + previousOwner: string; + newOwner: string; +} +export declare type OwnershipTransferredEvent = TypedEvent<[ + string, + string +], OwnershipTransferredEventObject>; +export declare type OwnershipTransferredEventFilter = TypedEventFilter; +export interface UniversalResolver extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this; + attach(addressOrName: string): this; + deployed(): Promise; + interface: UniversalResolverInterface; + queryFilter(event: TypedEventFilter, fromBlockOrBlockhash?: string | number | undefined, toBlock?: string | number | undefined): Promise>; + listeners(eventFilter?: TypedEventFilter): Array>; + listeners(eventName?: string): Array; + removeAllListeners(eventFilter: TypedEventFilter): this; + removeAllListeners(eventName?: string): this; + off: OnEvent; + on: OnEvent; + once: OnEvent; + removeListener: OnEvent; + functions: { + _resolveSingle(name: PromiseOrValue, data: PromiseOrValue, gateways: PromiseOrValue[], callbackFunction: PromiseOrValue, metaData: PromiseOrValue, overrides?: CallOverrides): Promise<[string, string]>; + batchGatewayURLs(arg0: PromiseOrValue, overrides?: CallOverrides): Promise<[string]>; + findResolver(name: PromiseOrValue, overrides?: CallOverrides): Promise<[string, string]>; + owner(overrides?: CallOverrides): Promise<[string]>; + registry(overrides?: CallOverrides): Promise<[string]>; + renounceOwnership(overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + 'resolve(bytes,bytes,string[])'(name: PromiseOrValue, data: PromiseOrValue, gateways: PromiseOrValue[], overrides?: CallOverrides): Promise<[string, string]>; + 'resolve(bytes,bytes[])'(name: PromiseOrValue, data: PromiseOrValue[], overrides?: CallOverrides): Promise<[string[], string]>; + 'resolve(bytes,bytes[],string[])'(name: PromiseOrValue, data: PromiseOrValue[], gateways: PromiseOrValue[], overrides?: CallOverrides): Promise<[string[], string]>; + 'resolve(bytes,bytes)'(name: PromiseOrValue, data: PromiseOrValue, overrides?: CallOverrides): Promise<[string, string]>; + resolveCallback(response: PromiseOrValue, extraData: PromiseOrValue, overrides?: CallOverrides): Promise<[string[], string]>; + resolveSingleCallback(response: PromiseOrValue, extraData: PromiseOrValue, overrides?: CallOverrides): Promise<[string, string]>; + 'reverse(bytes,string[])'(reverseName: PromiseOrValue, gateways: PromiseOrValue[], overrides?: CallOverrides): Promise<[string, string, string, string]>; + 'reverse(bytes)'(reverseName: PromiseOrValue, overrides?: CallOverrides): Promise<[string, string, string, string]>; + reverseCallback(response: PromiseOrValue, extraData: PromiseOrValue, overrides?: CallOverrides): Promise<[string, string, string, string]>; + setGatewayURLs(_urls: PromiseOrValue[], overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + supportsInterface(interfaceId: PromiseOrValue, overrides?: CallOverrides): Promise<[boolean]>; + transferOwnership(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + }; + _resolveSingle(name: PromiseOrValue, data: PromiseOrValue, gateways: PromiseOrValue[], callbackFunction: PromiseOrValue, metaData: PromiseOrValue, overrides?: CallOverrides): Promise<[string, string]>; + batchGatewayURLs(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + findResolver(name: PromiseOrValue, overrides?: CallOverrides): Promise<[string, string]>; + owner(overrides?: CallOverrides): Promise; + registry(overrides?: CallOverrides): Promise; + renounceOwnership(overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + 'resolve(bytes,bytes,string[])'(name: PromiseOrValue, data: PromiseOrValue, gateways: PromiseOrValue[], overrides?: CallOverrides): Promise<[string, string]>; + 'resolve(bytes,bytes[])'(name: PromiseOrValue, data: PromiseOrValue[], overrides?: CallOverrides): Promise<[string[], string]>; + 'resolve(bytes,bytes[],string[])'(name: PromiseOrValue, data: PromiseOrValue[], gateways: PromiseOrValue[], overrides?: CallOverrides): Promise<[string[], string]>; + 'resolve(bytes,bytes)'(name: PromiseOrValue, data: PromiseOrValue, overrides?: CallOverrides): Promise<[string, string]>; + resolveCallback(response: PromiseOrValue, extraData: PromiseOrValue, overrides?: CallOverrides): Promise<[string[], string]>; + resolveSingleCallback(response: PromiseOrValue, extraData: PromiseOrValue, overrides?: CallOverrides): Promise<[string, string]>; + 'reverse(bytes,string[])'(reverseName: PromiseOrValue, gateways: PromiseOrValue[], overrides?: CallOverrides): Promise<[string, string, string, string]>; + 'reverse(bytes)'(reverseName: PromiseOrValue, overrides?: CallOverrides): Promise<[string, string, string, string]>; + reverseCallback(response: PromiseOrValue, extraData: PromiseOrValue, overrides?: CallOverrides): Promise<[string, string, string, string]>; + setGatewayURLs(_urls: PromiseOrValue[], overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + supportsInterface(interfaceId: PromiseOrValue, overrides?: CallOverrides): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + callStatic: { + _resolveSingle(name: PromiseOrValue, data: PromiseOrValue, gateways: PromiseOrValue[], callbackFunction: PromiseOrValue, metaData: PromiseOrValue, overrides?: CallOverrides): Promise<[string, string]>; + batchGatewayURLs(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + findResolver(name: PromiseOrValue, overrides?: CallOverrides): Promise<[string, string]>; + owner(overrides?: CallOverrides): Promise; + registry(overrides?: CallOverrides): Promise; + renounceOwnership(overrides?: CallOverrides): Promise; + 'resolve(bytes,bytes,string[])'(name: PromiseOrValue, data: PromiseOrValue, gateways: PromiseOrValue[], overrides?: CallOverrides): Promise<[string, string]>; + 'resolve(bytes,bytes[])'(name: PromiseOrValue, data: PromiseOrValue[], overrides?: CallOverrides): Promise<[string[], string]>; + 'resolve(bytes,bytes[],string[])'(name: PromiseOrValue, data: PromiseOrValue[], gateways: PromiseOrValue[], overrides?: CallOverrides): Promise<[string[], string]>; + 'resolve(bytes,bytes)'(name: PromiseOrValue, data: PromiseOrValue, overrides?: CallOverrides): Promise<[string, string]>; + resolveCallback(response: PromiseOrValue, extraData: PromiseOrValue, overrides?: CallOverrides): Promise<[string[], string]>; + resolveSingleCallback(response: PromiseOrValue, extraData: PromiseOrValue, overrides?: CallOverrides): Promise<[string, string]>; + 'reverse(bytes,string[])'(reverseName: PromiseOrValue, gateways: PromiseOrValue[], overrides?: CallOverrides): Promise<[string, string, string, string]>; + 'reverse(bytes)'(reverseName: PromiseOrValue, overrides?: CallOverrides): Promise<[string, string, string, string]>; + reverseCallback(response: PromiseOrValue, extraData: PromiseOrValue, overrides?: CallOverrides): Promise<[string, string, string, string]>; + setGatewayURLs(_urls: PromiseOrValue[], overrides?: CallOverrides): Promise; + supportsInterface(interfaceId: PromiseOrValue, overrides?: CallOverrides): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: CallOverrides): Promise; + }; + filters: { + 'OwnershipTransferred(address,address)'(previousOwner?: PromiseOrValue | null, newOwner?: PromiseOrValue | null): OwnershipTransferredEventFilter; + OwnershipTransferred(previousOwner?: PromiseOrValue | null, newOwner?: PromiseOrValue | null): OwnershipTransferredEventFilter; + }; + estimateGas: { + _resolveSingle(name: PromiseOrValue, data: PromiseOrValue, gateways: PromiseOrValue[], callbackFunction: PromiseOrValue, metaData: PromiseOrValue, overrides?: CallOverrides): Promise; + batchGatewayURLs(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + findResolver(name: PromiseOrValue, overrides?: CallOverrides): Promise; + owner(overrides?: CallOverrides): Promise; + registry(overrides?: CallOverrides): Promise; + renounceOwnership(overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + 'resolve(bytes,bytes,string[])'(name: PromiseOrValue, data: PromiseOrValue, gateways: PromiseOrValue[], overrides?: CallOverrides): Promise; + 'resolve(bytes,bytes[])'(name: PromiseOrValue, data: PromiseOrValue[], overrides?: CallOverrides): Promise; + 'resolve(bytes,bytes[],string[])'(name: PromiseOrValue, data: PromiseOrValue[], gateways: PromiseOrValue[], overrides?: CallOverrides): Promise; + 'resolve(bytes,bytes)'(name: PromiseOrValue, data: PromiseOrValue, overrides?: CallOverrides): Promise; + resolveCallback(response: PromiseOrValue, extraData: PromiseOrValue, overrides?: CallOverrides): Promise; + resolveSingleCallback(response: PromiseOrValue, extraData: PromiseOrValue, overrides?: CallOverrides): Promise; + 'reverse(bytes,string[])'(reverseName: PromiseOrValue, gateways: PromiseOrValue[], overrides?: CallOverrides): Promise; + 'reverse(bytes)'(reverseName: PromiseOrValue, overrides?: CallOverrides): Promise; + reverseCallback(response: PromiseOrValue, extraData: PromiseOrValue, overrides?: CallOverrides): Promise; + setGatewayURLs(_urls: PromiseOrValue[], overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + supportsInterface(interfaceId: PromiseOrValue, overrides?: CallOverrides): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + }; + populateTransaction: { + _resolveSingle(name: PromiseOrValue, data: PromiseOrValue, gateways: PromiseOrValue[], callbackFunction: PromiseOrValue, metaData: PromiseOrValue, overrides?: CallOverrides): Promise; + batchGatewayURLs(arg0: PromiseOrValue, overrides?: CallOverrides): Promise; + findResolver(name: PromiseOrValue, overrides?: CallOverrides): Promise; + owner(overrides?: CallOverrides): Promise; + registry(overrides?: CallOverrides): Promise; + renounceOwnership(overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + 'resolve(bytes,bytes,string[])'(name: PromiseOrValue, data: PromiseOrValue, gateways: PromiseOrValue[], overrides?: CallOverrides): Promise; + 'resolve(bytes,bytes[])'(name: PromiseOrValue, data: PromiseOrValue[], overrides?: CallOverrides): Promise; + 'resolve(bytes,bytes[],string[])'(name: PromiseOrValue, data: PromiseOrValue[], gateways: PromiseOrValue[], overrides?: CallOverrides): Promise; + 'resolve(bytes,bytes)'(name: PromiseOrValue, data: PromiseOrValue, overrides?: CallOverrides): Promise; + resolveCallback(response: PromiseOrValue, extraData: PromiseOrValue, overrides?: CallOverrides): Promise; + resolveSingleCallback(response: PromiseOrValue, extraData: PromiseOrValue, overrides?: CallOverrides): Promise; + 'reverse(bytes,string[])'(reverseName: PromiseOrValue, gateways: PromiseOrValue[], overrides?: CallOverrides): Promise; + 'reverse(bytes)'(reverseName: PromiseOrValue, overrides?: CallOverrides): Promise; + reverseCallback(response: PromiseOrValue, extraData: PromiseOrValue, overrides?: CallOverrides): Promise; + setGatewayURLs(_urls: PromiseOrValue[], overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + supportsInterface(interfaceId: PromiseOrValue, overrides?: CallOverrides): Promise; + transferOwnership(newOwner: PromiseOrValue, overrides?: Overrides & { + from?: PromiseOrValue; + }): Promise; + }; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/common.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/common.d.ts new file mode 100644 index 000000000..8be4f543c --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/common.d.ts @@ -0,0 +1,22 @@ +import type { Event, EventFilter } from '@ethersproject/contracts'; +import type { Listener } from '@ethersproject/providers'; +export interface TypedEvent = any, TArgsObject = any> extends Event { + args: TArgsArray & TArgsObject; +} +export interface TypedEventFilter<_TEvent extends TypedEvent> extends EventFilter { +} +export interface TypedListener { + (...listenerArg: [...__TypechainArgsArray, TEvent]): void; +} +declare type __TypechainArgsArray = T extends TypedEvent ? U : never; +export interface OnEvent { + (eventFilter: TypedEventFilter, listener: TypedListener): TRes; + (eventName: string, listener: Listener): TRes; +} +export declare type MinEthersFactory = { + deploy(...a: ARGS[]): Promise; +}; +export declare type GetContractTypeFromFactory = F extends MinEthersFactory ? C : never; +export declare type GetARGsTypeFromFactory = F extends MinEthersFactory ? Parameters : never; +export declare type PromiseOrValue = T | Promise; +export {}; diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/factories/BaseRegistrarImplementation__factory.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/BaseRegistrarImplementation__factory.d.ts new file mode 100644 index 000000000..0d60c1a79 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/BaseRegistrarImplementation__factory.d.ts @@ -0,0 +1,52 @@ +import { Signer } from '@ethersproject/abstract-signer'; +import type { Provider } from '@ethersproject/providers'; +import type { BaseRegistrarImplementation, BaseRegistrarImplementationInterface } from '../BaseRegistrarImplementation'; +export declare class BaseRegistrarImplementation__factory { + static readonly abi: ({ + inputs: { + internalType: string; + name: string; + type: string; + }[]; + payable: boolean; + stateMutability: string; + type: string; + anonymous?: undefined; + name?: undefined; + constant?: undefined; + outputs?: undefined; + } | { + anonymous: boolean; + inputs: { + indexed: boolean; + internalType: string; + name: string; + type: string; + }[]; + name: string; + type: string; + payable?: undefined; + stateMutability?: undefined; + constant?: undefined; + outputs?: undefined; + } | { + constant: boolean; + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + outputs: { + internalType: string; + name: string; + type: string; + }[]; + payable: boolean; + stateMutability: string; + type: string; + anonymous?: undefined; + })[]; + static createInterface(): BaseRegistrarImplementationInterface; + static connect(address: string, signerOrProvider: Signer | Provider): BaseRegistrarImplementation; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/factories/BulkRenewal__factory.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/BulkRenewal__factory.d.ts new file mode 100644 index 000000000..f6aaa5b37 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/BulkRenewal__factory.d.ts @@ -0,0 +1,32 @@ +import { Signer } from '@ethersproject/abstract-signer'; +import type { Provider } from '@ethersproject/providers'; +import type { BulkRenewal, BulkRenewalInterface } from '../BulkRenewal'; +export declare class BulkRenewal__factory { + static readonly abi: ({ + inputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + name?: undefined; + outputs?: undefined; + } | { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + outputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + })[]; + static createInterface(): BulkRenewalInterface; + static connect(address: string, signerOrProvider: Signer | Provider): BulkRenewal; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/factories/DNSRegistrar__factory.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/DNSRegistrar__factory.d.ts new file mode 100644 index 000000000..4d99a4783 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/DNSRegistrar__factory.d.ts @@ -0,0 +1,67 @@ +import { Signer } from '@ethersproject/abstract-signer'; +import type { Provider } from '@ethersproject/providers'; +import type { DNSRegistrar, DNSRegistrarInterface } from '../DNSRegistrar'; +export declare class DNSRegistrar__factory { + static readonly abi: ({ + inputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + anonymous?: undefined; + name?: undefined; + outputs?: undefined; + } | { + anonymous: boolean; + inputs: { + indexed: boolean; + internalType: string; + name: string; + type: string; + }[]; + name: string; + type: string; + stateMutability?: undefined; + outputs?: undefined; + } | { + inputs: ({ + internalType: string; + name: string; + type: string; + components?: undefined; + } | { + components: { + internalType: string; + name: string; + type: string; + }[]; + internalType: string; + name: string; + type: string; + })[]; + name: string; + outputs: never[]; + stateMutability: string; + type: string; + anonymous?: undefined; + } | { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + outputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + anonymous?: undefined; + })[]; + static createInterface(): DNSRegistrarInterface; + static connect(address: string, signerOrProvider: Signer | Provider): DNSRegistrar; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/factories/DNSSECImpl__factory.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/DNSSECImpl__factory.d.ts new file mode 100644 index 000000000..ca925f798 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/DNSSECImpl__factory.d.ts @@ -0,0 +1,56 @@ +import { Signer } from '@ethersproject/abstract-signer'; +import type { Provider } from '@ethersproject/providers'; +import type { DNSSECImpl, DNSSECImplInterface } from '../DNSSECImpl'; +export declare class DNSSECImpl__factory { + static readonly abi: ({ + inputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + anonymous?: undefined; + name?: undefined; + outputs?: undefined; + } | { + anonymous: boolean; + inputs: { + indexed: boolean; + internalType: string; + name: string; + type: string; + }[]; + name: string; + type: string; + stateMutability?: undefined; + outputs?: undefined; + } | { + inputs: ({ + components: { + internalType: string; + name: string; + type: string; + }[]; + internalType: string; + name: string; + type: string; + } | { + internalType: string; + name: string; + type: string; + components?: undefined; + })[]; + name: string; + outputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + anonymous?: undefined; + })[]; + static createInterface(): DNSSECImplInterface; + static connect(address: string, signerOrProvider: Signer | Provider): DNSSECImpl; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/factories/DefaultReverseResolver__factory.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/DefaultReverseResolver__factory.d.ts new file mode 100644 index 000000000..6ad26e79d --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/DefaultReverseResolver__factory.d.ts @@ -0,0 +1,36 @@ +import { Signer } from '@ethersproject/abstract-signer'; +import type { Provider } from '@ethersproject/providers'; +import type { DefaultReverseResolver, DefaultReverseResolverInterface } from '../DefaultReverseResolver'; +export declare class DefaultReverseResolver__factory { + static readonly abi: ({ + inputs: { + internalType: string; + name: string; + type: string; + }[]; + payable: boolean; + stateMutability: string; + type: string; + constant?: undefined; + name?: undefined; + outputs?: undefined; + } | { + constant: boolean; + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + outputs: { + internalType: string; + name: string; + type: string; + }[]; + payable: boolean; + stateMutability: string; + type: string; + })[]; + static createInterface(): DefaultReverseResolverInterface; + static connect(address: string, signerOrProvider: Signer | Provider): DefaultReverseResolver; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/factories/ENSRegistry__factory.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/ENSRegistry__factory.d.ts new file mode 100644 index 000000000..96d362bfe --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/ENSRegistry__factory.d.ts @@ -0,0 +1,52 @@ +import { Signer } from '@ethersproject/abstract-signer'; +import type { Provider } from '@ethersproject/providers'; +import type { ENSRegistry, ENSRegistryInterface } from '../ENSRegistry'; +export declare class ENSRegistry__factory { + static readonly abi: ({ + inputs: { + internalType: string; + name: string; + type: string; + }[]; + payable: boolean; + stateMutability: string; + type: string; + anonymous?: undefined; + name?: undefined; + constant?: undefined; + outputs?: undefined; + } | { + anonymous: boolean; + inputs: { + indexed: boolean; + internalType: string; + name: string; + type: string; + }[]; + name: string; + type: string; + payable?: undefined; + stateMutability?: undefined; + constant?: undefined; + outputs?: undefined; + } | { + constant: boolean; + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + outputs: { + internalType: string; + name: string; + type: string; + }[]; + payable: boolean; + stateMutability: string; + type: string; + anonymous?: undefined; + })[]; + static createInterface(): ENSRegistryInterface; + static connect(address: string, signerOrProvider: Signer | Provider): ENSRegistry; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/factories/ETHRegistrarController__factory.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/ETHRegistrarController__factory.d.ts new file mode 100644 index 000000000..2cecf81da --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/ETHRegistrarController__factory.d.ts @@ -0,0 +1,77 @@ +import { Signer } from '@ethersproject/abstract-signer'; +import type { Provider } from '@ethersproject/providers'; +import type { ETHRegistrarController, ETHRegistrarControllerInterface } from '../ETHRegistrarController'; +export declare class ETHRegistrarController__factory { + static readonly abi: ({ + inputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + name?: undefined; + anonymous?: undefined; + outputs?: undefined; + } | { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + type: string; + stateMutability?: undefined; + anonymous?: undefined; + outputs?: undefined; + } | { + anonymous: boolean; + inputs: { + indexed: boolean; + internalType: string; + name: string; + type: string; + }[]; + name: string; + type: string; + stateMutability?: undefined; + outputs?: undefined; + } | { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + outputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + anonymous?: undefined; + } | { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + outputs: { + components: { + internalType: string; + name: string; + type: string; + }[]; + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + anonymous?: undefined; + })[]; + static createInterface(): ETHRegistrarControllerInterface; + static connect(address: string, signerOrProvider: Signer | Provider): ETHRegistrarController; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/factories/Multicall__factory.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/Multicall__factory.d.ts new file mode 100644 index 000000000..1ed587ee4 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/Multicall__factory.d.ts @@ -0,0 +1,42 @@ +import { Signer } from '@ethersproject/abstract-signer'; +import type { Provider } from '@ethersproject/providers'; +import type { Multicall, MulticallInterface } from '../Multicall'; +export declare class Multicall__factory { + static readonly abi: { + inputs: ({ + internalType: string; + name: string; + type: string; + components?: undefined; + } | { + components: { + internalType: string; + name: string; + type: string; + }[]; + internalType: string; + name: string; + type: string; + })[]; + name: string; + outputs: ({ + internalType: string; + name: string; + type: string; + components?: undefined; + } | { + components: { + internalType: string; + name: string; + type: string; + }[]; + internalType: string; + name: string; + type: string; + })[]; + stateMutability: string; + type: string; + }[]; + static createInterface(): MulticallInterface; + static connect(address: string, signerOrProvider: Signer | Provider): Multicall; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/factories/NameWrapper__factory.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/NameWrapper__factory.d.ts new file mode 100644 index 000000000..e14acbeb2 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/NameWrapper__factory.d.ts @@ -0,0 +1,57 @@ +import { Signer } from '@ethersproject/abstract-signer'; +import type { Provider } from '@ethersproject/providers'; +import type { NameWrapper, NameWrapperInterface } from '../NameWrapper'; +export declare class NameWrapper__factory { + static readonly abi: ({ + inputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + name?: undefined; + anonymous?: undefined; + outputs?: undefined; + } | { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + type: string; + stateMutability?: undefined; + anonymous?: undefined; + outputs?: undefined; + } | { + anonymous: boolean; + inputs: { + indexed: boolean; + internalType: string; + name: string; + type: string; + }[]; + name: string; + type: string; + stateMutability?: undefined; + outputs?: undefined; + } | { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + outputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + anonymous?: undefined; + })[]; + static createInterface(): NameWrapperInterface; + static connect(address: string, signerOrProvider: Signer | Provider): NameWrapper; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/factories/P256SHA256Algorithm__factory.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/P256SHA256Algorithm__factory.d.ts new file mode 100644 index 000000000..e05515841 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/P256SHA256Algorithm__factory.d.ts @@ -0,0 +1,22 @@ +import { Signer } from '@ethersproject/abstract-signer'; +import type { Provider } from '@ethersproject/providers'; +import type { P256SHA256Algorithm, P256SHA256AlgorithmInterface } from '../P256SHA256Algorithm'; +export declare class P256SHA256Algorithm__factory { + static readonly abi: { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + outputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + }[]; + static createInterface(): P256SHA256AlgorithmInterface; + static connect(address: string, signerOrProvider: Signer | Provider): P256SHA256Algorithm; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/factories/PublicResolver__factory.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/PublicResolver__factory.d.ts new file mode 100644 index 000000000..f91f02c77 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/PublicResolver__factory.d.ts @@ -0,0 +1,46 @@ +import { Signer } from '@ethersproject/abstract-signer'; +import type { Provider } from '@ethersproject/providers'; +import type { PublicResolver, PublicResolverInterface } from '../PublicResolver'; +export declare class PublicResolver__factory { + static readonly abi: ({ + inputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + anonymous?: undefined; + name?: undefined; + outputs?: undefined; + } | { + anonymous: boolean; + inputs: { + indexed: boolean; + internalType: string; + name: string; + type: string; + }[]; + name: string; + type: string; + stateMutability?: undefined; + outputs?: undefined; + } | { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + outputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + anonymous?: undefined; + })[]; + static createInterface(): PublicResolverInterface; + static connect(address: string, signerOrProvider: Signer | Provider): PublicResolver; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/factories/RSASHA1Algorithm__factory.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/RSASHA1Algorithm__factory.d.ts new file mode 100644 index 000000000..fec1cbd7a --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/RSASHA1Algorithm__factory.d.ts @@ -0,0 +1,22 @@ +import { Signer } from '@ethersproject/abstract-signer'; +import type { Provider } from '@ethersproject/providers'; +import type { RSASHA1Algorithm, RSASHA1AlgorithmInterface } from '../RSASHA1Algorithm'; +export declare class RSASHA1Algorithm__factory { + static readonly abi: { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + outputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + }[]; + static createInterface(): RSASHA1AlgorithmInterface; + static connect(address: string, signerOrProvider: Signer | Provider): RSASHA1Algorithm; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/factories/RSASHA256Algorithm__factory.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/RSASHA256Algorithm__factory.d.ts new file mode 100644 index 000000000..1fff21aca --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/RSASHA256Algorithm__factory.d.ts @@ -0,0 +1,22 @@ +import { Signer } from '@ethersproject/abstract-signer'; +import type { Provider } from '@ethersproject/providers'; +import type { RSASHA256Algorithm, RSASHA256AlgorithmInterface } from '../RSASHA256Algorithm'; +export declare class RSASHA256Algorithm__factory { + static readonly abi: { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + outputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + }[]; + static createInterface(): RSASHA256AlgorithmInterface; + static connect(address: string, signerOrProvider: Signer | Provider): RSASHA256Algorithm; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/factories/ReverseRegistrar__factory.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/ReverseRegistrar__factory.d.ts new file mode 100644 index 000000000..9af3a24c2 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/ReverseRegistrar__factory.d.ts @@ -0,0 +1,46 @@ +import { Signer } from '@ethersproject/abstract-signer'; +import type { Provider } from '@ethersproject/providers'; +import type { ReverseRegistrar, ReverseRegistrarInterface } from '../ReverseRegistrar'; +export declare class ReverseRegistrar__factory { + static readonly abi: ({ + inputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + anonymous?: undefined; + name?: undefined; + outputs?: undefined; + } | { + anonymous: boolean; + inputs: { + indexed: boolean; + internalType: string; + name: string; + type: string; + }[]; + name: string; + type: string; + stateMutability?: undefined; + outputs?: undefined; + } | { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + outputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + anonymous?: undefined; + })[]; + static createInterface(): ReverseRegistrarInterface; + static connect(address: string, signerOrProvider: Signer | Provider): ReverseRegistrar; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/factories/Root__factory.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/Root__factory.d.ts new file mode 100644 index 000000000..f14a61813 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/Root__factory.d.ts @@ -0,0 +1,52 @@ +import { Signer } from '@ethersproject/abstract-signer'; +import type { Provider } from '@ethersproject/providers'; +import type { Root, RootInterface } from '../Root'; +export declare class Root__factory { + static readonly abi: ({ + inputs: { + internalType: string; + name: string; + type: string; + }[]; + payable: boolean; + stateMutability: string; + type: string; + anonymous?: undefined; + name?: undefined; + constant?: undefined; + outputs?: undefined; + } | { + anonymous: boolean; + inputs: { + indexed: boolean; + internalType: string; + name: string; + type: string; + }[]; + name: string; + type: string; + payable?: undefined; + stateMutability?: undefined; + constant?: undefined; + outputs?: undefined; + } | { + constant: boolean; + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + outputs: { + internalType: string; + name: string; + type: string; + }[]; + payable: boolean; + stateMutability: string; + type: string; + anonymous?: undefined; + })[]; + static createInterface(): RootInterface; + static connect(address: string, signerOrProvider: Signer | Provider): Root; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/factories/SHA1Digest__factory.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/SHA1Digest__factory.d.ts new file mode 100644 index 000000000..08b1244bd --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/SHA1Digest__factory.d.ts @@ -0,0 +1,22 @@ +import { Signer } from '@ethersproject/abstract-signer'; +import type { Provider } from '@ethersproject/providers'; +import type { SHA1Digest, SHA1DigestInterface } from '../SHA1Digest'; +export declare class SHA1Digest__factory { + static readonly abi: { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + outputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + }[]; + static createInterface(): SHA1DigestInterface; + static connect(address: string, signerOrProvider: Signer | Provider): SHA1Digest; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/factories/SHA1NSEC3Digest__factory.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/SHA1NSEC3Digest__factory.d.ts new file mode 100644 index 000000000..01c64f703 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/SHA1NSEC3Digest__factory.d.ts @@ -0,0 +1,22 @@ +import { Signer } from '@ethersproject/abstract-signer'; +import type { Provider } from '@ethersproject/providers'; +import type { SHA1NSEC3Digest, SHA1NSEC3DigestInterface } from '../SHA1NSEC3Digest'; +export declare class SHA1NSEC3Digest__factory { + static readonly abi: { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + outputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + }[]; + static createInterface(): SHA1NSEC3DigestInterface; + static connect(address: string, signerOrProvider: Signer | Provider): SHA1NSEC3Digest; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/factories/SHA256Digest__factory.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/SHA256Digest__factory.d.ts new file mode 100644 index 000000000..b1d00f410 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/SHA256Digest__factory.d.ts @@ -0,0 +1,22 @@ +import { Signer } from '@ethersproject/abstract-signer'; +import type { Provider } from '@ethersproject/providers'; +import type { SHA256Digest, SHA256DigestInterface } from '../SHA256Digest'; +export declare class SHA256Digest__factory { + static readonly abi: { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + outputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + }[]; + static createInterface(): SHA256DigestInterface; + static connect(address: string, signerOrProvider: Signer | Provider): SHA256Digest; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/factories/StaticMetadataService__factory.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/StaticMetadataService__factory.d.ts new file mode 100644 index 000000000..bad0602f3 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/StaticMetadataService__factory.d.ts @@ -0,0 +1,32 @@ +import { Signer } from '@ethersproject/abstract-signer'; +import type { Provider } from '@ethersproject/providers'; +import type { StaticMetadataService, StaticMetadataServiceInterface } from '../StaticMetadataService'; +export declare class StaticMetadataService__factory { + static readonly abi: ({ + inputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + name?: undefined; + outputs?: undefined; + } | { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + outputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + })[]; + static createInterface(): StaticMetadataServiceInterface; + static connect(address: string, signerOrProvider: Signer | Provider): StaticMetadataService; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/factories/TLDPublicSuffixList__factory.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/TLDPublicSuffixList__factory.d.ts new file mode 100644 index 000000000..fbcf6dd0e --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/TLDPublicSuffixList__factory.d.ts @@ -0,0 +1,22 @@ +import { Signer } from '@ethersproject/abstract-signer'; +import type { Provider } from '@ethersproject/providers'; +import type { TLDPublicSuffixList, TLDPublicSuffixListInterface } from '../TLDPublicSuffixList'; +export declare class TLDPublicSuffixList__factory { + static readonly abi: { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + outputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + }[]; + static createInterface(): TLDPublicSuffixListInterface; + static connect(address: string, signerOrProvider: Signer | Provider): TLDPublicSuffixList; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/factories/UniversalResolver__factory.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/UniversalResolver__factory.d.ts new file mode 100644 index 000000000..41a1b1aa3 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/UniversalResolver__factory.d.ts @@ -0,0 +1,57 @@ +import { Signer } from '@ethersproject/abstract-signer'; +import type { Provider } from '@ethersproject/providers'; +import type { UniversalResolver, UniversalResolverInterface } from '../UniversalResolver'; +export declare class UniversalResolver__factory { + static readonly abi: ({ + inputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + name?: undefined; + anonymous?: undefined; + outputs?: undefined; + } | { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + type: string; + stateMutability?: undefined; + anonymous?: undefined; + outputs?: undefined; + } | { + anonymous: boolean; + inputs: { + indexed: boolean; + internalType: string; + name: string; + type: string; + }[]; + name: string; + type: string; + stateMutability?: undefined; + outputs?: undefined; + } | { + inputs: { + internalType: string; + name: string; + type: string; + }[]; + name: string; + outputs: { + internalType: string; + name: string; + type: string; + }[]; + stateMutability: string; + type: string; + anonymous?: undefined; + })[]; + static createInterface(): UniversalResolverInterface; + static connect(address: string, signerOrProvider: Signer | Provider): UniversalResolver; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/factories/index.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/index.d.ts new file mode 100644 index 000000000..4d5ec5d68 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/factories/index.d.ts @@ -0,0 +1,21 @@ +export { BaseRegistrarImplementation__factory } from "./BaseRegistrarImplementation__factory"; +export { BulkRenewal__factory } from "./BulkRenewal__factory"; +export { DNSRegistrar__factory } from "./DNSRegistrar__factory"; +export { DNSSECImpl__factory } from "./DNSSECImpl__factory"; +export { DefaultReverseResolver__factory } from "./DefaultReverseResolver__factory"; +export { ENSRegistry__factory } from "./ENSRegistry__factory"; +export { ETHRegistrarController__factory } from "./ETHRegistrarController__factory"; +export { Multicall__factory } from "./Multicall__factory"; +export { NameWrapper__factory } from "./NameWrapper__factory"; +export { P256SHA256Algorithm__factory } from "./P256SHA256Algorithm__factory"; +export { PublicResolver__factory } from "./PublicResolver__factory"; +export { RSASHA1Algorithm__factory } from "./RSASHA1Algorithm__factory"; +export { RSASHA256Algorithm__factory } from "./RSASHA256Algorithm__factory"; +export { ReverseRegistrar__factory } from "./ReverseRegistrar__factory"; +export { Root__factory } from "./Root__factory"; +export { SHA1Digest__factory } from "./SHA1Digest__factory"; +export { SHA1NSEC3Digest__factory } from "./SHA1NSEC3Digest__factory"; +export { SHA256Digest__factory } from "./SHA256Digest__factory"; +export { StaticMetadataService__factory } from "./StaticMetadataService__factory"; +export { TLDPublicSuffixList__factory } from "./TLDPublicSuffixList__factory"; +export { UniversalResolver__factory } from "./UniversalResolver__factory"; diff --git a/.yalc/@ensdomains/ensjs/dist/types/generated/index.d.ts b/.yalc/@ensdomains/ensjs/dist/types/generated/index.d.ts new file mode 100644 index 000000000..2764ea5f3 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/generated/index.d.ts @@ -0,0 +1,43 @@ +export type { BaseRegistrarImplementation } from "./BaseRegistrarImplementation"; +export type { BulkRenewal } from "./BulkRenewal"; +export type { DNSRegistrar } from "./DNSRegistrar"; +export type { DNSSECImpl } from "./DNSSECImpl"; +export type { DefaultReverseResolver } from "./DefaultReverseResolver"; +export type { ENSRegistry } from "./ENSRegistry"; +export type { ETHRegistrarController } from "./ETHRegistrarController"; +export type { Multicall } from "./Multicall"; +export type { NameWrapper } from "./NameWrapper"; +export type { P256SHA256Algorithm } from "./P256SHA256Algorithm"; +export type { PublicResolver } from "./PublicResolver"; +export type { RSASHA1Algorithm } from "./RSASHA1Algorithm"; +export type { RSASHA256Algorithm } from "./RSASHA256Algorithm"; +export type { ReverseRegistrar } from "./ReverseRegistrar"; +export type { Root } from "./Root"; +export type { SHA1Digest } from "./SHA1Digest"; +export type { SHA1NSEC3Digest } from "./SHA1NSEC3Digest"; +export type { SHA256Digest } from "./SHA256Digest"; +export type { StaticMetadataService } from "./StaticMetadataService"; +export type { TLDPublicSuffixList } from "./TLDPublicSuffixList"; +export type { UniversalResolver } from "./UniversalResolver"; +export * as factories from "./factories"; +export { BaseRegistrarImplementation__factory } from "./factories/BaseRegistrarImplementation__factory"; +export { DefaultReverseResolver__factory } from "./factories/DefaultReverseResolver__factory"; +export { DNSRegistrar__factory } from "./factories/DNSRegistrar__factory"; +export { DNSSECImpl__factory } from "./factories/DNSSECImpl__factory"; +export { ENSRegistry__factory } from "./factories/ENSRegistry__factory"; +export { ETHRegistrarController__factory } from "./factories/ETHRegistrarController__factory"; +export { P256SHA256Algorithm__factory } from "./factories/P256SHA256Algorithm__factory"; +export { PublicResolver__factory } from "./factories/PublicResolver__factory"; +export { ReverseRegistrar__factory } from "./factories/ReverseRegistrar__factory"; +export { Root__factory } from "./factories/Root__factory"; +export { RSASHA1Algorithm__factory } from "./factories/RSASHA1Algorithm__factory"; +export { RSASHA256Algorithm__factory } from "./factories/RSASHA256Algorithm__factory"; +export { SHA1Digest__factory } from "./factories/SHA1Digest__factory"; +export { SHA1NSEC3Digest__factory } from "./factories/SHA1NSEC3Digest__factory"; +export { SHA256Digest__factory } from "./factories/SHA256Digest__factory"; +export { TLDPublicSuffixList__factory } from "./factories/TLDPublicSuffixList__factory"; +export { Multicall__factory } from "./factories/Multicall__factory"; +export { NameWrapper__factory } from "./factories/NameWrapper__factory"; +export { StaticMetadataService__factory } from "./factories/StaticMetadataService__factory"; +export { UniversalResolver__factory } from "./factories/UniversalResolver__factory"; +export { BulkRenewal__factory } from "./factories/BulkRenewal__factory"; diff --git a/.yalc/@ensdomains/ensjs/dist/types/index.d.ts b/.yalc/@ensdomains/ensjs/dist/types/index.d.ts new file mode 100644 index 000000000..4d1d888f8 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/index.d.ts @@ -0,0 +1,595 @@ +import { ContractTransaction, PopulatedTransaction } from '@ethersproject/contracts'; +import type { JsonRpcProvider, JsonRpcSigner, Provider } from '@ethersproject/providers'; +import { getContractAddress as _getContractAddress } from './contracts/getContractAddress'; +import ContractManager from './contracts/index'; +import { SupportedNetworkId } from './contracts/types'; +import GqlManager from './GqlManager'; +export type { ChildFuses, ParentFuses } from './utils/fuses'; +declare type ENSOptions = { + graphURI?: string | null; + getContractAddress?: typeof _getContractAddress; +}; +export declare type InternalENS = { + options?: ENSOptions; + provider?: Provider; + signer: JsonRpcSigner; + graphURI?: string | null; +} & ENS; +export declare type ENSArgs = { + [P in K]: InternalENS[P]; +}; +declare type OmitFirstArg = F extends (x: any, ...args: infer P) => infer R ? (...args: P) => R : never; +declare type OmitFirstTwoArgs = F extends (x: any, y: any, ...args: infer P) => infer R ? (...args: P) => R : never; +declare type FirstArg = F extends (x: infer A, ...args: any[]) => any ? A : never; +declare type FunctionDeps = Extract, string>[]; +declare type WriteOptions = { + addressOrIndex?: string | number; + signer?: JsonRpcSigner; +}; +declare type OptionalWriteOptions = F extends (x: any, arg_0: infer Z, options?: infer P) => infer R ? (name: Z, options?: P & WriteOptions) => R : F extends (x: any, arg_0: infer Z, options: infer P) => infer R ? (name: Z, options: P & WriteOptions) => R : never; +interface WriteFunction any> extends Function { + (...args: Parameters>): Promise; + }>; + populateTransaction: (...args: Parameters>) => Promise; +} +export declare const graphURIEndpoints: Record; +export declare type RawFunction = { + raw: (...args: any[]) => Promise<{ + to: string; + data: string; + }>; + decode: (...args: any[]) => Promise; +}; +export declare type BatchFunctionResult = { + args: Parameters>; + raw: F['raw']; + decode: F['decode']; +}; +declare type BatchFunction = (...args: Parameters>) => BatchFunctionResult; +export declare type RawFunctionWithBatch = { + batch: BatchFunction; +} & RawFunction; +interface GeneratedRawFunction extends Function, RawFunction { + (...args: Parameters>): ReturnType>; + batch: BatchFunction; +} +export interface GenericGeneratedRawFunction extends Function, RawFunctionWithBatch { +} +interface GeneratedBatchFunction extends Function, RawFunction { + []>(...args: I): Promise<{ + [N in keyof I]: I[N] extends BatchFunctionResult ? Awaited> : never; + } | undefined>; + batch: BatchFunction; +} +export declare type FunctionSubtype = 'raw' | 'decode' | 'combine' | 'batch' | 'write' | 'populateTransaction'; +export declare class ENS { + [x: string]: any; + protected options?: ENSOptions; + protected provider?: JsonRpcProvider; + protected graphURI?: string | null; + protected initialProvider?: JsonRpcProvider; + contracts?: ContractManager; + getContractAddress: (networkId: SupportedNetworkId) => import("./contracts/getContractAddress").ContractAddressFetch; + gqlInstance: GqlManager; + constructor(options?: ENSOptions); + /** + * Checks for an initial provider and if it exists, sets it as the provider + * @returns {Promise} - A promise that resolves when the provider is checked, and set if needed + */ + private checkInitialProvider; + /** + * Creates an object of ENS properties from an array + * @param {FunctionDeps} dependencies - An array of ENS properties + * @returns {Object} - An object of ENS properties + */ + protected forwardDependenciesFromArray: (dependencies: FunctionDeps) => object; + protected getModule: (path: string, exportName: string) => Promise; + protected getFunction: (subFunc: FunctionSubtype | undefined, writeable: boolean | undefined, exportName: string, mod: any, _path: string) => any; + /** + * Creates a wrapper for a function to be dynamically imported, with the correct dependencies passed in + * @param {string} path - The path of the exported function + * @param {FunctionDeps} dependencies - An array of ENS properties + * @param {string} exportName - The export name of the target function + * @param {string} subFunc - The type of function being imported + * @returns {Function} - The generated wrapped function + */ + private importGenerator; + /** + * Generates a normal wrapped function + * @param {string} path - The path of the exported function + * @param {FunctionDeps} dependencies - An array of ENS properties + * @param {string} exportName - The export name of the target function + * @returns {OmitFirstArg} - The generated wrapped function + */ + private generateFunction; + /** + * Generates a write wrapped function + * @param {string} path - The path of the exported function + * @param {FunctionDeps} dependencies - An array of ENS properties + * @param {string} exportName - The export name of the target function + * @returns {OmitFirstArg} - The generated wrapped function + */ + private generateWriteFunction; + /** + * Generates a wrapped function from raw and decode exports + * @param {string} path - The path of the exported function + * @param {FunctionDeps} dependencies - An array of ENS properties + * @param {string} exportName - The export name of the target function + * @returns {GeneratedRawFunction} - The generated wrapped function + */ + private generateRawFunction; + /** + * Sets the provider for the ENS class + * @param {JsonRpcProvider} provider - The provider to set + * @returns {Promise} - A promise that resolves when the provider is set + */ + setProvider: (provider: JsonRpcProvider) => Promise; + /** + * Creates a new ENS instance with a different provider, ideally should be used individually with any given function + * @param {JsonRpcProvider} provider - The provider to use + * @returns {ENS} - A new ENS instance with the given provider + */ + withProvider: (provider: JsonRpcProvider) => ENS; + batch: GeneratedBatchFunction<{ + raw: ({ multicallWrapper }: ENSArgs<"multicallWrapper">, ...items: BatchFunctionResult[]) => Promise<{ + to: string; + data: string; + }>; + decode: ({ multicallWrapper }: ENSArgs<"multicallWrapper">, data: string, ...items: BatchFunctionResult[]) => Promise; + }>; + getProfile: (nameOrAddress: string, options?: ({ + contentHash?: boolean | undefined; + texts?: boolean | string[] | undefined; + coinTypes?: boolean | string[] | undefined; + } & { + resolverAddress?: string | undefined; + fallback?: { + contentHash?: boolean | undefined; + texts?: string[] | undefined; + coinTypes?: string[] | undefined; + } | undefined; + }) | undefined) => Promise<{ + isMigrated: boolean | null; + createdAt: string | null; + address?: string | undefined; + name?: string | null | undefined; + match?: boolean | undefined; + message?: string | undefined; + records?: { + contentHash?: string | import("./utils/contentHash").DecodedContentHash | null | undefined; + texts?: { + key: string | number; + type: "text" | "addr" | "contentHash"; + coin?: string | undefined; + value: string; + }[] | undefined; + coinTypes?: { + key: string | number; + type: "text" | "addr" | "contentHash"; + coin?: string | undefined; + value: string; + }[] | undefined; + } | undefined; + resolverAddress?: string | undefined; + isInvalidResolverAddress?: boolean | undefined; + reverseResolverAddress?: string | undefined; + } | undefined>; + getRecords: (name: string, options?: { + contentHash?: boolean | undefined; + texts?: boolean | string[] | undefined; + coinTypes?: boolean | string[] | undefined; + resolverAddress?: string | undefined; + } | undefined) => Promise<{ + isMigrated: boolean | null; + createdAt: string | null; + address?: string | undefined; + name?: string | null | undefined; + match?: boolean | undefined; + message?: string | undefined; + records?: { + contentHash?: string | import("./utils/contentHash").DecodedContentHash | null | undefined; + texts?: { + key: string | number; + type: "text" | "addr" | "contentHash"; + coin?: string | undefined; + value: string; + }[] | undefined; + coinTypes?: { + key: string | number; + type: "text" | "addr" | "contentHash"; + coin?: string | undefined; + value: string; + }[] | undefined; + } | undefined; + resolverAddress?: string | undefined; + isInvalidResolverAddress?: boolean | undefined; + reverseResolverAddress?: string | undefined; + } | undefined>; + getName: GeneratedRawFunction<{ + raw: ({ contracts }: ENSArgs<"contracts">, address: string) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts }: ENSArgs<"contracts">, data: string, address: string) => Promise<{ + name: any; + match: boolean; + reverseResolverAddress: any; + resolverAddress: any; + } | { + name: undefined; + match?: undefined; + reverseResolverAddress?: undefined; + resolverAddress?: undefined; + } | undefined>; + }>; + getResolver: GeneratedRawFunction<{ + raw: ({ contracts }: ENSArgs<"contracts">, name: string) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts }: ENSArgs<"contracts">, data: string) => Promise; + }>; + getWrapperData: GeneratedRawFunction<{ + raw: ({ contracts }: ENSArgs<"contracts">, name: string) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts }: ENSArgs<"contracts">, data: string) => Promise<{ + expiryDate: Date | undefined; + rawFuses: number; + owner: string; + parent: { + unnamed: { + 524288: boolean; + 1048576: boolean; + 2097152: boolean; + 4194304: boolean; + 8388608: boolean; + 16777216: boolean; + 33554432: boolean; + 67108864: boolean; + 134217728: boolean; + 268435456: boolean; + 536870912: boolean; + 1073741824: boolean; + 2147483648: boolean; + }; + IS_DOT_ETH: boolean; + PARENT_CANNOT_CONTROL: boolean; + CAN_EXTEND_EXPIRY: boolean; + }; + child: { + CAN_DO_EVERYTHING: boolean; + unnamed: { + 1024: boolean; + 64: boolean; + 128: boolean; + 256: boolean; + 512: boolean; + 2048: boolean; + 4096: boolean; + 8192: boolean; + 16384: boolean; + 32768: boolean; + }; + CANNOT_UNWRAP: boolean; + CANNOT_BURN_FUSES: boolean; + CANNOT_TRANSFER: boolean; + CANNOT_SET_RESOLVER: boolean; + CANNOT_SET_TTL: boolean; + CANNOT_CREATE_SUBDOMAIN: boolean; + }; + } | undefined>; + }>; + getHistory: (name: string) => Promise<{ + domain: { + type: "Transfer" | "NewOwner" | "NewResolver" | "NewTTL" | "ExpiryExtended" | "FusesSet" | "NameUnwrapped" | "NameWrapped" | "WrappedTransfer"; + blockNumber: number; + transactionHash: string; + id: string; + data: object; + }[]; + registration: { + type: "NameRegistered" | "NameRenewed" | "NameTransferred"; + blockNumber: number; + transactionHash: string; + id: string; + data: object; + }[]; + resolver: { + type: "AddrChanged" | "ContenthashChanged" | "InterfaceChanged" | "NameChanged" | "PubkeyChanged" | "TextChanged" | "VersionChanged" | "MulticoinAddrChanged" | "AbiChanged" | "AuthorisationChanged"; + blockNumber: number; + transactionHash: string; + id: string; + data: object; + }[]; + } | undefined>; + getContentHash: GeneratedRawFunction<{ + raw: ({ contracts, universalWrapper }: ENSArgs<"contracts" | "universalWrapper">, name: string) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts, universalWrapper }: ENSArgs<"contracts" | "universalWrapper">, data: string) => Promise<{ + protocolType?: undefined; + decoded?: undefined; + error?: undefined; + } | { + protocolType: null; + decoded: any; + error?: undefined; + } | { + protocolType: string | undefined; + decoded: any; + error: any; + } | undefined>; + }>; + _getContentHash: GeneratedRawFunction<{ + raw: ({ contracts }: ENSArgs<"contracts">, name: string) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts }: ENSArgs<"contracts">, data: string) => Promise<{ + protocolType?: undefined; + decoded?: undefined; + error?: undefined; + } | { + protocolType: null; + decoded: any; + error?: undefined; + } | { + protocolType: string | undefined; + decoded: any; + error: any; + } | undefined>; + }>; + getAddr: GeneratedRawFunction<{ + raw: ({ contracts, universalWrapper }: ENSArgs<"contracts" | "universalWrapper">, name: string, coinType?: string | number | undefined) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts, universalWrapper }: ENSArgs<"contracts" | "universalWrapper">, data: string, _name: string, coinType?: string | number | undefined) => Promise; + }>; + _getAddr: GeneratedRawFunction<{ + raw: ({ contracts }: ENSArgs<"contracts">, name: string, coinType?: string | number | undefined, bypassFormat?: boolean | undefined) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts }: ENSArgs<"contracts">, data: string, _name: string, coinType?: string | number | undefined) => Promise; + }>; + getText: GeneratedRawFunction<{ + raw: ({ contracts, universalWrapper }: ENSArgs<"contracts" | "universalWrapper">, name: string, key: string) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts, universalWrapper }: ENSArgs<"contracts" | "universalWrapper">, data: string) => Promise; + }>; + _getText: GeneratedRawFunction<{ + raw: ({ contracts }: ENSArgs<"contracts">, name: string, key: string) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts }: ENSArgs<"contracts">, data: string) => Promise; + }>; + getABI: GeneratedRawFunction<{ + raw: ({ contracts, universalWrapper }: ENSArgs<"contracts" | "universalWrapper">, name: string) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts, universalWrapper }: ENSArgs<"contracts" | "universalWrapper">, data: string) => Promise<{ + contentType: number; + decoded: boolean; + abi: string | object; + } | undefined>; + }>; + _getABI: GeneratedRawFunction<{ + raw: ({ contracts }: ENSArgs<"contracts">, name: string) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts }: ENSArgs<"contracts">, data: string) => Promise<{ + contentType: number; + decoded: boolean; + abi: string | object; + } | undefined>; + }>; + getOwner: GeneratedRawFunction<{ + raw: ({ contracts, multicallWrapper }: ENSArgs<"contracts" | "multicallWrapper">, name: string, contract?: "nameWrapper" | "registrar" | "registry" | undefined) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts, multicallWrapper, gqlInstance, }: ENSArgs<"contracts" | "gqlInstance" | "multicallWrapper">, data: string, name: string, contract?: "nameWrapper" | "registrar" | "registry" | undefined) => Promise<{ + registrant?: string | undefined; + owner?: string | undefined; + ownershipLevel: "nameWrapper" | "registrar" | "registry"; + expired?: boolean | undefined; + } | undefined>; + }>; + getExpiry: GeneratedRawFunction<{ + raw: (ensArgs: ENSArgs<"contracts" | "multicallWrapper">, name: string, { contract }?: { + contract?: ("nameWrapper" | "registrar") | undefined; + }) => Promise<{ + to: string; + data: string; + }>; + decode: (ensArgs: ENSArgs<"contracts" | "multicallWrapper">, data: string, name: string, { contract }?: { + contract?: ("nameWrapper" | "registrar") | undefined; + }) => Promise<{ + expiry: Date; + gracePeriod: null; + } | { + expiry: Date | null; + gracePeriod: number; + } | undefined>; + }>; + getSubnames: (functionArgs: { + name: string; + page?: number | undefined; + pageSize?: number | undefined; + orderDirection?: "asc" | "desc" | undefined; + orderBy?: "labelName" | "createdAt" | undefined; + lastSubnames?: any[] | undefined; + search?: string | undefined; + }) => Promise<{ + subnames: { + id: string; + labelName: string | null; + truncatedName?: string | undefined; + labelhash: string; + isMigrated: boolean; + name: string; + owner: { + id: string; + }; + }[]; + subnameCount: number; + }>; + getNames: (args_0: { + address: string; + type: "owner" | "wrappedOwner" | "registrant" | "all"; + page?: number | undefined; + pageSize?: number | undefined; + orderDirection?: "asc" | "desc" | undefined; + } & ({ + type: "registrant"; + orderBy?: "expiryDate" | "registrationDate" | "labelName" | undefined; + } | { + type: "owner"; + orderBy?: "labelName" | "createdAt" | undefined; + } | { + type: "wrappedOwner"; + orderBy?: "name" | "expiryDate" | undefined; + } | { + type: "all"; + orderBy?: "labelName" | "creationDate" | undefined; + page?: undefined; + pageSize?: undefined; + })) => Promise; + getPrice: GeneratedRawFunction<{ + raw: ({ contracts, multicallWrapper }: ENSArgs<"contracts" | "multicallWrapper">, nameOrNames: string | string[], duration: number, legacy?: boolean | undefined) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts, multicallWrapper }: ENSArgs<"contracts" | "multicallWrapper">, data: string, _nameOrNames: string | string[], _duration: number, legacy?: boolean | undefined) => Promise<{ + base: import("ethers").BigNumber; + premium: import("ethers").BigNumber; + } | undefined>; + }>; + getDNSOwner: (dnsName: string) => Promise; + supportsTLD: (name: string) => Promise; + getAvailable: GeneratedRawFunction<{ + raw: ({ contracts }: ENSArgs<"contracts">, name: string) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts }: ENSArgs<"contracts">, data: string) => Promise; + }>; + universalWrapper: GeneratedRawFunction<{ + raw: ({ contracts }: ENSArgs<"contracts">, name: string, data: string) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts }: ENSArgs<"contracts">, data: string) => Promise<{ + data: any; + resolver: any; + } | undefined>; + }>; + resolverMulticallWrapper: GeneratedRawFunction<{ + raw: ({ contracts }: ENSArgs<"contracts">, data: { + to: string; + data: string; + }[]) => Promise<{ + to: string; + data: string; + }>; + decode: ({ contracts }: ENSArgs<"contracts">, data: string) => Promise; + }>; + multicallWrapper: GeneratedRawFunction<{ + raw({ contracts }: ENSArgs<"contracts">, transactions: import("@ethersproject/abstract-provider").TransactionRequest[], requireSuccess?: boolean): Promise<{ + to: string; + data: string; + }>; + decode({ contracts, provider }: ENSArgs<"provider" | "contracts">, data: string, transactions: import("@ethersproject/abstract-provider").TransactionRequest[]): Promise<{ + success: boolean; + returnData: string; + 0: boolean; + 1: string; + length: 2; + toString(): string; + toLocaleString(): string; + pop(): string | boolean | undefined; + push(...items: (string | boolean)[]): number; + concat(...items: ConcatArray[]): (string | boolean)[]; + concat(...items: (string | boolean | ConcatArray)[]): (string | boolean)[]; + join(separator?: string | undefined): string; + reverse(): (string | boolean)[]; + shift(): string | boolean | undefined; + slice(start?: number | undefined, end?: number | undefined): (string | boolean)[]; + sort(compareFn?: ((a: string | boolean, b: string | boolean) => number) | undefined): [boolean, string]; + splice(start: number, deleteCount?: number | undefined): (string | boolean)[]; + splice(start: number, deleteCount: number, ...items: (string | boolean)[]): (string | boolean)[]; + unshift(...items: (string | boolean)[]): number; + indexOf(searchElement: string | boolean, fromIndex?: number | undefined): number; + lastIndexOf(searchElement: string | boolean, fromIndex?: number | undefined): number; + every(predicate: (value: string | boolean, index: number, array: (string | boolean)[]) => value is S, thisArg?: any): this is S[]; + every(predicate: (value: string | boolean, index: number, array: (string | boolean)[]) => unknown, thisArg?: any): boolean; + some(predicate: (value: string | boolean, index: number, array: (string | boolean)[]) => unknown, thisArg?: any): boolean; + forEach(callbackfn: (value: string | boolean, index: number, array: (string | boolean)[]) => void, thisArg?: any): void; + map(callbackfn: (value: string | boolean, index: number, array: (string | boolean)[]) => U, thisArg?: any): U[]; + filter(predicate: (value: string | boolean, index: number, array: (string | boolean)[]) => value is S_1, thisArg?: any): S_1[]; + filter(predicate: (value: string | boolean, index: number, array: (string | boolean)[]) => unknown, thisArg?: any): (string | boolean)[]; + reduce(callbackfn: (previousValue: string | boolean, currentValue: string | boolean, currentIndex: number, array: (string | boolean)[]) => string | boolean): string | boolean; + reduce(callbackfn: (previousValue: string | boolean, currentValue: string | boolean, currentIndex: number, array: (string | boolean)[]) => string | boolean, initialValue: string | boolean): string | boolean; + reduce(callbackfn: (previousValue: U_1, currentValue: string | boolean, currentIndex: number, array: (string | boolean)[]) => U_1, initialValue: U_1): U_1; + reduceRight(callbackfn: (previousValue: string | boolean, currentValue: string | boolean, currentIndex: number, array: (string | boolean)[]) => string | boolean): string | boolean; + reduceRight(callbackfn: (previousValue: string | boolean, currentValue: string | boolean, currentIndex: number, array: (string | boolean)[]) => string | boolean, initialValue: string | boolean): string | boolean; + reduceRight(callbackfn: (previousValue: U_2, currentValue: string | boolean, currentIndex: number, array: (string | boolean)[]) => U_2, initialValue: U_2): U_2; + find(predicate: (this: void, value: string | boolean, index: number, obj: (string | boolean)[]) => value is S_2, thisArg?: any): S_2 | undefined; + find(predicate: (value: string | boolean, index: number, obj: (string | boolean)[]) => unknown, thisArg?: any): string | boolean | undefined; + findIndex(predicate: (value: string | boolean, index: number, obj: (string | boolean)[]) => unknown, thisArg?: any): number; + fill(value: string | boolean, start?: number | undefined, end?: number | undefined): [boolean, string]; + copyWithin(target: number, start: number, end?: number | undefined): [boolean, string]; + entries(): IterableIterator<[number, string | boolean]>; + keys(): IterableIterator; + values(): IterableIterator; + includes(searchElement: string | boolean, fromIndex?: number | undefined): boolean; + flatMap(callback: (this: This, value: string | boolean, index: number, array: (string | boolean)[]) => U_3 | readonly U_3[], thisArg?: This | undefined): U_3[]; + flat(this: A, depth?: D | undefined): FlatArray[]; + [Symbol.iterator](): IterableIterator; + [Symbol.unscopables](): { + copyWithin: boolean; + entries: boolean; + fill: boolean; + find: boolean; + findIndex: boolean; + keys: boolean; + values: boolean; + }; + at(index: number): string | boolean | undefined; + }[] | undefined>; + }>; + setName: WriteFunction; + setRecords: WriteFunction; + setRecord: WriteFunction; + setResolver: WriteFunction; + transferName: WriteFunction; + transferController: WriteFunction; + wrapName: WriteFunction; + unwrapName: WriteFunction; + setFuses: WriteFunction; + setChildFuses: WriteFunction; + importDNSSECName: WriteFunction; + createSubname: WriteFunction; + deleteSubname: WriteFunction; + transferSubname: WriteFunction; + commitName: WriteFunction; + registerName: WriteFunction; + renewNames: WriteFunction; + extendWrappedName: WriteFunction; +} diff --git a/.yalc/@ensdomains/ensjs/dist/types/static.d.ts b/.yalc/@ensdomains/ensjs/dist/types/static.d.ts new file mode 100644 index 000000000..6c79368c6 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/static.d.ts @@ -0,0 +1,26 @@ +import type { StaticJsonRpcProvider } from '@ethersproject/providers/lib/url-json-rpc-provider'; +import { gql, GraphQLClient } from 'graphql-request'; +import { ENS, FunctionSubtype } from './index'; +import type Factories from './contracts/factories'; +import type FunctionTypes from './functions/types'; +declare type Options = ConstructorParameters[0] & { + functions: Partial; + contracts: Partial; +}; +declare class StaticENS extends ENS { + private functions; + private contractsObject; + gqlInstance: { + client: GraphQLClient | { + request: () => Promise; + }; + setUrl: () => Promise; + gql: typeof gql | ((query: TemplateStringsArray) => string); + }; + constructor(provider: StaticJsonRpcProvider, { functions, contracts, ...options }: Options); + setStaticProvider: (provider: StaticJsonRpcProvider) => void; + setProvider: (provider: StaticJsonRpcProvider) => Promise; + protected getModule: () => Promise>; + protected getFunction: (subFunc: FunctionSubtype | undefined, _writeable: boolean | undefined, exportName: string, mod: any, path: string) => any; +} +export default StaticENS; diff --git a/.yalc/@ensdomains/ensjs/dist/types/utils/ccip.d.ts b/.yalc/@ensdomains/ensjs/dist/types/utils/ccip.d.ts new file mode 100644 index 000000000..58459d1b3 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/utils/ccip.d.ts @@ -0,0 +1,3 @@ +import type { BaseProvider, TransactionRequest } from '@ethersproject/providers'; +declare const ccipLookup: (provider: BaseProvider, transaction: TransactionRequest, result: string) => Promise; +export default ccipLookup; diff --git a/.yalc/@ensdomains/ensjs/dist/types/utils/consts.d.ts b/.yalc/@ensdomains/ensjs/dist/types/utils/consts.d.ts new file mode 100644 index 000000000..d4036840c --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/utils/consts.d.ts @@ -0,0 +1,2 @@ +export declare const EMPTY_ADDRESS = "0x0000000000000000000000000000000000000000"; +export declare const MAX_INT_64: bigint; diff --git a/.yalc/@ensdomains/ensjs/dist/types/utils/contentHash.d.ts b/.yalc/@ensdomains/ensjs/dist/types/utils/contentHash.d.ts new file mode 100644 index 000000000..5c33b33a9 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/utils/contentHash.d.ts @@ -0,0 +1,28 @@ +export declare type DecodedContentHash = { + protocolType?: any; + decoded?: any; + error?: any; +}; +export declare function decodeContenthash(encoded: any): { + protocolType?: undefined; + decoded?: undefined; + error?: undefined; +} | { + protocolType: null; + decoded: any; + error?: undefined; +} | { + protocolType: string | undefined; + decoded: any; + error: any; +}; +export declare function validateContent(encoded: any): any; +export declare function isValidContenthash(encoded: any): boolean | undefined; +export declare function getProtocolType(encoded: any): { + protocolType: string | undefined; + decoded: string | undefined; +} | undefined; +export declare function encodeContenthash(text: string): { + encoded: string | boolean; + error: string | undefined; +}; diff --git a/.yalc/@ensdomains/ensjs/dist/types/utils/createReverseNode.d.ts b/.yalc/@ensdomains/ensjs/dist/types/utils/createReverseNode.d.ts new file mode 100644 index 000000000..cd34d7b9f --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/utils/createReverseNode.d.ts @@ -0,0 +1,2 @@ +declare const _default: (address: string) => string; +export default _default; diff --git a/.yalc/@ensdomains/ensjs/dist/types/utils/format.d.ts b/.yalc/@ensdomains/ensjs/dist/types/utils/format.d.ts new file mode 100644 index 000000000..636653267 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/utils/format.d.ts @@ -0,0 +1,3 @@ +export declare const formatHashed: (name: string) => string; +export declare const truncateFormat: (name: string) => string; +export declare const bracketFormat: (name: string) => string; diff --git a/.yalc/@ensdomains/ensjs/dist/types/utils/fuses.d.ts b/.yalc/@ensdomains/ensjs/dist/types/utils/fuses.d.ts new file mode 100644 index 000000000..65d66c71d --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/utils/fuses.d.ts @@ -0,0 +1,130 @@ +export declare const CHILD_CONTROLLED_FUSES = 65535; +export declare const PARENT_CONTROLLED_FUSES = 4294901760; +export declare const USER_SETTABLE_FUSES = 4294836223; +export declare const childFuseEnum: { + readonly CANNOT_UNWRAP: 1; + readonly CANNOT_BURN_FUSES: 2; + readonly CANNOT_TRANSFER: 4; + readonly CANNOT_SET_RESOLVER: 8; + readonly CANNOT_SET_TTL: 16; + readonly CANNOT_CREATE_SUBDOMAIN: 32; +}; +export declare const parentFuseEnum: { + PARENT_CANNOT_CONTROL: number; + CAN_EXTEND_EXPIRY: number; +}; +export declare const fullParentFuseEnum: { + readonly IS_DOT_ETH: 131072; + readonly PARENT_CANNOT_CONTROL: number; + readonly CAN_EXTEND_EXPIRY: number; +}; +export declare const userSettableFuseEnum: { + readonly PARENT_CANNOT_CONTROL: number; + readonly CAN_EXTEND_EXPIRY: number; + readonly CANNOT_UNWRAP: 1; + readonly CANNOT_BURN_FUSES: 2; + readonly CANNOT_TRANSFER: 4; + readonly CANNOT_SET_RESOLVER: 8; + readonly CANNOT_SET_TTL: 16; + readonly CANNOT_CREATE_SUBDOMAIN: 32; +}; +export declare const fullFuseEnum: { + CAN_DO_EVERYTHING: number; + PARENT_CANNOT_CONTROL: number; + CAN_EXTEND_EXPIRY: number; + CANNOT_UNWRAP: 1; + CANNOT_BURN_FUSES: 2; + CANNOT_TRANSFER: 4; + CANNOT_SET_RESOLVER: 8; + CANNOT_SET_TTL: 16; + CANNOT_CREATE_SUBDOMAIN: 32; +}; +export declare const unnamedChildFuses: readonly [64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768]; +export declare const unnamedParentFuses: readonly [524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648]; +export declare const unnamedUserSettableFuses: readonly [64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648]; +export declare const childFuseKeys: ("CANNOT_UNWRAP" | "CANNOT_BURN_FUSES" | "CANNOT_TRANSFER" | "CANNOT_SET_RESOLVER" | "CANNOT_SET_TTL" | "CANNOT_CREATE_SUBDOMAIN")[]; +export declare const parentFuseKeys: ("PARENT_CANNOT_CONTROL" | "CAN_EXTEND_EXPIRY")[]; +export declare const fullParentFuseKeys: ("PARENT_CANNOT_CONTROL" | "CAN_EXTEND_EXPIRY" | "IS_DOT_ETH")[]; +export declare const userSettableFuseKeys: ("CANNOT_UNWRAP" | "CANNOT_BURN_FUSES" | "CANNOT_TRANSFER" | "CANNOT_SET_RESOLVER" | "CANNOT_SET_TTL" | "CANNOT_CREATE_SUBDOMAIN" | "PARENT_CANNOT_CONTROL" | "CAN_EXTEND_EXPIRY")[]; +declare type FuseType, UnnamedTuple extends readonly number[], CustomFuses extends string = never> = { + fuse: keyof Enum; + options: { + -readonly [K in keyof Enum]?: boolean; + }; + current: { + [K in keyof Enum]: boolean; + } & { + readonly [K in CustomFuses]: boolean; + }; + unnamed: UnnamedTuple; + unnamedValues: UnnamedTuple[number]; + unnamedObject: { + [K in UnnamedTuple[number]]: boolean; + }; +}; +export declare type ChildFuses = FuseType; +export declare type ParentFuses = FuseType; +export declare type FullParentFuses = FuseType; +export declare type UserSettableFuses = FuseType; +declare type InputFuses = { + named: readonly NamedFuse[]; +} | { + unnamed: readonly UnnamedFuse[]; +} | { + named: readonly NamedFuse[]; + unnamed: readonly UnnamedFuse[]; +} | { + number: number; +}; +export declare type CombinedFuseInput = { + child: InputFuses; + parent: InputFuses; +}; +export declare function encodeFuses(fuses: Partial | number): number; +export declare function encodeFuses(fuses: CombinedFuseInput['child'], restrictTo: 'child'): number; +export declare function encodeFuses(fuses: CombinedFuseInput['parent'], restrictTo: 'parent'): number; +export declare const decodeFuses: (fuses: number) => { + parent: { + unnamed: { + 524288: boolean; + 1048576: boolean; + 2097152: boolean; + 4194304: boolean; + 8388608: boolean; + 16777216: boolean; + 33554432: boolean; + 67108864: boolean; + 134217728: boolean; + 268435456: boolean; + 536870912: boolean; + 1073741824: boolean; + 2147483648: boolean; + }; + IS_DOT_ETH: boolean; + PARENT_CANNOT_CONTROL: boolean; + CAN_EXTEND_EXPIRY: boolean; + }; + child: { + CAN_DO_EVERYTHING: boolean; + unnamed: { + 1024: boolean; + 64: boolean; + 128: boolean; + 256: boolean; + 512: boolean; + 2048: boolean; + 4096: boolean; + 8192: boolean; + 16384: boolean; + 32768: boolean; + }; + CANNOT_UNWRAP: boolean; + CANNOT_BURN_FUSES: boolean; + CANNOT_TRANSFER: boolean; + CANNOT_SET_RESOLVER: boolean; + CANNOT_SET_TTL: boolean; + CANNOT_CREATE_SUBDOMAIN: boolean; + }; +}; +export declare type AllCurrentFuses = ReturnType; +export default fullFuseEnum; diff --git a/.yalc/@ensdomains/ensjs/dist/types/utils/hexEncodedName.d.ts b/.yalc/@ensdomains/ensjs/dist/types/utils/hexEncodedName.d.ts new file mode 100644 index 000000000..a28c8aadd --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/utils/hexEncodedName.d.ts @@ -0,0 +1 @@ +export declare const hexEncodeName: (name: string) => string; diff --git a/.yalc/@ensdomains/ensjs/dist/types/utils/labels.d.ts b/.yalc/@ensdomains/ensjs/dist/types/utils/labels.d.ts new file mode 100644 index 000000000..827d83596 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/utils/labels.d.ts @@ -0,0 +1,14 @@ +export declare const labelhash: (input: string) => string; +export declare const keccakFromString: (input: string) => string; +export declare function decodeLabelhash(hash: string): string; +export declare function encodeLabelhash(hash: string): string; +export declare function isEncodedLabelhash(hash: string): boolean; +export declare function saveLabel(label: string): string; +export declare function saveName(name: string): void; +export declare function checkLabel(hash: string): string | undefined; +export declare function encodeLabel(label: any): any; +export declare function parseName(name: string): string; +export declare function checkIsDecrypted(string: string | string[]): boolean; +export declare function decryptName(name: string): string; +export declare const truncateUndecryptedName: (name: string) => string; +export declare function checkLocalStorageSize(): string; diff --git a/.yalc/@ensdomains/ensjs/dist/types/utils/makeHashIndexes.d.ts b/.yalc/@ensdomains/ensjs/dist/types/utils/makeHashIndexes.d.ts new file mode 100644 index 000000000..b503cba8f --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/utils/makeHashIndexes.d.ts @@ -0,0 +1,2 @@ +export declare const makeOtherIndexes: (data: string, findStr: string) => number[]; +export declare const makeNamehashIndexes: (data: string, name: string) => number[]; diff --git a/.yalc/@ensdomains/ensjs/dist/types/utils/normalise.d.ts b/.yalc/@ensdomains/ensjs/dist/types/utils/normalise.d.ts new file mode 100644 index 000000000..d072d6abb --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/utils/normalise.d.ts @@ -0,0 +1,2 @@ +export declare const normalise: (name: string) => any; +export declare const namehash: (name: string) => string; diff --git a/.yalc/@ensdomains/ensjs/dist/types/utils/recordHelpers.d.ts b/.yalc/@ensdomains/ensjs/dist/types/utils/recordHelpers.d.ts new file mode 100644 index 000000000..25ce7d90b --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/utils/recordHelpers.d.ts @@ -0,0 +1,29 @@ +/// +import type { BigNumberish } from 'ethers'; +import type { PublicResolver } from '../generated'; +declare type RecordItem = { + key: string; + value: string; +}; +declare type ABIEncodeAs = 'json' | 'zlib' | 'cbor' | 'uri'; +declare type ABIItem = { + contentType?: BigNumberish; + data: object | string; +}; +export declare type RecordOptions = { + clearRecords?: boolean; + contentHash?: string; + texts?: RecordItem[]; + coinTypes?: RecordItem[]; + abi?: ABIItem; +}; +export declare const generateSetAddr: (namehash: string, coinType: string, address: string, resolver: PublicResolver) => string; +export declare const generateABIInput: (encodeAs: ABIEncodeAs, data: object | string) => Promise<{ + contentType: number; + data: string | Uint8Array | Buffer; +}>; +export declare type RecordTypes = 'contentHash' | 'text' | 'addr' | 'abi'; +export declare type RecordInput = T extends 'contentHash' ? string : T extends 'abi' ? ABIItem : RecordItem; +export declare function generateSingleRecordCall(namehash: string, resolver: PublicResolver, type: T): (record: RecordInput) => string; +export declare const generateRecordCallArray: (namehash: string, records: RecordOptions, resolver: PublicResolver) => string[]; +export {}; diff --git a/.yalc/@ensdomains/ensjs/dist/types/utils/registerHelpers.d.ts b/.yalc/@ensdomains/ensjs/dist/types/utils/registerHelpers.d.ts new file mode 100644 index 000000000..f6e8d9033 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/utils/registerHelpers.d.ts @@ -0,0 +1,41 @@ +import type { PublicResolver } from '../generated'; +import { CombinedFuseInput } from './fuses'; +import { RecordOptions } from './recordHelpers'; +export declare type BaseRegistrationParams = { + owner: string; + duration: number; + secret: string; + resolverAddress?: string; + records?: RecordOptions; + reverseRecord?: boolean; + fuses?: CombinedFuseInput['child']; +}; +export declare type RegistrationParams = Omit & { + name: string; + resolver: PublicResolver; +}; +export declare type CommitmentParams = Omit & { + secret?: string; +}; +export declare type RegistrationTuple = [ + name: string, + owner: string, + duration: number, + secret: string, + resolver: string, + data: string[], + reverseRecord: boolean, + ownerControlledFuses: number +]; +export declare const randomSecret: () => string; +export declare const makeCommitmentData: ({ name, owner, duration, resolver, records, reverseRecord, fuses, secret, }: Omit & { + secret?: string | undefined; +} & { + secret: string; +}) => RegistrationTuple; +export declare const makeRegistrationData: (params: RegistrationParams) => RegistrationTuple; +export declare const _makeCommitment: (params: RegistrationTuple) => string; +export declare const makeCommitment: ({ secret, ...inputParams }: CommitmentParams) => { + secret: string; + commitment: string; +}; diff --git a/.yalc/@ensdomains/ensjs/dist/types/utils/singleCall.d.ts b/.yalc/@ensdomains/ensjs/dist/types/utils/singleCall.d.ts new file mode 100644 index 000000000..993d0f9ac --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/utils/singleCall.d.ts @@ -0,0 +1,9 @@ +import type { Provider } from '@ethersproject/providers'; +declare const _default: (provider: Provider, ensData: any, func: { + raw: (...args: any[]) => Promise<{ + to: string; + data: string; + }>; + decode: (...args: any[]) => Promise; +}, ...data: any[]) => Promise; +export default _default; diff --git a/.yalc/@ensdomains/ensjs/dist/types/utils/subgraph-types.d.ts b/.yalc/@ensdomains/ensjs/dist/types/utils/subgraph-types.d.ts new file mode 100644 index 000000000..ebe095628 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/utils/subgraph-types.d.ts @@ -0,0 +1,284 @@ +export declare type Maybe = T | null; +export declare type Exact = { + [K in keyof T]: T[K]; +}; +export declare type MakeOptional = Omit & { + [SubKey in K]?: Maybe; +}; +export declare type MakeMaybe = Omit & { + [SubKey in K]: Maybe; +}; +/** All built-in and custom scalars, mapped to their actual values */ +export declare type Scalars = { + ID: string; + String: string; + Boolean: boolean; + Int: number; + Float: number; + Bytes: string; + BigInt: string; +}; +export declare type Domain = { + __typename?: 'Domain'; + id: Scalars['ID']; + name?: Maybe; + labelName?: Maybe; + labelhash?: Maybe; + parent?: Maybe; + subdomains: Array; + subdomainCount: Scalars['Int']; + resolvedAddress?: Maybe; + owner: Account; + resolver?: Maybe; + ttl?: Maybe; + isMigrated: Scalars['Boolean']; + createdAt: Scalars['BigInt']; + events: Array; + registration?: Maybe; + wrappedDomain?: Maybe; +}; +export declare type DomainEvent = { + id: Scalars['ID']; + domain: Domain; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; +}; +export declare type Transfer = DomainEvent & { + __typename?: 'Transfer'; + id: Scalars['ID']; + domain: Domain; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; + owner: Account; +}; +export declare type NewOwner = DomainEvent & { + __typename?: 'NewOwner'; + id: Scalars['ID']; + parentDomain: Domain; + domain: Domain; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; + owner: Account; +}; +export declare type NewResolver = DomainEvent & { + __typename?: 'NewResolver'; + id: Scalars['ID']; + domain: Domain; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; + resolver: Resolver; +}; +export declare type NewTtl = DomainEvent & { + __typename?: 'NewTTL'; + id: Scalars['ID']; + domain: Domain; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; + ttl: Scalars['BigInt']; +}; +export declare type WrappedTransfer = DomainEvent & { + __typename?: 'WrappedTransfer'; + id: Scalars['ID']; + domain: Domain; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; + owner: Account; +}; +export declare type NameWrapped = DomainEvent & { + __typename?: 'NameWrapped'; + id: Scalars['ID']; + domain: Domain; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; + name: Scalars['String']; + fuses: Scalars['Int']; + owner: Account; + expiryDate: Scalars['BigInt']; +}; +export declare type NameUnwrapped = DomainEvent & { + __typename?: 'NameUnwrapped'; + id: Scalars['ID']; + domain: Domain; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; + owner: Account; +}; +export declare type FusesSet = DomainEvent & { + __typename?: 'FusesSet'; + id: Scalars['ID']; + domain: Domain; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; + fuses: Scalars['Int']; +}; +export declare type ExpiryExtended = DomainEvent & { + __typename?: 'ExpiryExtended'; + id: Scalars['ID']; + domain: Domain; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; + expiryDate: Scalars['BigInt']; +}; +export declare type Registration = { + __typename?: 'Registration'; + id: Scalars['ID']; + domain: Domain; + registrationDate: Scalars['BigInt']; + expiryDate: Scalars['BigInt']; + cost?: Maybe; + registrant: Account; + labelName?: Maybe; + events: Array; +}; +export declare type RegistrationEvent = { + id: Scalars['ID']; + registration: Registration; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; +}; +export declare type NameRegistered = RegistrationEvent & { + __typename?: 'NameRegistered'; + id: Scalars['ID']; + registration: Registration; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; + registrant: Account; + expiryDate: Scalars['BigInt']; +}; +export declare type NameRenewed = RegistrationEvent & { + __typename?: 'NameRenewed'; + id: Scalars['ID']; + registration: Registration; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; + expiryDate: Scalars['BigInt']; +}; +export declare type NameTransferred = RegistrationEvent & { + __typename?: 'NameTransferred'; + id: Scalars['ID']; + registration: Registration; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; + newOwner: Account; +}; +export declare type WrappedDomain = { + __typename?: 'WrappedDomain'; + id: Scalars['ID']; + domain: Domain; + expiryDate: Scalars['BigInt']; + fuses: Scalars['Int']; + owner: Account; + name?: Maybe; +}; +export declare type Account = { + __typename?: 'Account'; + id: Scalars['ID']; + domains: Array; + wrappedDomains?: Maybe>; + registrations?: Maybe>; +}; +export declare type Resolver = { + __typename?: 'Resolver'; + id: Scalars['ID']; + domain?: Maybe; + address: Scalars['Bytes']; + addr?: Maybe; + contentHash?: Maybe; + texts?: Maybe>; + coinTypes?: Maybe>; + events: Array; +}; +export declare type ResolverEvent = { + id: Scalars['ID']; + resolver: Resolver; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; +}; +export declare type AddrChanged = ResolverEvent & { + __typename?: 'AddrChanged'; + id: Scalars['ID']; + resolver: Resolver; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; + addr: Account; +}; +export declare type MulticoinAddrChanged = ResolverEvent & { + __typename?: 'MulticoinAddrChanged'; + id: Scalars['ID']; + resolver: Resolver; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; + coinType: Scalars['BigInt']; + addr: Scalars['Bytes']; +}; +export declare type NameChanged = ResolverEvent & { + __typename?: 'NameChanged'; + id: Scalars['ID']; + resolver: Resolver; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; + name: Scalars['String']; +}; +export declare type AbiChanged = ResolverEvent & { + __typename?: 'AbiChanged'; + id: Scalars['ID']; + resolver: Resolver; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; + contentType: Scalars['BigInt']; +}; +export declare type PubkeyChanged = ResolverEvent & { + __typename?: 'PubkeyChanged'; + id: Scalars['ID']; + resolver: Resolver; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; + x: Scalars['Bytes']; + y: Scalars['Bytes']; +}; +export declare type TextChanged = ResolverEvent & { + __typename?: 'TextChanged'; + id: Scalars['ID']; + resolver: Resolver; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; + key: Scalars['String']; + value?: Maybe; +}; +export declare type ContenthashChanged = ResolverEvent & { + __typename?: 'ContenthashChanged'; + id: Scalars['ID']; + resolver: Resolver; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; + hash: Scalars['Bytes']; +}; +export declare type InterfaceChanged = ResolverEvent & { + __typename?: 'InterfaceChanged'; + id: Scalars['ID']; + resolver: Resolver; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; + interfaceID: Scalars['Bytes']; + implementer: Scalars['Bytes']; +}; +export declare type AuthorisationChanged = ResolverEvent & { + __typename?: 'AuthorisationChanged'; + id: Scalars['ID']; + resolver: Resolver; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; + owner: Scalars['Bytes']; + target: Scalars['Bytes']; + isAuthorized: Scalars['Boolean']; +}; +export declare type VersionChanged = ResolverEvent & { + __typename?: 'VersionChanged'; + id: Scalars['ID']; + resolver: Resolver; + blockNumber: Scalars['Int']; + transactionID: Scalars['Bytes']; + version: Scalars['BigInt']; +}; diff --git a/.yalc/@ensdomains/ensjs/dist/types/utils/validation.d.ts b/.yalc/@ensdomains/ensjs/dist/types/utils/validation.d.ts new file mode 100644 index 000000000..b7eaedadd --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/utils/validation.d.ts @@ -0,0 +1,8 @@ +export declare const validateName: (name: string) => string; +export declare const validateTLD: (name: string) => string; +declare type InputType = { + type: 'name' | 'label' | 'address' | 'unknown'; + info?: 'short' | 'supported' | 'unsupported'; +}; +export declare const parseInputType: (input: string) => InputType; +export {}; diff --git a/.yalc/@ensdomains/ensjs/dist/types/utils/wrapper.d.ts b/.yalc/@ensdomains/ensjs/dist/types/utils/wrapper.d.ts new file mode 100644 index 000000000..58cedfccf --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/utils/wrapper.d.ts @@ -0,0 +1,6 @@ +import { BigNumber } from '@ethersproject/bignumber/lib/bignumber'; +import { ENSArgs } from '../index'; +export declare type Expiry = string | number | Date | BigNumber; +export declare const MAX_EXPIRY: BigNumber; +export declare const makeExpiry: ({ getExpiry }: ENSArgs<'getExpiry'>, name: string, expiry?: Expiry) => Promise; +export declare const wrappedLabelLengthCheck: (label: string) => void; diff --git a/.yalc/@ensdomains/ensjs/dist/types/utils/writeTx.d.ts b/.yalc/@ensdomains/ensjs/dist/types/utils/writeTx.d.ts new file mode 100644 index 000000000..523ed8f50 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/dist/types/utils/writeTx.d.ts @@ -0,0 +1,21 @@ +import type { PopulatedTransaction } from '@ethersproject/contracts'; +import type { JsonRpcSigner } from '@ethersproject/providers'; +declare type CustomData = Record; +declare const _default: (signer: JsonRpcSigner, populate: boolean) => ({ customData, ...tx }: PopulatedTransaction) => { + to?: string | undefined; + from?: string | undefined; + nonce?: number | undefined; + gasLimit?: import("ethers").BigNumber | undefined; + gasPrice?: import("ethers").BigNumber | undefined; + data?: string | undefined; + value?: import("ethers").BigNumber | undefined; + chainId?: number | undefined; + type?: number | undefined; + accessList?: import("@ethersproject/transactions").AccessList | undefined; + maxFeePerGas?: import("ethers").BigNumber | undefined; + maxPriorityFeePerGas?: import("ethers").BigNumber | undefined; + ccipReadEnabled?: boolean | undefined; +} | Promise; +export default _default; diff --git a/.yalc/@ensdomains/ensjs/package.json b/.yalc/@ensdomains/ensjs/package.json new file mode 100644 index 000000000..8114a77e6 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/package.json @@ -0,0 +1,103 @@ +{ + "name": "@ensdomains/ensjs", + "version": "3.0.0-alpha.41", + "description": "ENS javascript library for contract interaction", + "main": "./dist/cjs/index.js", + "module": "./dist/esm/index.mjs", + "types": "./dist/types/index.d.ts", + "exports": { + ".": { + "import": "./dist/esm/index.mjs", + "require": "./dist/cjs/index.js", + "default": "./dist/esm/index.mjs" + }, + "./*.js": { + "import": "./dist/esm/*.mjs", + "require": "./dist/cjs/*.js", + "default": "./dist/esm/*.mjs" + }, + "./*.mjs": { + "import": "./dist/esm/*.mjs", + "require": "./dist/cjs/*.js", + "default": "./dist/esm/*.mjs" + }, + "./*": { + "import": "./dist/esm/*.mjs", + "require": "./dist/cjs/*.js", + "default": "./dist/esm/*.mjs" + } + }, + "typesVersions": { + "*": { + "static": [ + "./dist/types/static.d.ts" + ], + "contracts/*": [ + "./dist/types/contracts/*" + ], + "functions/*": [ + "./dist/types/functions/*" + ], + "utils/*": [ + "./dist/types/utils/*" + ], + "generated/*": [ + "./dist/types/generated/*" + ] + } + }, + "files": [ + "dist/", + "src/", + "!src/tests" + ], + "repository": "git@github.com:ensdomains/ensjs-v3.git", + "author": "TateB ", + "license": "MIT", + "scripts": { + "tenv": "ens-test-env -a", + "denv": "pnpm tenv start -ns -nb --extra-time 11368000 --verbosity 1", + "generate-types": "ts-node scripts/runTypechain.ts", + "generate-abis": "hardhat export-abi", + "start": "ts-node --files src/index.test.ts", + "test": "jest --run-in-band", + "test:static": "STATIC_ENS=true jest --run-in-band", + "test:watch": "jest --watch --run-in-band", + "test:specific": "ts-node --files ", + "clean": "rm -rf ./dist ./README.md ./LICENSE", + "lint": "eslint ./src/* --no-error-on-unmatched-pattern", + "build:types": "tsc --emitDeclarationOnly --project tsconfig.build.json", + "build": "pnpm clean && pnpm lint && pnpm build:types && pnpm node esbuild.js", + "enode": "ganache --wallet.mnemonic=\"test test test test test test test test test test test junk\" --chain.chainId 1337 --chain.networkId 1337 --chain.time 1663311099000", + "ver": "pnpm version --no-workspaces-update" + }, + "dependencies": { + "@ensdomains/address-encoder": "^0.2.18", + "@ensdomains/content-hash": "^2.5.7", + "@ensdomains/dnsprovejs": "^0.4.1", + "@ensdomains/dnssecoraclejs": "^0.2.7", + "cbor": "^8.1.0", + "dns-packet": "^5.3.1", + "graphql": "^16.3.0", + "graphql-request": "next", + "idna-uts46-hx": "3.4.0", + "pako": "^2.1.0", + "traverse": "^0.6.6" + }, + "peerDependencies": { + "@ethersproject/abi": "^5.6.4", + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/contracts": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/providers": "^5.6.8", + "@ethersproject/solidity": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.1" + }, + "yalcSig": "a48202939e398afd18e432ee23beb45d" +} diff --git a/.yalc/@ensdomains/ensjs/src/@types/@ensdomains/content-hash.d.ts b/.yalc/@ensdomains/ensjs/src/@types/@ensdomains/content-hash.d.ts new file mode 100644 index 000000000..f5e1cd524 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/@types/@ensdomains/content-hash.d.ts @@ -0,0 +1 @@ +declare module '@ensdomains/content-hash' diff --git a/.yalc/@ensdomains/ensjs/src/@types/@ensdomains/ens-contracts.d.ts b/.yalc/@ensdomains/ensjs/src/@types/@ensdomains/ens-contracts.d.ts new file mode 100644 index 000000000..3a6623882 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/@types/@ensdomains/ens-contracts.d.ts @@ -0,0 +1 @@ +declare module '@ensdomains/ens-contracts' diff --git a/.yalc/@ensdomains/ensjs/src/@types/dns-packet.d.ts b/.yalc/@ensdomains/ensjs/src/@types/dns-packet.d.ts new file mode 100644 index 000000000..a4519dca2 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/@types/dns-packet.d.ts @@ -0,0 +1 @@ +declare module 'dns-packet' diff --git a/.yalc/@ensdomains/ensjs/src/@types/dns-packet/index.d.ts b/.yalc/@ensdomains/ensjs/src/@types/dns-packet/index.d.ts new file mode 100644 index 000000000..e121d00a3 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/@types/dns-packet/index.d.ts @@ -0,0 +1,114 @@ +/* eslint-disable @typescript-eslint/naming-convention */ +declare module 'dns-packet' { + const AUTHORITATIVE_ANSWER: number + const TRUNCATED_RESPONSE: number + const RECURSION_DESIRED: number + const RECURSION_AVAILABLE: number + const AUTHENTIC_DATA: number + const CHECKING_DISABLED: number + const DNSSEC_OK: number + + interface decoder { + (buf: Buffer, offset?: number): T + bytes: number + } + + const decode: decoder + + interface encoder { + (packet: T, buf?: Buffer, offset?: number): Buffer + bytes: number + } + + const encode: encoder + + interface Packet { + id?: number + type: 'query' | 'response' + flags?: number + rcode?: string + questions: Question[] + answers?: Answer[] + authorities?: Answer[] + additionals?: Answer[] + } + + interface Question { + type: string + class: string + name: string + } + + interface AnswerBase { + type: string + class: string + name: string + ttl?: number + } + + interface A extends AnswerBase { + type: 'A' + data: string + } + + interface Dnskey extends AnswerBase { + type: 'DNSKEY' + data: { + flags: number + algorithm: number + key: Buffer + } + } + + interface Ds extends AnswerBase { + type: 'DS' + data: { + keyTag: number + algorithm: number + digestType: number + digest: Buffer + } + } + + interface Opt extends AnswerBase { + type: 'OPT' + udpPayloadSize?: number + extendedRcode?: number + ednsVersion?: number + flags?: number + data?: any + } + + interface Rrsig extends AnswerBase { + type: 'RRSIG' + data: { + typeCovered: string + algorithm: number + labels: number + originalTTL: number + expiration: number + inception: number + keyTag: number + signersName: string + signature: Buffer + } + } + + interface Rtxt extends AnswerBase { + type: 'TXT' + data: Buffer[] + } + + type Answer = A | Dnskey | Ds | Opt | Rrsig | Rtxt + + interface Encodable { + decode: decoder + encode: encoder + } + + const record: (type: string) => Encodable + const answer: Encodable + const dnskey: Encodable + const name: Encodable + const rrsig: Encodable +} diff --git a/.yalc/@ensdomains/ensjs/src/@types/idna-uts46-hx.d.ts b/.yalc/@ensdomains/ensjs/src/@types/idna-uts46-hx.d.ts new file mode 100644 index 000000000..455371dd7 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/@types/idna-uts46-hx.d.ts @@ -0,0 +1 @@ +declare module 'idna-uts46-hx/uts46bundle.js' diff --git a/.yalc/@ensdomains/ensjs/src/@types/pako.d.ts b/.yalc/@ensdomains/ensjs/src/@types/pako.d.ts new file mode 100644 index 000000000..83acfb33b --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/@types/pako.d.ts @@ -0,0 +1,188 @@ +/* eslint-disable max-classes-per-file */ +// Type definitions for pako 2.0 +// Project: https://github.com/nodeca/pako +// Definitions by: Caleb Eggensperger +// Muhammet Öztürk +// Thibault Poisson +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +// eslint-disable-next-line @typescript-eslint/naming-convention +enum constants { + // FlushValues + Z_NO_FLUSH = 0, + Z_PARTIAL_FLUSH = 1, + Z_SYNC_FLUSH = 2, + Z_FULL_FLUSH = 3, + Z_FINISH = 4, + Z_BLOCK = 5, + Z_TREES = 6, + // StrategyValues + Z_FILTERED = 1, + Z_HUFFMAN_ONLY = 2, + Z_RLE = 3, + Z_FIXED = 4, + Z_DEFAULT_STRATEGY = 0, + // ReturnCodes + Z_OK = 0, + Z_STREAM_END = 1, + Z_NEED_DICT = 2, + Z_ERRNO = -1, + Z_STREAM_ERROR = -2, + Z_DATA_ERROR = -3, + Z_BUF_ERROR = -5, +} + +type FlushValues = + | constants.Z_NO_FLUSH + | constants.Z_PARTIAL_FLUSH + | constants.Z_SYNC_FLUSH + | constants.Z_FINISH + | constants.Z_BLOCK + | constants.Z_TREES + +type StrategyValues = + | constants.Z_FILTERED + | constants.Z_HUFFMAN_ONLY + | constants.Z_RLE + | constants.Z_FIXED + | constants.Z_DEFAULT_STRATEGY + +type ReturnCodes = + | constants.Z_OK + | constants.Z_STREAM_END + | constants.Z_NEED_DICT + | constants.Z_ERRNO + | constants.Z_STREAM_ERROR + | constants.Z_DATA_ERROR + | constants.Z_BUF_ERROR + | constants.Z_DEFAULT_STRATEGY + +interface DeflateOptions { + level?: -1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | undefined + windowBits?: number | undefined + memLevel?: number | undefined + strategy?: StrategyValues | undefined + dictionary?: any + raw?: boolean | undefined + chunkSize?: number | undefined + gzip?: boolean | undefined + header?: Header | undefined +} + +interface DeflateFunctionOptions { + level?: -1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | undefined + windowBits?: number | undefined + memLevel?: number | undefined + strategy?: StrategyValues | undefined + dictionary?: any + raw?: boolean | undefined +} + +interface InflateOptions { + windowBits?: number | undefined + dictionary?: any + raw?: boolean | undefined + to?: 'string' | undefined + chunkSize?: number | undefined +} + +interface InflateFunctionOptions { + windowBits?: number | undefined + raw?: boolean | undefined + to?: 'string' | undefined +} + +interface Header { + text?: boolean | undefined + time?: number | undefined + os?: number | undefined + extra?: number[] | undefined + name?: string | undefined + comment?: string | undefined + hcrc?: boolean | undefined +} + +type Data = Uint8Array | ArrayBuffer + +declare module 'pako/dist/pako_inflate.min.js' { + /** + * Decompress data with inflate/ungzip and options. Autodetect format via wrapper header + * by default. That's why we don't provide separate ungzip method. + */ + function inflate( + data: Data, + options: InflateFunctionOptions & { to: 'string' }, + ): string + function inflate(data: Data, options?: InflateFunctionOptions): Uint8Array + + /** + * The same as inflate, but creates raw data, without wrapper (header and adler32 crc). + */ + function inflateRaw( + data: Data, + options: InflateFunctionOptions & { to: 'string' }, + ): string + function inflateRaw(data: Data, options?: InflateFunctionOptions): Uint8Array + + /** + * Just shortcut to inflate, because it autodetects format by header.content. Done for convenience. + */ + function ungzip( + data: Data, + options: InflateFunctionOptions & { to: 'string' }, + ): string + function ungzip(data: Data, options?: InflateFunctionOptions): Uint8Array + + // https://github.com/nodeca/pako/blob/893381abcafa10fa2081ce60dae7d4d8e873a658/lib/inflate.js + class Inflate { + constructor(options?: InflateOptions) + header?: Header | undefined + + err: ReturnCodes + + msg: string + + result: Uint8Array | string + onData(chunk: Data): void + onEnd(status: number): void + push(data: Data, mode?: FlushValues | boolean): boolean + } +} + +declare module 'pako/dist/pako_deflate.min.js' { + /** + * Compress data with deflate algorithm and options. + */ + function deflate( + data: Data | string, + options?: DeflateFunctionOptions, + ): Uint8Array + + /** + * The same as deflate, but creates raw data, without wrapper (header and adler32 crc). + */ + function deflateRaw( + data: Data | string, + options?: DeflateFunctionOptions, + ): Uint8Array + + /** + * The same as deflate, but create gzip wrapper instead of deflate one. + */ + function gzip( + data: Data | string, + options?: DeflateFunctionOptions, + ): Uint8Array + + class Deflate { + constructor(options?: DeflateOptions) + err: ReturnCodes + + msg: string + + result: Uint8Array + onData(chunk: Data): void + onEnd(status: number): void + push(data: Data | string, mode?: FlushValues | boolean): boolean + } +} diff --git a/.yalc/@ensdomains/ensjs/src/ABIs/Multicall.json b/.yalc/@ensdomains/ensjs/src/ABIs/Multicall.json new file mode 100644 index 000000000..c0bfd1220 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/ABIs/Multicall.json @@ -0,0 +1,452 @@ +{ + "abi": [ + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct Multicall3.Call[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "aggregate", + "outputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + }, + { + "internalType": "bytes[]", + "name": "returnData", + "type": "bytes[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowFailure", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct Multicall3.Call3[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "aggregate3", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct Multicall3.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowFailure", + "type": "bool" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct Multicall3.Call3Value[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "aggregate3Value", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct Multicall3.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct Multicall3.Call[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "blockAndAggregate", + "outputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct Multicall3.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "getBasefee", + "outputs": [ + { + "internalType": "uint256", + "name": "basefee", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "name": "getBlockHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getBlockNumber", + "outputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getChainId", + "outputs": [ + { + "internalType": "uint256", + "name": "chainid", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentBlockCoinbase", + "outputs": [ + { + "internalType": "address", + "name": "coinbase", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentBlockDifficulty", + "outputs": [ + { + "internalType": "uint256", + "name": "difficulty", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentBlockGasLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "gaslimit", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCurrentBlockTimestamp", + "outputs": [ + { + "internalType": "uint256", + "name": "timestamp", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "getEthBalance", + "outputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getLastBlockHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "requireSuccess", + "type": "bool" + }, + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct Multicall3.Call[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "tryAggregate", + "outputs": [ + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct Multicall3.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bool", + "name": "requireSuccess", + "type": "bool" + }, + { + "components": [ + { + "internalType": "address", + "name": "target", + "type": "address" + }, + { + "internalType": "bytes", + "name": "callData", + "type": "bytes" + } + ], + "internalType": "struct Multicall3.Call[]", + "name": "calls", + "type": "tuple[]" + } + ], + "name": "tryBlockAndAggregate", + "outputs": [ + { + "internalType": "uint256", + "name": "blockNumber", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "blockHash", + "type": "bytes32" + }, + { + "components": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "internalType": "struct Multicall3.Result[]", + "name": "returnData", + "type": "tuple[]" + } + ], + "stateMutability": "payable", + "type": "function" + } + ], + "bytecode": { + "object": "0x608060405234801561001057600080fd5b50610ee0806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e1461025a578063bce38bd714610275578063c3077fa914610288578063ee82ac5e1461029b57600080fd5b80634d2301cc146101ec57806372425d9d1461022157806382ad56cb1461023457806386d516e81461024757600080fd5b80633408e470116100c65780633408e47014610191578063399542e9146101a45780633e64a696146101c657806342cbb15c146101d957600080fd5b80630f28c97d146100f8578063174dea711461011a578063252dba421461013a57806327e86d6e1461015b575b600080fd5b34801561010457600080fd5b50425b6040519081526020015b60405180910390f35b61012d610128366004610a85565b6102ba565b6040516101119190610bbe565b61014d610148366004610a85565b6104ef565b604051610111929190610bd8565b34801561016757600080fd5b50437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0140610107565b34801561019d57600080fd5b5046610107565b6101b76101b2366004610c60565b610690565b60405161011193929190610cba565b3480156101d257600080fd5b5048610107565b3480156101e557600080fd5b5043610107565b3480156101f857600080fd5b50610107610207366004610ce2565b73ffffffffffffffffffffffffffffffffffffffff163190565b34801561022d57600080fd5b5044610107565b61012d610242366004610a85565b6106ab565b34801561025357600080fd5b5045610107565b34801561026657600080fd5b50604051418152602001610111565b61012d610283366004610c60565b61085a565b6101b7610296366004610a85565b610a1a565b3480156102a757600080fd5b506101076102b6366004610d18565b4090565b60606000828067ffffffffffffffff8111156102d8576102d8610d31565b60405190808252806020026020018201604052801561031e57816020015b6040805180820190915260008152606060208201528152602001906001900390816102f65790505b5092503660005b8281101561047757600085828151811061034157610341610d60565b6020026020010151905087878381811061035d5761035d610d60565b905060200281019061036f9190610d8f565b6040810135958601959093506103886020850185610ce2565b73ffffffffffffffffffffffffffffffffffffffff16816103ac6060870187610dcd565b6040516103ba929190610e32565b60006040518083038185875af1925050503d80600081146103f7576040519150601f19603f3d011682016040523d82523d6000602084013e6103fc565b606091505b50602080850191909152901515808452908501351761046d577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b5050600101610325565b508234146104e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4d756c746963616c6c333a2076616c7565206d69736d6174636800000000000060448201526064015b60405180910390fd5b50505092915050565b436060828067ffffffffffffffff81111561050c5761050c610d31565b60405190808252806020026020018201604052801561053f57816020015b606081526020019060019003908161052a5790505b5091503660005b8281101561068657600087878381811061056257610562610d60565b90506020028101906105749190610e42565b92506105836020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff166105a66020850185610dcd565b6040516105b4929190610e32565b6000604051808303816000865af19150503d80600081146105f1576040519150601f19603f3d011682016040523d82523d6000602084013e6105f6565b606091505b5086848151811061060957610609610d60565b602090810291909101015290508061067d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b50600101610546565b5050509250929050565b43804060606106a086868661085a565b905093509350939050565b6060818067ffffffffffffffff8111156106c7576106c7610d31565b60405190808252806020026020018201604052801561070d57816020015b6040805180820190915260008152606060208201528152602001906001900390816106e55790505b5091503660005b828110156104e657600084828151811061073057610730610d60565b6020026020010151905086868381811061074c5761074c610d60565b905060200281019061075e9190610e76565b925061076d6020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff166107906040850185610dcd565b60405161079e929190610e32565b6000604051808303816000865af19150503d80600081146107db576040519150601f19603f3d011682016040523d82523d6000602084013e6107e0565b606091505b506020808401919091529015158083529084013517610851577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b50600101610714565b6060818067ffffffffffffffff81111561087657610876610d31565b6040519080825280602002602001820160405280156108bc57816020015b6040805180820190915260008152606060208201528152602001906001900390816108945790505b5091503660005b82811015610a105760008482815181106108df576108df610d60565b602002602001015190508686838181106108fb576108fb610d60565b905060200281019061090d9190610e42565b925061091c6020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff1661093f6020850185610dcd565b60405161094d929190610e32565b6000604051808303816000865af19150503d806000811461098a576040519150601f19603f3d011682016040523d82523d6000602084013e61098f565b606091505b506020830152151581528715610a07578051610a07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b506001016108c3565b5050509392505050565b6000806060610a2b60018686610690565b919790965090945092505050565b60008083601f840112610a4b57600080fd5b50813567ffffffffffffffff811115610a6357600080fd5b6020830191508360208260051b8501011115610a7e57600080fd5b9250929050565b60008060208385031215610a9857600080fd5b823567ffffffffffffffff811115610aaf57600080fd5b610abb85828601610a39565b90969095509350505050565b6000815180845260005b81811015610aed57602081850181015186830182015201610ad1565b81811115610aff576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015610bb1578583037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001895281518051151584528401516040858501819052610b9d81860183610ac7565b9a86019a9450505090830190600101610b4f565b5090979650505050505050565b602081526000610bd16020830184610b32565b9392505050565b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b82811015610c52577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0888703018452610c40868351610ac7565b95509284019290840190600101610c06565b509398975050505050505050565b600080600060408486031215610c7557600080fd5b83358015158114610c8557600080fd5b9250602084013567ffffffffffffffff811115610ca157600080fd5b610cad86828701610a39565b9497909650939450505050565b838152826020820152606060408201526000610cd96060830184610b32565b95945050505050565b600060208284031215610cf457600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610bd157600080fd5b600060208284031215610d2a57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81833603018112610dc357600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112610e0257600080fd5b83018035915067ffffffffffffffff821115610e1d57600080fd5b602001915036819003821315610a7e57600080fd5b8183823760009101908152919050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112610dc357600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112610dc357600080fdfea264697066735822122032840c46a1df3756b0617d292f07888692735eef24ff69bf4fe353d639a3b9fa64736f6c634300080c0033", + "sourceMap": "502:9107:5:-:0;;;;;;;;;;;;;;;;;;;", + "linkReferences": {} + }, + "deployedBytecode": { + "object": "0x6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e1461025a578063bce38bd714610275578063c3077fa914610288578063ee82ac5e1461029b57600080fd5b80634d2301cc146101ec57806372425d9d1461022157806382ad56cb1461023457806386d516e81461024757600080fd5b80633408e470116100c65780633408e47014610191578063399542e9146101a45780633e64a696146101c657806342cbb15c146101d957600080fd5b80630f28c97d146100f8578063174dea711461011a578063252dba421461013a57806327e86d6e1461015b575b600080fd5b34801561010457600080fd5b50425b6040519081526020015b60405180910390f35b61012d610128366004610a85565b6102ba565b6040516101119190610bbe565b61014d610148366004610a85565b6104ef565b604051610111929190610bd8565b34801561016757600080fd5b50437fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0140610107565b34801561019d57600080fd5b5046610107565b6101b76101b2366004610c60565b610690565b60405161011193929190610cba565b3480156101d257600080fd5b5048610107565b3480156101e557600080fd5b5043610107565b3480156101f857600080fd5b50610107610207366004610ce2565b73ffffffffffffffffffffffffffffffffffffffff163190565b34801561022d57600080fd5b5044610107565b61012d610242366004610a85565b6106ab565b34801561025357600080fd5b5045610107565b34801561026657600080fd5b50604051418152602001610111565b61012d610283366004610c60565b61085a565b6101b7610296366004610a85565b610a1a565b3480156102a757600080fd5b506101076102b6366004610d18565b4090565b60606000828067ffffffffffffffff8111156102d8576102d8610d31565b60405190808252806020026020018201604052801561031e57816020015b6040805180820190915260008152606060208201528152602001906001900390816102f65790505b5092503660005b8281101561047757600085828151811061034157610341610d60565b6020026020010151905087878381811061035d5761035d610d60565b905060200281019061036f9190610d8f565b6040810135958601959093506103886020850185610ce2565b73ffffffffffffffffffffffffffffffffffffffff16816103ac6060870187610dcd565b6040516103ba929190610e32565b60006040518083038185875af1925050503d80600081146103f7576040519150601f19603f3d011682016040523d82523d6000602084013e6103fc565b606091505b50602080850191909152901515808452908501351761046d577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b5050600101610325565b508234146104e6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f4d756c746963616c6c333a2076616c7565206d69736d6174636800000000000060448201526064015b60405180910390fd5b50505092915050565b436060828067ffffffffffffffff81111561050c5761050c610d31565b60405190808252806020026020018201604052801561053f57816020015b606081526020019060019003908161052a5790505b5091503660005b8281101561068657600087878381811061056257610562610d60565b90506020028101906105749190610e42565b92506105836020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff166105a66020850185610dcd565b6040516105b4929190610e32565b6000604051808303816000865af19150503d80600081146105f1576040519150601f19603f3d011682016040523d82523d6000602084013e6105f6565b606091505b5086848151811061060957610609610d60565b602090810291909101015290508061067d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b50600101610546565b5050509250929050565b43804060606106a086868661085a565b905093509350939050565b6060818067ffffffffffffffff8111156106c7576106c7610d31565b60405190808252806020026020018201604052801561070d57816020015b6040805180820190915260008152606060208201528152602001906001900390816106e55790505b5091503660005b828110156104e657600084828151811061073057610730610d60565b6020026020010151905086868381811061074c5761074c610d60565b905060200281019061075e9190610e76565b925061076d6020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff166107906040850185610dcd565b60405161079e929190610e32565b6000604051808303816000865af19150503d80600081146107db576040519150601f19603f3d011682016040523d82523d6000602084013e6107e0565b606091505b506020808401919091529015158083529084013517610851577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b50600101610714565b6060818067ffffffffffffffff81111561087657610876610d31565b6040519080825280602002602001820160405280156108bc57816020015b6040805180820190915260008152606060208201528152602001906001900390816108945790505b5091503660005b82811015610a105760008482815181106108df576108df610d60565b602002602001015190508686838181106108fb576108fb610d60565b905060200281019061090d9190610e42565b925061091c6020840184610ce2565b73ffffffffffffffffffffffffffffffffffffffff1661093f6020850185610dcd565b60405161094d929190610e32565b6000604051808303816000865af19150503d806000811461098a576040519150601f19603f3d011682016040523d82523d6000602084013e61098f565b606091505b506020830152151581528715610a07578051610a07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060448201526064016104dd565b506001016108c3565b5050509392505050565b6000806060610a2b60018686610690565b919790965090945092505050565b60008083601f840112610a4b57600080fd5b50813567ffffffffffffffff811115610a6357600080fd5b6020830191508360208260051b8501011115610a7e57600080fd5b9250929050565b60008060208385031215610a9857600080fd5b823567ffffffffffffffff811115610aaf57600080fd5b610abb85828601610a39565b90969095509350505050565b6000815180845260005b81811015610aed57602081850181015186830182015201610ad1565b81811115610aff576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b600082825180855260208086019550808260051b84010181860160005b84811015610bb1578583037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001895281518051151584528401516040858501819052610b9d81860183610ac7565b9a86019a9450505090830190600101610b4f565b5090979650505050505050565b602081526000610bd16020830184610b32565b9392505050565b600060408201848352602060408185015281855180845260608601915060608160051b870101935082870160005b82811015610c52577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa0888703018452610c40868351610ac7565b95509284019290840190600101610c06565b509398975050505050505050565b600080600060408486031215610c7557600080fd5b83358015158114610c8557600080fd5b9250602084013567ffffffffffffffff811115610ca157600080fd5b610cad86828701610a39565b9497909650939450505050565b838152826020820152606060408201526000610cd96060830184610b32565b95945050505050565b600060208284031215610cf457600080fd5b813573ffffffffffffffffffffffffffffffffffffffff81168114610bd157600080fd5b600060208284031215610d2a57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81833603018112610dc357600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112610e0257600080fd5b83018035915067ffffffffffffffff821115610e1d57600080fd5b602001915036819003821315610a7e57600080fd5b8183823760009101908152919050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112610dc357600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1833603018112610dc357600080fdfea264697066735822122032840c46a1df3756b0617d292f07888692735eef24ff69bf4fe353d639a3b9fa64736f6c634300080c0033", + "sourceMap": "502:9107:5:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8696:120;;;;;;;;;;-1:-1:-1;8794:15:5;8696:120;;;160:25:12;;;148:2;133:18;8696:120:5;;;;;;;;5771:1961;;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;1166:534::-;;;;;;:::i;:::-;;:::i;:::-;;;;;;;;:::i;9060:158::-;;;;;;;;;;-1:-1:-1;9184:12:5;:16;;9174:27;9060:158;;9507:100;;;;;;;;;;-1:-1:-1;9587:13:5;9507:100;;2932:312;;;;;;:::i;:::-;;:::i;:::-;;;;;;;;;:::i;9364:100::-;;;;;;;;;;-1:-1:-1;9444:13:5;9364:100;;8029:111;;;;;;;;;;-1:-1:-1;8121:12:5;8029:111;;8883:114;;;;;;;;;;-1:-1:-1;8883:114:5;;;;;:::i;:::-;8978:12;;;;8883:114;8356:124;;;;;;;;;;-1:-1:-1;8457:16:5;8356:124;;4039:1494;;;;;;:::i;:::-;;:::i;8530:116::-;;;;;;;;;;-1:-1:-1;8625:14:5;8530:116;;8189;;;;;;;;;;-1:-1:-1;8189:116:5;;8284:14;6463:74:12;;6451:2;6436:18;8189:116:5;6317:226:12;1985:565:5;;;;;;:::i;:::-;;:::i;3626:231::-;;;;;;:::i;:::-;;:::i;7848:134::-;;;;;;;;;;-1:-1:-1;7848:134:5;;;;;:::i;:::-;7953:22;;7848:134;5771:1961;5849:26;5887:22;5936:5;;5971:20;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;;;;;;5971:20:5;;;;;;;;;;;;;;;;5958:33;;6001:25;6041:9;6036:1545;6060:6;6056:1;:10;6036:1545;;;6083:20;6106:10;6117:1;6106:13;;;;;;;;:::i;:::-;;;;;;;6083:36;;6141:5;;6147:1;6141:8;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;6177:11;;;;6389:21;;;;6133:16;;-1:-1:-1;6464:12:5;;;;6133:16;6464:12;:::i;:::-;:17;;6489:3;6494:14;;;;:5;:14;:::i;:::-;6464:45;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;6443:17:5;;;;6426:83;;;;;;;;;;6746:16;;;6733:30;6730:49;6720:806;;6914:66;6908:4;6901:80;7054:66;7048:4;7041:80;7206:66;7200:4;7193:80;7402:66;7396:4;7389:80;7503:4;7497;7490:18;6720:806;-1:-1:-1;;7565:3:5;;6036:1545;;;;7680:14;7667:9;:27;7659:66;;;;;;;8565:2:12;7659:66:5;;;8547:21:12;8604:2;8584:18;;;8577:30;8643:28;8623:18;;;8616:56;8689:18;;7659:66:5;;;;;;;;;5877:1855;;;5771:1961;;;;:::o;1166:534::-;1304:12;1253:25;1343:5;;1378:19;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1365:32;;1407:18;1440:9;1435:259;1459:6;1455:1;:10;1435:259;;;1482:12;1515:5;;1521:1;1515:8;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;1508:15;-1:-1:-1;1564:11:5;;;;1508:15;1564:11;:::i;:::-;:16;;1581:13;;;;:4;:13;:::i;:::-;1564:31;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1547:10;1558:1;1547:13;;;;;;;;:::i;:::-;;;;;;;;;;1537:58;;-1:-1:-1;1537:58:5;1609:43;;;;;;;9305:2:12;1609:43:5;;;9287:21:12;9344:2;9324:18;;;9317:30;9383:25;9363:18;;;9356:53;9426:18;;1609:43:5;9103:347:12;1609:43:5;-1:-1:-1;1678:3:5;;1435:259;;;;1280:420;;1166:534;;;;;:::o;2932:312::-;3122:12;3156:23;;3070:26;3202:35;3215:14;3231:5;;3202:12;:35::i;:::-;3189:48;;2932:312;;;;;;;:::o;4039:1494::-;4107:26;4162:5;;4197:20;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;;;;;;4197:20:5;;;;;;;;;;;;;;;;4184:33;;4227:20;4262:9;4257:1270;4281:6;4277:1;:10;4257:1270;;;4304:20;4327:10;4338:1;4327:13;;;;;;;;:::i;:::-;;;;;;;4304:36;;4362:5;;4368:1;4362:8;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;4354:16;-1:-1:-1;4422:12:5;;;;4354:16;4422:12;:::i;:::-;:17;;4440:14;;;;:5;:14;:::i;:::-;4422:33;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;4401:17:5;;;;4384:71;;;;;;;;;;4692:16;;;4679:30;4676:49;4666:806;;4860:66;4854:4;4847:80;5000:66;4994:4;4987:80;5152:66;5146:4;5139:80;5348:66;5342:4;5335:80;5449:4;5443;5436:18;4666:806;-1:-1:-1;5511:3:5;;4257:1270;;1985:565;2075:26;2130:5;;2165:20;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;;;;;;;2165:20:5;;;;;;;;;;;;;;;;2152:33;;2195:18;2228:9;2223:321;2247:6;2243:1;:10;2223:321;;;2270:20;2293:10;2304:1;2293:13;;;;;;;;:::i;:::-;;;;;;;2270:36;;2327:5;;2333:1;2327:8;;;;;;;:::i;:::-;;;;;;;;;;;;:::i;:::-;2320:15;-1:-1:-1;2387:11:5;;;;2320:15;2387:11;:::i;:::-;:16;;2404:13;;;;:4;:13;:::i;:::-;2387:31;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2366:17:5;;;2349:69;;;;;2432:70;;;;2460:14;;2452:50;;;;;;;9305:2:12;2452:50:5;;;9287:21:12;9344:2;9324:18;;;9317:30;9383:25;9363:18;;;9356:53;9426:18;;2452:50:5;9103:347:12;2452:50:5;-1:-1:-1;2528:3:5;;2223:321;;;;2103:447;;1985:565;;;;;:::o;3626:231::-;3700:19;3721:17;3740:26;3817:33;3838:4;3844:5;;3817:20;:33::i;:::-;3778:72;;;;-1:-1:-1;3778:72:5;;-1:-1:-1;3626:231:5;-1:-1:-1;;;3626:231:5:o;196:386:12:-;278:8;288:6;342:3;335:4;327:6;323:17;319:27;309:55;;360:1;357;350:12;309:55;-1:-1:-1;383:20:12;;426:18;415:30;;412:50;;;458:1;455;448:12;412:50;495:4;487:6;483:17;471:29;;555:3;548:4;538:6;535:1;531:14;523:6;519:27;515:38;512:47;509:67;;;572:1;569;562:12;509:67;196:386;;;;;:::o;587:486::-;703:6;711;764:2;752:9;743:7;739:23;735:32;732:52;;;780:1;777;770:12;732:52;820:9;807:23;853:18;845:6;842:30;839:50;;;885:1;882;875:12;839:50;924:89;1005:7;996:6;985:9;981:22;924:89;:::i;:::-;1032:8;;898:115;;-1:-1:-1;587:486:12;-1:-1:-1;;;;587:486:12:o;1078:530::-;1119:3;1157:5;1151:12;1184:6;1179:3;1172:19;1209:1;1219:162;1233:6;1230:1;1227:13;1219:162;;;1295:4;1351:13;;;1347:22;;1341:29;1323:11;;;1319:20;;1312:59;1248:12;1219:162;;;1399:6;1396:1;1393:13;1390:87;;;1465:1;1458:4;1449:6;1444:3;1440:16;1436:27;1429:38;1390:87;-1:-1:-1;1522:2:12;1510:15;1527:66;1506:88;1497:98;;;;1597:4;1493:109;;1078:530;-1:-1:-1;;1078:530:12:o;1613:869::-;1672:3;1703;1735:5;1729:12;1762:6;1757:3;1750:19;1788:4;1817:2;1812:3;1808:12;1801:19;;1873:2;1863:6;1860:1;1856:14;1849:5;1845:26;1841:35;1910:2;1903:5;1899:14;1931:1;1941:515;1955:6;1952:1;1949:13;1941:515;;;2020:16;;;2038:66;2016:89;2004:102;;2129:13;;2209:9;;2202:17;2195:25;2182:39;;2260:11;;2254:18;2165:4;2292:13;;;2285:25;;;2331:45;2362:13;;;2254:18;2331:45;:::i;:::-;2434:12;;;;2323:53;-1:-1:-1;;;2399:15:12;;;;1977:1;1970:9;1941:515;;;-1:-1:-1;2472:4:12;;1613:869;-1:-1:-1;;;;;;;1613:869:12:o;2487:315::-;2714:2;2703:9;2696:21;2677:4;2734:62;2792:2;2781:9;2777:18;2769:6;2734:62;:::i;:::-;2726:70;2487:315;-1:-1:-1;;;2487:315:12:o;3292:930::-;3480:4;3528:2;3517:9;3513:18;3558:6;3547:9;3540:25;3584:2;3622;3617;3606:9;3602:18;3595:30;3645:6;3680;3674:13;3711:6;3703;3696:22;3749:2;3738:9;3734:18;3727:25;;3811:2;3801:6;3798:1;3794:14;3783:9;3779:30;3775:39;3761:53;;3849:2;3841:6;3837:15;3870:1;3880:313;3894:6;3891:1;3888:13;3880:313;;;3983:66;3971:9;3963:6;3959:22;3955:95;3950:3;3943:108;4074:39;4106:6;4097;4091:13;4074:39;:::i;:::-;4064:49;-1:-1:-1;4171:12:12;;;;4136:15;;;;3916:1;3909:9;3880:313;;;-1:-1:-1;4210:6:12;;3292:930;-1:-1:-1;;;;;;;;3292:930:12:o;4409:641::-;4525:6;4533;4541;4594:2;4582:9;4573:7;4569:23;4565:32;4562:52;;;4610:1;4607;4600:12;4562:52;4649:9;4636:23;4702:5;4695:13;4688:21;4681:5;4678:32;4668:60;;4724:1;4721;4714:12;4668:60;4747:5;-1:-1:-1;4803:2:12;4788:18;;4775:32;4830:18;4819:30;;4816:50;;;4862:1;4859;4852:12;4816:50;4901:89;4982:7;4973:6;4962:9;4958:22;4901:89;:::i;:::-;4409:641;;5009:8;;-1:-1:-1;4875:115:12;;-1:-1:-1;;;;4409:641:12:o;5055:457::-;5338:6;5327:9;5320:25;5381:6;5376:2;5365:9;5361:18;5354:34;5424:2;5419;5408:9;5404:18;5397:30;5301:4;5444:62;5502:2;5491:9;5487:18;5479:6;5444:62;:::i;:::-;5436:70;5055:457;-1:-1:-1;;;;;5055:457:12:o;5517:309::-;5576:6;5629:2;5617:9;5608:7;5604:23;5600:32;5597:52;;;5645:1;5642;5635:12;5597:52;5684:9;5671:23;5734:42;5727:5;5723:54;5716:5;5713:65;5703:93;;5792:1;5789;5782:12;6548:180;6607:6;6660:2;6648:9;6639:7;6635:23;6631:32;6628:52;;;6676:1;6673;6666:12;6628:52;-1:-1:-1;6699:23:12;;6548:180;-1:-1:-1;6548:180:12:o;6733:184::-;6785:77;6782:1;6775:88;6882:4;6879:1;6872:15;6906:4;6903:1;6896:15;6922:184;6974:77;6971:1;6964:88;7071:4;7068:1;7061:15;7095:4;7092:1;7085:15;7111:386;7207:4;7265:11;7252:25;7355:66;7344:8;7328:14;7324:29;7320:102;7300:18;7296:127;7286:155;;7437:1;7434;7427:12;7286:155;7458:33;;;;;7111:386;-1:-1:-1;;7111:386:12:o;7502:580::-;7579:4;7585:6;7645:11;7632:25;7735:66;7724:8;7708:14;7704:29;7700:102;7680:18;7676:127;7666:155;;7817:1;7814;7807:12;7666:155;7844:33;;7896:20;;;-1:-1:-1;7939:18:12;7928:30;;7925:50;;;7971:1;7968;7961:12;7925:50;8004:4;7992:17;;-1:-1:-1;8035:14:12;8031:27;;;8021:38;;8018:58;;;8072:1;8069;8062:12;8087:271;8270:6;8262;8257:3;8244:33;8226:3;8296:16;;8321:13;;;8296:16;8087:271;-1:-1:-1;8087:271:12:o;8718:380::-;8808:4;8866:11;8853:25;8956:66;8945:8;8929:14;8925:29;8921:102;8901:18;8897:127;8887:155;;9038:1;9035;9028:12;9455:381;9546:4;9604:11;9591:25;9694:66;9683:8;9667:14;9663:29;9659:102;9639:18;9635:127;9625:155;;9776:1;9773;9766:12", + "linkReferences": {} + } +} \ No newline at end of file diff --git a/.yalc/@ensdomains/ensjs/src/GqlManager.test.ts b/.yalc/@ensdomains/ensjs/src/GqlManager.test.ts new file mode 100644 index 000000000..9266c81c9 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/GqlManager.test.ts @@ -0,0 +1,173 @@ +import { parse, print, visit } from 'graphql' +import traverse from 'traverse' + +import { requestMiddleware, responseMiddleware } from './GqlManager' +import { namehash } from './utils/normalise' + +describe('GqlManager', () => { + const queryWithoutId = ` +query getNames($id: ID!, $expiryDate: Int) { + account(id: $id) { + registrations(first: 1000, where: { expiryDate_gt: $expiryDate }) { + registrationDate + expiryDate + domain { + labelName + labelhash + name + isMigrated + parent { + name + } + } + } + domains(first: 1000) { + labelName + labelhash + name + isMigrated + parent { + name + } + createdAt + } + } + } +` + + const mockRequest = { + method: 'POST', + headers: { + // eslint-disable-next-line @typescript-eslint/naming-convention + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ query: queryWithoutId }), + } + + const mockResponse = { + data: { + account: { + registrations: [ + { + registrationDate: '1659245504', + expiryDate: '1690781504', + domain: { + id: '0xb1ccf7f6bb648f39ba48bf80f4a8a4522f474ee7d1edd6ea65f7fa51fe8b1612', + labelName: 'randydandy', + labelhash: + '0x63fd5bfdd0b1eb9f4c33c209b7c3e7dcb87a761d926a65e267f7cb99ee313ddd', + name: '0xde2551f43e950a2a4d4e6052f25edc450c48a5338faa27f09d1ee99ca9dc04fd', + isMigrated: true, + parent: { + name: '0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae', + invalidName: true, + }, + invalidName: true, + }, + }, + { + registrationDate: '1635284756', + expiryDate: '1666841708', + domain: { + id: '0xde2551f43e950a2a4d4e6052f25edc450c48a5338faa27f09d1ee99ca9dc04fd', + labelName: 'randydandy', + labelhash: + '0x6a877a8d92ad83c8d044d0c5b69aa0da3050f4d653dcc149fca952d6439e4105', + name: 'randydandy.eth', + isMigrated: true, + parent: { + name: '0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae', + invalidName: true, + }, + }, + }, + { + registrationDate: '1659250465', + expiryDate: '1690786465', + domain: { + id: '0xaf119e72f050e5acad6b2d97826a7afb45afe9407376a2ab8240b62173b2d7c2', + labelName: 'nullbyte', + labelhash: + '0xc8985f8323b3dc707003a6ef5b379d9e8a058b6d6bcc2cfb307c61ca36920e27', + name: '0xb54c7c79c89d571f1fbf4c67f524e336a04441eeee4d76f156e835da99a46ddb', + isMigrated: true, + parent: { + name: '0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae', + invalidName: true, + }, + invalidName: true, + }, + }, + ], + domains: [ + { + id: '0xaf119e72f050e5acad6b2d97826a7afb45afe9407376a2ab8240b62173b2d7c2', + labelName: 'nullbyte', + labelhash: + '0xc8985f8323b3dc707003a6ef5b379d9e8a058b6d6bcc2cfb307c61ca36920e27', + name: '0xb54c7c79c89d571f1fbf4c67f524e336a04441eeee4d76f156e835da99a46ddb', + isMigrated: true, + parent: { + name: '0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae', + invalidName: true, + }, + createdAt: '1659250465', + invalidName: true, + }, + { + id: '0xb1ccf7f6bb648f39ba48bf80f4a8a4522f474ee7d1edd6ea65f7fa51fe8b1612', + labelName: 'randydandy', + labelhash: + '0x63fd5bfdd0b1eb9f4c33c209b7c3e7dcb87a761d926a65e267f7cb99ee313ddd', + name: '0xde2551f43e950a2a4d4e6052f25edc450c48a5338faa27f09d1ee99ca9dc04fd', + isMigrated: true, + parent: { + name: '0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae', + invalidName: true, + }, + createdAt: '1659245504', + invalidName: true, + }, + { + id: '0xde2551f43e950a2a4d4e6052f25edc450c48a5338faa27f09d1ee99ca9dc04fd', + labelName: 'randydandy', + labelhash: + '0x6a877a8d92ad83c8d044d0c5b69aa0da3050f4d653dcc149fca952d6439e4105', + name: 'randydandy.eth', + isMigrated: true, + parent: { + name: '0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae', + invalidName: true, + }, + createdAt: '1635284756', + }, + ], + }, + }, + headers: { + map: { + // eslint-disable-next-line @typescript-eslint/naming-convention + 'Content-Type': 'application/json', + }, + }, + status: 200, + } + + describe('requestMiddleware', () => { + it('should add id to a SelectionSet if name is present and id is not', () => { + const result = requestMiddleware(visit, parse, print)(mockRequest) + const body = result.body as string + expect(body.match(/domain.*id.*id.*domains.*id.*id/)?.length).toBe(1) + }) + }) + describe('responseMiddleware', () => { + it('should replace name with the namehash when there is an invalid name and id combo', () => { + const result = responseMiddleware(traverse)(mockResponse) + expect(result.data.account.domains[0].name).toBe( + namehash( + '0xb54c7c79c89d571f1fbf4c67f524e336a04441eeee4d76f156e835da99a46ddb', + ), + ) + }) + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/GqlManager.ts b/.yalc/@ensdomains/ensjs/src/GqlManager.ts new file mode 100644 index 000000000..a8a4607e9 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/GqlManager.ts @@ -0,0 +1,114 @@ +import type { + Kind, + parse as Parse, + print as Print, + SelectionSetNode, + visit as Visit, +} from 'graphql' +import type { gql, GraphQLClient } from 'graphql-request' +import type Traverse from 'traverse' +import { namehash } from './utils/normalise' + +const generateSelection = (selection: any) => ({ + kind: 'Field' as Kind.FIELD, + name: { + kind: 'Name' as Kind.NAME, + value: selection, + }, + arguments: [], + directives: [], + alias: undefined, + selectionSet: undefined, +}) + +export const enter = (node: SelectionSetNode) => { + let hasName = false + let hasId = false + + for (const selection of node.selections) { + if ('name' in selection) { + if (selection.name.value === 'name') hasName = true + else if (selection.name.value === 'id') hasId = true + } + } + + if (hasName && !hasId) { + // eslint-disable-next-line no-param-reassign + node.selections = [...node.selections, generateSelection('id')] + return node + } +} + +export const requestMiddleware = + (visit: typeof Visit, parse: typeof Parse, print: typeof Print) => + (request: any) => { + const requestBody = JSON.parse(request.body) + const rawQuery = requestBody.query + const parsedQuery = parse(rawQuery) + const updatedQuery = visit(parsedQuery, { + // eslint-disable-next-line @typescript-eslint/naming-convention + SelectionSet: { + enter, + }, + }) + + return { + ...request, + body: JSON.stringify({ ...requestBody, query: print(updatedQuery) }), + } + } + +export const responseMiddleware = + (traverse: typeof Traverse) => (response: any) => { + // eslint-disable-next-line func-names + traverse(response).forEach(function (responseItem: any) { + if (responseItem instanceof Object && responseItem.name) { + // Name already in hashed form + if (responseItem.name && responseItem.name.includes('[')) { + return + } + + const hashedName = namehash(responseItem.name) + if (responseItem.id !== hashedName) { + this.update({ ...responseItem, name: hashedName, invalidName: true }) + } + } + }) + return response + } + +export default class GqlManager { + // eslint-disable-next-line class-methods-use-this + public gql: typeof gql | ((query: TemplateStringsArray) => string) = ( + query: TemplateStringsArray, + ) => query.join() + + public client: + | GraphQLClient + | { + request: () => Promise + } = { + request: () => Promise.resolve(null), + } + + public setUrl = async (url: string | null) => { + if (url) { + const [imported, traverse, { visit, parse, print }] = await Promise.all([ + import('graphql-request'), + import('traverse'), + import('graphql/language'), + ]) + + this.client = new imported.GraphQLClient(url, { + requestMiddleware: requestMiddleware(visit, parse, print), + responseMiddleware: responseMiddleware(traverse.default), + }) + this.gql = imported.gql + } else { + this.client = { + request: () => Promise.resolve(null), + } + this.gql = (query: TemplateStringsArray) => query.join() + } + } +} diff --git a/.yalc/@ensdomains/ensjs/src/contracts/baseRegistrar.ts b/.yalc/@ensdomains/ensjs/src/contracts/baseRegistrar.ts new file mode 100644 index 000000000..8652760f2 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/contracts/baseRegistrar.ts @@ -0,0 +1,5 @@ +import type { JsonRpcProvider } from '@ethersproject/providers' +import { BaseRegistrarImplementation__factory } from '../generated/factories/BaseRegistrarImplementation__factory' + +export default (provider: JsonRpcProvider, address: string) => + BaseRegistrarImplementation__factory.connect(address, provider) diff --git a/.yalc/@ensdomains/ensjs/src/contracts/bulkRenewal.ts b/.yalc/@ensdomains/ensjs/src/contracts/bulkRenewal.ts new file mode 100644 index 000000000..543ac572b --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/contracts/bulkRenewal.ts @@ -0,0 +1,6 @@ +import type { JsonRpcProvider } from '@ethersproject/providers' +import { BulkRenewal__factory } from '../generated/factories/BulkRenewal__factory' + +// Use a higher-order function to override the address that is passed in from getContractAddress() +export default (provider: JsonRpcProvider, address: string) => + BulkRenewal__factory.connect(address, provider) diff --git a/.yalc/@ensdomains/ensjs/src/contracts/dnsRegistrar.ts b/.yalc/@ensdomains/ensjs/src/contracts/dnsRegistrar.ts new file mode 100644 index 000000000..9a23184e9 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/contracts/dnsRegistrar.ts @@ -0,0 +1,5 @@ +import type { JsonRpcProvider } from '@ethersproject/providers' +import { DNSRegistrar__factory } from '../generated/factories/DNSRegistrar__factory' + +export default (provider: JsonRpcProvider, address: string) => + DNSRegistrar__factory.connect(address, provider) diff --git a/.yalc/@ensdomains/ensjs/src/contracts/ethRegistrarController.ts b/.yalc/@ensdomains/ensjs/src/contracts/ethRegistrarController.ts new file mode 100644 index 000000000..52af35a34 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/contracts/ethRegistrarController.ts @@ -0,0 +1,5 @@ +import type { JsonRpcProvider } from '@ethersproject/providers' +import { ETHRegistrarController__factory } from '../generated/factories/ETHRegistrarController__factory' + +export default (provider: JsonRpcProvider, address: string) => + ETHRegistrarController__factory.connect(address, provider) diff --git a/.yalc/@ensdomains/ensjs/src/contracts/factories.ts b/.yalc/@ensdomains/ensjs/src/contracts/factories.ts new file mode 100644 index 000000000..1977c3ec9 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/contracts/factories.ts @@ -0,0 +1,48 @@ +/* eslint-disable @typescript-eslint/naming-convention */ +import type { BaseRegistrarImplementation__factory } from '../generated/factories/BaseRegistrarImplementation__factory' +import type { BulkRenewal__factory } from '../generated/factories/BulkRenewal__factory' +import type { DefaultReverseResolver__factory } from '../generated/factories/DefaultReverseResolver__factory' +import type { DNSRegistrar__factory } from '../generated/factories/DNSRegistrar__factory' +import type { DNSSECImpl__factory } from '../generated/factories/DNSSECImpl__factory' +import type { ENSRegistry__factory } from '../generated/factories/ENSRegistry__factory' +import type { ETHRegistrarController__factory } from '../generated/factories/ETHRegistrarController__factory' +import type { Multicall__factory } from '../generated/factories/Multicall__factory' +import type { NameWrapper__factory } from '../generated/factories/NameWrapper__factory' +import type { P256SHA256Algorithm__factory } from '../generated/factories/P256SHA256Algorithm__factory' +import type { PublicResolver__factory } from '../generated/factories/PublicResolver__factory' +import type { ReverseRegistrar__factory } from '../generated/factories/ReverseRegistrar__factory' +import type { Root__factory } from '../generated/factories/Root__factory' +import type { RSASHA1Algorithm__factory } from '../generated/factories/RSASHA1Algorithm__factory' +import type { RSASHA256Algorithm__factory } from '../generated/factories/RSASHA256Algorithm__factory' +import type { SHA1Digest__factory } from '../generated/factories/SHA1Digest__factory' +import type { SHA1NSEC3Digest__factory } from '../generated/factories/SHA1NSEC3Digest__factory' +import type { SHA256Digest__factory } from '../generated/factories/SHA256Digest__factory' +import type { StaticMetadataService__factory } from '../generated/factories/StaticMetadataService__factory' +import type { TLDPublicSuffixList__factory } from '../generated/factories/TLDPublicSuffixList__factory' +import type { UniversalResolver__factory } from '../generated/factories/UniversalResolver__factory' + +type Factories = { + BaseRegistrarImplementation: BaseRegistrarImplementation__factory + DefaultReverseResolver: DefaultReverseResolver__factory + DNSRegistrar: DNSRegistrar__factory + DNSSECImpl: DNSSECImpl__factory + ENSRegistry: ENSRegistry__factory + ETHRegistrarController: ETHRegistrarController__factory + P256SHA256Algorithm: P256SHA256Algorithm__factory + PublicResolver: PublicResolver__factory + ReverseRegistrar: ReverseRegistrar__factory + Root: Root__factory + RSASHA1Algorithm: RSASHA1Algorithm__factory + RSASHA256Algorithm: RSASHA256Algorithm__factory + SHA1Digest: SHA1Digest__factory + SHA1NSEC3Digest: SHA1NSEC3Digest__factory + SHA256Digest: SHA256Digest__factory + TLDPublicSuffixList: TLDPublicSuffixList__factory + Multicall: Multicall__factory + NameWrapper: NameWrapper__factory + StaticMetadataService: StaticMetadataService__factory + UniversalResolver: UniversalResolver__factory + BulkRenewal: BulkRenewal__factory +} + +export default Factories diff --git a/.yalc/@ensdomains/ensjs/src/contracts/getContractAddress.ts b/.yalc/@ensdomains/ensjs/src/contracts/getContractAddress.ts new file mode 100644 index 000000000..8acb2525d --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/contracts/getContractAddress.ts @@ -0,0 +1,75 @@ +import { ContractName, SupportedNetworkId } from './types' + +const addresses: Record< + ContractName, + Partial> | string +> = { + /* eslint-disable @typescript-eslint/naming-convention */ + BaseRegistrarImplementation: { + '1': '0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85', + '3': '0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85', + '4': '0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85', + '5': '0x57f1887a8bf19b14fc0df6fd9b2acc9af147ea85', + }, + DNSRegistrar: { + '1': '0x58774Bb8acD458A640aF0B88238369A167546ef2', + '3': '0xdB328BA5FEcb432AF325Ca59E3778441eF5aa14F', + '5': '0x8edc487D26F6c8Fa76e032066A3D4F87E273515d', + }, + ETHRegistrarController: { + '1': '0x283af0b28c62c092c9727f1ee09c02ca627eb7f5', + '3': '0xa5627AB7Ae47063B533622C34FEBDb52d3281dF8', + '4': '0x283af0b28c62c092c9727f1ee09c02ca627eb7f5', + '5': '0xb7A1f9e633fdeaAa2ec44bE00a61a7Db9a733D70', + }, + Multicall: '0xcA11bde05977b3631167028862bE2a173976CA11', + NameWrapper: { + '1': '0x0000000000000000000000000000000000000000', + '3': '0xF82155e2a43Be0871821E9654Fc8Ae894FB8307C', + '4': '0x0000000000000000000000000000000000000000', + '5': '0xEe1F756aCde7E81B2D8cC6aB3c8A1E2cE6db0F39', + }, + PublicResolver: { + '1': '0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41', + '3': '0x13F0659Ee6bb7484C884FEeFb7F75C93951ef837', + '5': '0x2800Ec5BAB9CE9226d19E0ad5BC607e3cfC4347E', + }, + ENSRegistry: { + '1': '0x00000000000c2e074ec69a0dfb2997ba6c7d2e1e', + '3': '0x00000000000c2e074ec69a0dfb2997ba6c7d2e1e', + '4': '0x00000000000c2e074ec69a0dfb2997ba6c7d2e1e', + '5': '0x00000000000c2e074ec69a0dfb2997ba6c7d2e1e', + }, + ReverseRegistrar: { + '1': '0x084b1c3C81545d370f3634392De611CaaBFf8148', + '3': '0x806246b52f8cB61655d3038c58D2f63Aa55d4edE', + '5': '0x9a879320A9F7ad2BBb02063d67baF5551D6BD8B0', + }, + UniversalResolver: { + '1': '0x74E20Bd2A1fE0cdbe45b9A1d89cb7e0a45b36376', + '3': '0x74e20bd2a1fe0cdbe45b9a1d89cb7e0a45b36376', + '4': '0x74e20bd2a1fe0cdbe45b9a1d89cb7e0a45b36376', + '5': '0x687c30Cc44bFA39A1449e86E172BF002E7b3f0b0', + }, + BulkRenewal: { + '1': '0xfF252725f6122A92551A5FA9a6b6bf10eb0Be035', + '3': '0x051b02245D826757EfaF5C6209D4D79FB39FBC45', + '5': '0xa9e1df95a79C768aA435805b28E1B54Bb5ead063', + }, + /* eslint-enable @typescript-eslint/naming-convention */ +} + +export type ContractAddressFetch = (contractName: ContractName) => string + +export const getContractAddress = (networkId: SupportedNetworkId) => + ((contractName: ContractName) => { + try { + return typeof addresses[contractName] === 'string' + ? addresses[contractName] + : addresses[contractName][networkId] + } catch { + throw new Error( + `No address for contract ${contractName} on network ${networkId}`, + ) + } + }) as ContractAddressFetch diff --git a/.yalc/@ensdomains/ensjs/src/contracts/index.ts b/.yalc/@ensdomains/ensjs/src/contracts/index.ts new file mode 100644 index 000000000..b951fbd4e --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/contracts/index.ts @@ -0,0 +1,92 @@ +import type { Interface } from '@ethersproject/abi' +import type { Signer } from '@ethersproject/abstract-signer' +import type { BaseContract } from '@ethersproject/contracts' +import type { Provider } from '@ethersproject/providers' +import type { BaseRegistrarImplementation } from '../generated/BaseRegistrarImplementation' +import type { BulkRenewal } from '../generated/BulkRenewal' +import type { DNSRegistrar } from '../generated/DNSRegistrar' +import type { ENSRegistry } from '../generated/ENSRegistry' +import type { ETHRegistrarController } from '../generated/ETHRegistrarController' +import type { Multicall } from '../generated/Multicall' +import type { NameWrapper } from '../generated/NameWrapper' +import type { PublicResolver } from '../generated/PublicResolver' +import type { ReverseRegistrar } from '../generated/ReverseRegistrar' +import type { UniversalResolver } from '../generated/UniversalResolver' +import { ContractAddressFetch } from './getContractAddress' +import { ContractName } from './types' + +type BaseFactory = { + readonly abi: object + createInterface(): Interface + connect(address: string, signerOrProvider: Signer | Provider): BaseContract +} + +export default class ContractManager { + private provider: Provider + + private fetchAddress: ContractAddressFetch + + // eslint-disable-next-line class-methods-use-this + protected getModule = async (name: string) => { + const mod = await import( + /* webpackMode: "lazy", webpackChunkName: "[request]", webpackPreload: true, webpackExclude: /.*\.ts$/ */ + `../generated/factories/${name}__factory` + ) + return mod[`${name}__factory`] as BaseFactory + } + + constructor( + provider: Provider, + fetchAddress: ContractAddressFetch, + getModule?: (name: string) => Promise, + ) { + this.provider = provider + this.fetchAddress = fetchAddress + if (getModule) { + this.getModule = getModule + } + } + + private generateContractGetter = ( + name: ContractName, + ): ((passedProvider?: any, address?: string) => Promise) => { + return async (passedProvider, address) => { + const mod = await this.getModule(name) + const inputAddress = address || this.fetchAddress(name) + const provider = passedProvider || this.provider + return mod.connect(inputAddress, provider) as C + } + } + + public getPublicResolver = + this.generateContractGetter('PublicResolver') + + public getUniversalResolver = + this.generateContractGetter('UniversalResolver') + + public getRegistry = this.generateContractGetter('ENSRegistry') + + public getReverseRegistrar = + this.generateContractGetter('ReverseRegistrar') + + public getNameWrapper = + this.generateContractGetter('NameWrapper') + + public getDNSRegistrar = + this.generateContractGetter('DNSRegistrar') + + public getBaseRegistrar = + this.generateContractGetter( + 'BaseRegistrarImplementation', + ) + + public getEthRegistrarController = + this.generateContractGetter( + 'ETHRegistrarController', + ) + + public getMulticall = this.generateContractGetter('Multicall') + + public getBulkRenewal = + this.generateContractGetter('BulkRenewal') +} diff --git a/.yalc/@ensdomains/ensjs/src/contracts/multicall.ts b/.yalc/@ensdomains/ensjs/src/contracts/multicall.ts new file mode 100644 index 000000000..cb6f4b5a5 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/contracts/multicall.ts @@ -0,0 +1,5 @@ +import type { JsonRpcProvider } from '@ethersproject/providers' +import { Multicall__factory } from '../generated/factories/Multicall__factory' + +export default (provider: JsonRpcProvider, address: string) => + Multicall__factory.connect(address, provider) diff --git a/.yalc/@ensdomains/ensjs/src/contracts/nameWrapper.ts b/.yalc/@ensdomains/ensjs/src/contracts/nameWrapper.ts new file mode 100644 index 000000000..66f55aeff --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/contracts/nameWrapper.ts @@ -0,0 +1,5 @@ +import type { JsonRpcProvider } from '@ethersproject/providers' +import { NameWrapper__factory } from '../generated/factories/NameWrapper__factory' + +export default (provider: JsonRpcProvider, address: string) => + NameWrapper__factory.connect(address, provider) diff --git a/.yalc/@ensdomains/ensjs/src/contracts/publicResolver.ts b/.yalc/@ensdomains/ensjs/src/contracts/publicResolver.ts new file mode 100644 index 000000000..8eb2bce2e --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/contracts/publicResolver.ts @@ -0,0 +1,5 @@ +import type { JsonRpcProvider } from '@ethersproject/providers' +import { PublicResolver__factory } from '../generated/factories/PublicResolver__factory' + +export default (provider: JsonRpcProvider, address: string) => + PublicResolver__factory.connect(address, provider) diff --git a/.yalc/@ensdomains/ensjs/src/contracts/registry.ts b/.yalc/@ensdomains/ensjs/src/contracts/registry.ts new file mode 100644 index 000000000..d68b45179 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/contracts/registry.ts @@ -0,0 +1,5 @@ +import type { JsonRpcProvider } from '@ethersproject/providers' +import { ENSRegistry__factory } from '../generated/factories/ENSRegistry__factory' + +export default (provider: JsonRpcProvider, address: string) => + ENSRegistry__factory.connect(address, provider) diff --git a/.yalc/@ensdomains/ensjs/src/contracts/reverseRegistrar.ts b/.yalc/@ensdomains/ensjs/src/contracts/reverseRegistrar.ts new file mode 100644 index 000000000..4b57afab4 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/contracts/reverseRegistrar.ts @@ -0,0 +1,5 @@ +import type { JsonRpcProvider } from '@ethersproject/providers' +import { ReverseRegistrar__factory } from '../generated/factories/ReverseRegistrar__factory' + +export default (provider: JsonRpcProvider, address: string) => + ReverseRegistrar__factory.connect(address, provider) diff --git a/.yalc/@ensdomains/ensjs/src/contracts/types.ts b/.yalc/@ensdomains/ensjs/src/contracts/types.ts new file mode 100644 index 000000000..41e963435 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/contracts/types.ts @@ -0,0 +1,13 @@ +export type SupportedNetworkId = '1' | '3' | '4' | '5' | '1337' + +export type ContractName = + | 'BaseRegistrarImplementation' + | 'ETHRegistrarController' + | 'Multicall' + | 'NameWrapper' + | 'DNSRegistrar' + | 'PublicResolver' + | 'ENSRegistry' + | 'ReverseRegistrar' + | 'UniversalResolver' + | 'BulkRenewal' diff --git a/.yalc/@ensdomains/ensjs/src/contracts/universalResolver.ts b/.yalc/@ensdomains/ensjs/src/contracts/universalResolver.ts new file mode 100644 index 000000000..5f5687002 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/contracts/universalResolver.ts @@ -0,0 +1,5 @@ +import type { JsonRpcProvider } from '@ethersproject/providers' +import { UniversalResolver__factory } from '../generated/factories/UniversalResolver__factory' + +export default (provider: JsonRpcProvider, address: string) => + UniversalResolver__factory.connect(address, provider) diff --git a/.yalc/@ensdomains/ensjs/src/functions/batch.test.ts b/.yalc/@ensdomains/ensjs/src/functions/batch.test.ts new file mode 100644 index 000000000..c382bd533 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/batch.test.ts @@ -0,0 +1,36 @@ +import { ENS } from '..' +import setup from '../tests/setup' + +let ensInstance: ENS + +beforeAll(async () => { + ;({ ensInstance } = await setup()) +}) + +describe('batch', () => { + it('should batch calls together', async () => { + const result = await ensInstance.batch( + ensInstance.getText.batch('with-profile.eth', 'description'), + ensInstance.getAddr.batch('with-profile.eth'), + ensInstance.getName.batch('0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC'), + ) + expect(result).toBeTruthy() + if (result) { + expect(result[0]).toBe('Hello2') + expect(result[1]).toBe('0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC') + expect(result[2]).toMatchObject({ + name: 'with-profile.eth', + match: true, + }) + } + }) + it('should batch a single call', async () => { + const result = await ensInstance.batch( + ensInstance.getText.batch('with-profile.eth', 'description'), + ) + expect(result).toBeTruthy() + if (result) { + expect(result[0]).toBe('Hello2') + } + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/batch.ts b/.yalc/@ensdomains/ensjs/src/functions/batch.ts new file mode 100644 index 000000000..7042498f0 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/batch.ts @@ -0,0 +1,36 @@ +import { BatchFunctionResult, ENSArgs, RawFunction } from '..' + +const raw = async ( + { multicallWrapper }: ENSArgs<'multicallWrapper'>, + ...items: BatchFunctionResult[] +) => { + const rawDataArr: { to: string; data: string }[] = await Promise.all( + items.map(({ args, raw: rawRef }, i: number) => { + if (!rawRef) { + throw new Error(`Function ${i} is not batchable`) + } + return rawRef(...args) + }), + ) + return multicallWrapper.raw(rawDataArr) +} + +const decode = async ( + { multicallWrapper }: ENSArgs<'multicallWrapper'>, + data: string, + ...items: BatchFunctionResult[] +): Promise => { + const response = await multicallWrapper.decode(data) + if (!response) return + + return Promise.all( + response.map((ret: any, i: number) => + items[i].decode(ret.returnData, ...items[i].args), + ), + ) +} + +export default { + raw, + decode, +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/batchWrappers.test.ts b/.yalc/@ensdomains/ensjs/src/functions/batchWrappers.test.ts new file mode 100644 index 000000000..0c718eee0 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/batchWrappers.test.ts @@ -0,0 +1,31 @@ +import { ENS } from '..' +import setup from '../tests/setup' + +let ensInstance: ENS + +beforeAll(async () => { + ;({ ensInstance } = await setup()) +}) + +describe('batchWrappers', () => { + it('should batch calls together', async () => { + const batch = await ensInstance.resolverMulticallWrapper.raw([ + await ensInstance._getText.raw('with-profile.eth', 'description'), + await ensInstance._getText.raw('with-profile.eth', 'url'), + await ensInstance._getAddr.raw('with-profile.eth'), + ]) + const universalResponse = await ensInstance.universalWrapper( + 'with-profile.eth', + batch.data, + ) + const [batchDecoded] = await ensInstance.resolverMulticallWrapper.decode( + universalResponse?.data, + ) + const decoded1 = await ensInstance._getText.decode(batchDecoded[0]) + const decoded2 = await ensInstance._getText.decode(batchDecoded[1]) + const decoded3 = await ensInstance._getAddr.decode(batchDecoded[2]) + expect(decoded1).toBe('Hello2') + expect(decoded2).toBe('twitter.com') + expect(decoded3).toBe('0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC') + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/batchWrappers.ts b/.yalc/@ensdomains/ensjs/src/functions/batchWrappers.ts new file mode 100644 index 000000000..06b8302c5 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/batchWrappers.ts @@ -0,0 +1,122 @@ +import type { TransactionRequest } from '@ethersproject/providers' +import { ENSArgs } from '..' +import ccipLookup from '../utils/ccip' +import { hexEncodeName } from '../utils/hexEncodedName' + +export const universalWrapper = { + raw: async ( + { contracts }: ENSArgs<'contracts'>, + name: string, + data: string, + ) => { + const universalResolver = await contracts?.getUniversalResolver()! + return { + to: universalResolver.address, + data: universalResolver.interface.encodeFunctionData( + 'resolve(bytes,bytes)', + [hexEncodeName(name), data], + ), + } + }, + decode: async ({ contracts }: ENSArgs<'contracts'>, data: string) => { + const universalResolver = await contracts?.getUniversalResolver()! + const response = universalResolver.interface.decodeFunctionResult( + 'resolve(bytes,bytes)', + data, + ) + if (!response || !response[0]) { + return + } + return { data: response[0], resolver: response[1] } + }, +} + +export const resolverMulticallWrapper = { + raw: async ( + { contracts }: ENSArgs<'contracts'>, + data: { to: string; data: string }[], + ) => { + const publicResolver = await contracts?.getPublicResolver()! + const formattedDataArr = data.map((item) => (item as any).data) + return { + to: publicResolver.address, + data: publicResolver.interface.encodeFunctionData('multicall', [ + formattedDataArr, + ]), + } + }, + decode: async ({ contracts }: ENSArgs<'contracts'>, data: string) => { + const publicResolver = await contracts?.getPublicResolver()! + const response = publicResolver.interface.decodeFunctionResult( + 'multicall', + data, + ) + if (!response) { + return + } + return response + }, +} + +export const multicallWrapper = { + async raw( + { contracts }: ENSArgs<'contracts'>, + transactions: TransactionRequest[], + requireSuccess: boolean = false, + ) { + const multicall = await contracts?.getMulticall()! + return { + to: multicall.address, + data: multicall.interface.encodeFunctionData('tryAggregate', [ + requireSuccess, + transactions.map((tx) => ({ + target: tx.to!, + callData: tx.data!, + })), + ]), + } + }, + async decode( + { contracts, provider }: ENSArgs<'contracts' | 'provider'>, + data: string, + transactions: TransactionRequest[], + ) { + if (!data) return + const multicall = await contracts?.getMulticall()! + try { + const [result] = multicall.interface.decodeFunctionResult( + 'tryAggregate', + data, + ) + const ccipChecked = await Promise.all( + (result as [boolean, string][]).map( + async ([success, returnData], i) => { + let newArr: [boolean, string] = [success, returnData] + // OffchainLookup(address,string[],bytes,bytes4,bytes) + if (!success && returnData.startsWith('0x556f1830')) { + try { + const newData = await ccipLookup( + provider!, + transactions[i], + returnData, + ) + if (newData) { + newArr = [true, newData] + } + } catch {} + } + return { + ...newArr, + success: newArr[0], + returnData: newArr[1], + } + }, + ), + ) + return ccipChecked + } catch (e: any) { + console.error(e) + return + } + }, +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/commitName.test.ts b/.yalc/@ensdomains/ensjs/src/functions/commitName.test.ts new file mode 100644 index 000000000..7b3d8e8f6 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/commitName.test.ts @@ -0,0 +1,58 @@ +import { ethers } from 'ethers' +import { ENS } from '..' +import setup from '../tests/setup' +import { randomSecret } from '../utils/registerHelpers' + +let ensInstance: ENS +let revert: Awaited>['revert'] +let provider: ethers.providers.JsonRpcProvider +let accounts: string[] + +beforeAll(async () => { + ;({ ensInstance, revert, provider } = await setup()) + accounts = await provider.listAccounts() +}) + +afterAll(async () => { + await revert() +}) + +describe('commitName', () => { + beforeEach(async () => { + await revert() + }) + it('should return a populated commit transaction with extra data and succeed', async () => { + const { customData, ...popTx } = + await ensInstance.commitName.populateTransaction('commitment.eth', { + duration: 31536000, + owner: accounts[1], + addressOrIndex: accounts[1], + }) + expect(popTx).toBeTruthy() + expect(customData).toHaveProperty('secret') + expect(customData).toHaveProperty('commitment') + + const tx = await provider.getSigner().sendTransaction(popTx) + await tx.wait() + + const controller = await ensInstance.contracts!.getEthRegistrarController()! + const commitment = await controller.commitments(customData!.commitment) + expect(commitment).toBeTruthy() + }) + it('should return a customised commmit transaction and succeed', async () => { + const secret = randomSecret() + const tx = await ensInstance.commitName('commitment.eth', { + duration: 31536000, + owner: accounts[1], + addressOrIndex: accounts[1], + secret, + }) + await tx.wait() + expect(tx.customData).toBeTruthy() + expect(tx.customData!.secret).toBe(secret) + + const controller = await ensInstance.contracts!.getEthRegistrarController()! + const commitment = await controller.commitments(tx.customData!.commitment) + expect(commitment).toBeTruthy() + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/commitName.ts b/.yalc/@ensdomains/ensjs/src/functions/commitName.ts new file mode 100644 index 000000000..35d1fbb40 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/commitName.ts @@ -0,0 +1,38 @@ +import { ENSArgs } from '..' +import { CommitmentParams, makeCommitment } from '../utils/registerHelpers' +import { wrappedLabelLengthCheck } from '../utils/wrapper' + +type Params = Omit & { + resolverAddress?: string +} + +export default async function ( + { contracts }: ENSArgs<'contracts'>, + name: string, + { resolverAddress, ...params }: Params, +) { + const labels = name.split('.') + if (labels.length !== 2 || labels[1] !== 'eth') + throw new Error('Currently only .eth TLD registrations are supported') + + wrappedLabelLengthCheck(labels[0]) + + const controller = await contracts!.getEthRegistrarController() + const resolver = await contracts!.getPublicResolver( + undefined, + resolverAddress, + ) + const { secret, commitment } = makeCommitment({ + name, + resolver, + ...params, + }) + + return { + ...(await controller.populateTransaction.commit(commitment)), + customData: { + secret, + commitment, + }, + } +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/createSubname.test.ts b/.yalc/@ensdomains/ensjs/src/functions/createSubname.test.ts new file mode 100644 index 000000000..6e20678a4 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/createSubname.test.ts @@ -0,0 +1,50 @@ +import { ethers } from 'ethers' +import { ENS } from '..' +import setup from '../tests/setup' +import { namehash } from '../utils/normalise' + +let ensInstance: ENS +let revert: Awaited>['revert'] +let provider: ethers.providers.JsonRpcProvider +let accounts: string[] + +beforeAll(async () => { + ;({ ensInstance, revert, provider } = await setup()) + accounts = await provider.listAccounts() +}) + +afterAll(async () => { + await revert() +}) + +describe('createSubname', () => { + beforeEach(async () => { + await revert() + }) + it('should allow creating a subname on the registry', async () => { + const tx = await ensInstance.createSubname('test.test123.eth', { + contract: 'registry', + owner: accounts[0], + addressOrIndex: 1, + }) + expect(tx).toBeTruthy() + await tx.wait() + + const registry = await ensInstance.contracts!.getRegistry()! + const result = await registry.owner(namehash('test.test123.eth')) + expect(result).toBe(accounts[0]) + }) + it('should allow creating a subname on the namewrapper', async () => { + const tx = await ensInstance.createSubname('test.wrapped.eth', { + contract: 'nameWrapper', + owner: accounts[0], + addressOrIndex: 1, + }) + expect(tx).toBeTruthy() + await tx.wait() + + const nameWrapper = await ensInstance.contracts!.getNameWrapper()! + const result = await nameWrapper.ownerOf(namehash('test.wrapped.eth')) + expect(result).toBe(accounts[0]) + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/createSubname.ts b/.yalc/@ensdomains/ensjs/src/functions/createSubname.ts new file mode 100644 index 000000000..a0851118f --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/createSubname.ts @@ -0,0 +1,89 @@ +import { BigNumber } from '@ethersproject/bignumber/lib/bignumber' +import { keccak256 as solidityKeccak256 } from '@ethersproject/solidity' +import { ENSArgs } from '..' +import { CombinedFuseInput, encodeFuses } from '../utils/fuses' +import { namehash } from '../utils/normalise' +import { Expiry, makeExpiry, wrappedLabelLengthCheck } from '../utils/wrapper' + +type BaseArgs = { + owner: string + resolverAddress?: string + contract: 'registry' | 'nameWrapper' +} + +type NameWrapperArgs = { + contract: 'nameWrapper' + fuses?: CombinedFuseInput + expiry?: Expiry +} & BaseArgs + +type Args = BaseArgs | NameWrapperArgs + +export default async function ( + { + contracts, + signer, + getExpiry, + }: ENSArgs<'contracts' | 'signer' | 'getExpiry'>, + name: string, + { owner, resolverAddress, contract, ...wrapperArgs }: Args, +) { + const labels = name.split('.') + + if (labels.length === 1) { + throw new Error('Subnames in ENS.js can only be created for 2LDs, not TLDs') + } + + if ('fuses' in wrapperArgs && contract === 'registry') { + throw new Error('Fuses can only be set on a wrapped name') + } + + if (!resolverAddress) { + resolverAddress = (await contracts?.getPublicResolver())!.address + } + + const label = labels.shift() as string + const labelhash = solidityKeccak256(['string'], [label]) + const parentNodehash = namehash(labels.join('.')) + + switch (contract) { + case 'registry': { + const registry = (await contracts!.getRegistry()!).connect(signer) + + return registry.populateTransaction.setSubnodeRecord( + parentNodehash, + labelhash, + owner, + resolverAddress, + 0, + ) + } + case 'nameWrapper': { + wrappedLabelLengthCheck(label) + const nameWrapper = (await contracts!.getNameWrapper()!).connect(signer) + const expiry: BigNumber = await makeExpiry( + { getExpiry }, + name, + 'expiry' in wrapperArgs ? wrapperArgs.expiry : undefined, + ) + + const generatedFuses = + 'fuses' in wrapperArgs && wrapperArgs.fuses + ? encodeFuses(wrapperArgs.fuses) + : 0 + + return nameWrapper.populateTransaction.setSubnodeRecord( + parentNodehash, + label, + owner, + resolverAddress, + 0, + generatedFuses, + expiry, + ) + } + default: { + throw new Error(`Unknown contract: ${contract}`) + } + } +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/deleteSubname.test.ts b/.yalc/@ensdomains/ensjs/src/functions/deleteSubname.test.ts new file mode 100644 index 000000000..701f0eccf --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/deleteSubname.test.ts @@ -0,0 +1,69 @@ +import { ENS } from '..' +import setup from '../tests/setup' +import { namehash } from '../utils/normalise' + +let ensInstance: ENS +let revert: Awaited>['revert'] + +beforeAll(async () => { + ;({ ensInstance, revert } = await setup()) +}) + +afterAll(async () => { + await revert() +}) + +describe('deleteSubname', () => { + beforeEach(async () => { + await revert() + }) + it('should allow deleting a subname on the registry', async () => { + const tx = await ensInstance.deleteSubname('test.with-subnames.eth', { + contract: 'registry', + addressOrIndex: 1, + }) + expect(tx).toBeTruthy() + await tx.wait() + + const registry = await ensInstance.contracts!.getRegistry()! + const result = await registry.owner(namehash('test.with-subnames.eth')) + expect(result).toBe('0x0000000000000000000000000000000000000000') + }) + + it('should allow deleting a subname on the nameWrapper', async () => { + const nameWrapper = await ensInstance.contracts!.getNameWrapper()! + + const tx = await ensInstance.deleteSubname( + 'test.wrapped-with-subnames.eth', + { + contract: 'nameWrapper', + addressOrIndex: 1, + }, + ) + expect(tx).toBeTruthy() + await tx.wait() + + const result = await nameWrapper.ownerOf( + namehash('test.wrapped-with-subnames.eth'), + ) + expect(result).toBe('0x0000000000000000000000000000000000000000') + }) + + it('should not allow deleting 1LD', async () => { + await expect( + ensInstance.deleteSubname('eth', { + contract: 'nameWrapper', + addressOrIndex: 1, + }), + ).rejects.toThrow() + }) + + it('should not allow deleting 2LD', async () => { + await expect( + ensInstance.deleteSubname('test123.eth', { + contract: 'registry', + addressOrIndex: 1, + }), + ).rejects.toThrow() + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/deleteSubname.ts b/.yalc/@ensdomains/ensjs/src/functions/deleteSubname.ts new file mode 100644 index 000000000..8cb09f535 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/deleteSubname.ts @@ -0,0 +1,53 @@ +import { keccak256 as solidityKeccak256 } from '@ethersproject/solidity' +import { ENSArgs } from '..' +import { namehash } from '../utils/normalise' + +type Args = { + contract: 'registry' | 'nameWrapper' +} + +export default async function ( + { contracts, signer }: ENSArgs<'contracts' | 'signer' | 'getExpiry'>, + name: string, + { contract }: Args, +) { + const labels = name.split('.') + + if (labels.length < 3) { + throw new Error(`${name} is not a valid subname`) + } + + const label = labels.shift() as string + const labelhash = solidityKeccak256(['string'], [label]) + const parentNodehash = namehash(labels.join('.')) + + switch (contract) { + case 'registry': { + const registry = (await contracts!.getRegistry()!).connect(signer) + + return registry.populateTransaction.setSubnodeRecord( + parentNodehash, + labelhash, + '0x0000000000000000000000000000000000000000', + '0x0000000000000000000000000000000000000000', + 0, + ) + } + case 'nameWrapper': { + const nameWrapper = (await contracts!.getNameWrapper()!).connect(signer) + + return nameWrapper.populateTransaction.setSubnodeRecord( + parentNodehash, + label, + '0x0000000000000000000000000000000000000000', + '0x0000000000000000000000000000000000000000', + 0, + 0, + 0, + ) + } + default: { + throw new Error(`Unknown contract: ${contract}`) + } + } +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/getAvailable.test.ts b/.yalc/@ensdomains/ensjs/src/functions/getAvailable.test.ts new file mode 100644 index 000000000..f63a4e339 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getAvailable.test.ts @@ -0,0 +1,21 @@ +import { ENS } from '..' +import setup from '../tests/setup' + +let ensInstance: ENS + +beforeAll(async () => { + ;({ ensInstance } = await setup()) +}) + +describe('getAvailable', () => { + it('should return false for a name that is unavailable', async () => { + const result = await ensInstance.getAvailable('test123.eth') + expect(typeof result).toBe('boolean') + expect(result).toBe(false) + }) + it('should return true for a name that is available', async () => { + const result = await ensInstance.getAvailable('available-name.eth') + expect(typeof result).toBe('boolean') + expect(result).toBe(true) + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/getAvailable.ts b/.yalc/@ensdomains/ensjs/src/functions/getAvailable.ts new file mode 100644 index 000000000..0a99ba495 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getAvailable.ts @@ -0,0 +1,37 @@ +import { ENSArgs } from '..' +import { labelhash } from '../utils/labels' + +const raw = async ({ contracts }: ENSArgs<'contracts'>, name: string) => { + const baseRegistrar = await contracts?.getBaseRegistrar()! + + const labels = name.split('.') + if (labels.length !== 2 || labels[1] !== 'eth') { + throw new Error('Currently only .eth names can be checked for availability') + } + + return { + to: baseRegistrar.address, + data: baseRegistrar.interface.encodeFunctionData('available', [ + labelhash(labels[0]), + ]), + } +} + +const decode = async ({ contracts }: ENSArgs<'contracts'>, data: string) => { + if (data === null) return + const baseRegistrar = await contracts?.getBaseRegistrar()! + try { + const result = baseRegistrar.interface.decodeFunctionResult( + 'available', + data, + ) + return result['0'] as boolean + } catch { + return + } +} + +export default { + raw, + decode, +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/getDNSOwner.test.ts b/.yalc/@ensdomains/ensjs/src/functions/getDNSOwner.test.ts new file mode 100644 index 000000000..fab56280c --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getDNSOwner.test.ts @@ -0,0 +1,112 @@ +import nock from 'nock' +import getDNSOwner, { encodeURLParams } from './getDNSOwner' + +function hexDecode(string: string) { + const bytes: any[] = [] + string.replace(/../g, (pair) => { + bytes.push(parseInt(pair, 16)) + return pair + }) + return new Uint8Array(bytes).buffer +} + +describe('encodeURLParams', () => { + it('should encodeURLParams', () => { + const p: { [key: string]: string } = { + a: 'b', + c: 'd', + } + const expected = 'a=b&c=d' + const actual = encodeURLParams(p) + expect(actual).toEqual(expected) + }) +}) + +describe('getDNSOwner', () => { + it('should return the address from the result of a dnsQuery', async () => { + const dnsName = 'brantly.xyz' + + nock('https://cloudflare-dns.com:443', { + encodedQueryParams: true, + }) + .get('/dns-query') + .query((queryObject) => { + return ( + queryObject.ct === 'application/dns-udpwireformat' && + queryObject.dns === + 'AAEBAAABAAAAAAABBF9lbnMHYnJhbnRseQN4eXoAABAAAQAAKRAAAACAAAAA' + ) + }) + .reply( + 200, + Buffer.from( + hexDecode( + '000181a00001000200000001045f656e73076272616e746c790378797a0000100001c00c0010000100000e10002d2c613d307839383331313033303936323044393131373331416330393332323139616630363039316236373434c00c002e000100000e10009f0010080300000e1062df366962c23569d89d076272616e746c790378797a0039c894ca1d7a60c1356e478066d39961a78ec1edbe62e1eb0f13d7947bb72097654648dc79be075ca32625f02e60267f45e88d7c05e9c3ec0cf21ab2dca67a8fbeb8e995644726357628446b888a144cafef5cbfca120c6511fe36de9d3c62dee27680825190c5404ca503904b98dbf62d9122f6fda393dc04b14a89ceb68c7a00002904d0000080000000', + ), + ), + [ + 'Server', + 'cloudflare', + 'Date', + 'Wed, 06 Jul 2022 23:37:28 GMT', + 'Content-Type', + 'application/dns-message', + 'Connection', + 'close', + 'Access-Control-Allow-Origin', + '*', + 'Content-Length', + '273', + 'CF-RAY', + '726c2b1d3bab6b74-TPE', + ], + ) + expect(await getDNSOwner({}, dnsName)).toEqual( + '0x983110309620D911731Ac0932219af06091b6744', + ) + }) + it('should throw if there is an error in the DNS query', async () => { + const dnsName = 'nick.xyz' + + nock('https://cloudflare-dns.com:443', { + encodedQueryParams: true, + }) + .get('/dns-query') + .query((queryObject) => { + return ( + queryObject.ct === 'application/dns-udpwireformat' && + queryObject.dns === + 'AAEBAAABAAAAAAABBF9lbnMEbmljawN4eXoAABAAAQAAKRAAAACAAAAA' + ) + }) + .reply( + 200, + Buffer.from( + hexDecode( + '000181830001000000010001045f656e73046e69636b0378797a0000100001c0110006000100000258003b046e7337310d646f6d61696e636f6e74726f6c03636f6d0003646e73056a6f6d6178036e6574007876d1800000708000001c2000093a800000025800002904d0000080000000', + ), + ), + [ + 'Server', + 'cloudflare', + 'Date', + 'Wed, 06 Jul 2022 23:37:28 GMT', + 'Content-Type', + 'application/dns-message', + 'Connection', + 'close', + 'Access-Control-Allow-Origin', + '*', + 'Content-Length', + '273', + 'CF-RAY', + '726c2b1d3bab6b74-TPE', + ], + ) + try { + await getDNSOwner({}, dnsName) + } catch (error: any) { + expect(error.message).toEqual('DNS query failed: NXDOMAIN') + } + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/getDNSOwner.ts b/.yalc/@ensdomains/ensjs/src/functions/getDNSOwner.ts new file mode 100644 index 000000000..5dbd41cbd --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getDNSOwner.ts @@ -0,0 +1,63 @@ +import { _fetchData } from '@ethersproject/web' +import * as packet from 'dns-packet' + +export function encodeURLParams(p: { [key: string]: string }): string { + return Object.entries(p) + .map((kv) => kv.map(encodeURIComponent).join('=')) + .join('&') +} + +export const getDNS = async (q: packet.Packet): Promise => { + const url = `https://cloudflare-dns.com/dns-query?${encodeURLParams({ + ct: 'application/dns-udpwireformat', + dns: packet.encode(q)?.toString('base64'), + ts: Date.now().toString(), + })}` + const response = await _fetchData(url, undefined) + const arrayBuffer = response.buffer.slice( + response.byteOffset, + response.byteLength + response.byteOffset, + ) + const fromArrayBuffer = Buffer.from(arrayBuffer) + return packet.decode(fromArrayBuffer) +} + +export const dnsQuery = async ( + qtype: string, + qname: string, +): Promise => { + const query: packet.Packet = { + type: 'query', + id: 1, + flags: packet.RECURSION_DESIRED, + questions: [ + { + type: qtype, + class: 'IN', + name: qname, + }, + ], + additionals: [ + { + type: 'OPT', + class: 'IN', + name: '.', + udpPayloadSize: 4096, + flags: packet.DNSSEC_OK, + }, + ], + answers: [], + } + + const response = await getDNS(query) + if (response.rcode !== 'NOERROR') { + throw new Error(`DNS query failed: ${response.rcode}`) + } + return response +} + +export default async function (_: any, dnsName: string) { + const result = await dnsQuery('TXT', `_ens.${dnsName}`) + const address = result?.answers?.[0]?.data?.[0]?.toString()?.split('=')?.[1] + return address +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/getExpiry.test.ts b/.yalc/@ensdomains/ensjs/src/functions/getExpiry.test.ts new file mode 100644 index 000000000..90de409c1 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getExpiry.test.ts @@ -0,0 +1,55 @@ +import { ENS } from '..' +import setup from '../tests/setup' + +let ensInstance: ENS +let revert: Awaited>['revert'] + +beforeAll(async () => { + ;({ ensInstance, revert } = await setup()) +}) + +afterAll(async () => { + await revert() +}) + +describe('getExpiry', () => { + it('should get the expiry for a .eth name with no other args', async () => { + const result = await ensInstance.getExpiry('with-profile.eth') + expect(result).toBeTruthy() + if (result) { + const { expiry, gracePeriod } = result + expect(expiry).toBeInstanceOf(Date) + expect(gracePeriod).toBe(7776000000) + } + }) + it('should get the expiry for a wrapped name', async () => { + const result = await ensInstance.getExpiry('wrapped.eth', { + contract: 'nameWrapper', + }) + + expect(result).toBeTruthy() + if (result) { + const { expiry, gracePeriod } = result + expect(expiry).toBeInstanceOf(Date) + expect(gracePeriod).toBe(null) + } + }) + it('should throw an error for a non .eth name if not wrapped', async () => { + try { + await ensInstance.getExpiry('sub.with-profile.eth') + expect(false).toBeTruthy() + } catch { + expect(true).toBeTruthy() + } + }) + it('should throw an error for a non .eth name if registrar is specified', async () => { + try { + await ensInstance.getExpiry('sub.with-profile.eth', { + contract: 'registrar', + }) + expect(false).toBeTruthy() + } catch { + expect(true).toBeTruthy() + } + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/getExpiry.ts b/.yalc/@ensdomains/ensjs/src/functions/getExpiry.ts new file mode 100644 index 000000000..288d67d44 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getExpiry.ts @@ -0,0 +1,141 @@ +import { BigNumber } from '@ethersproject/bignumber/lib/bignumber' +import { keccak256 as solidityKeccak256 } from '@ethersproject/solidity' +import { ENSArgs } from '..' +import { namehash } from '../utils/normalise' + +type ContractOption = 'registrar' | 'nameWrapper' + +type Args = { + contract?: ContractOption +} + +const getRegistrarExpiry = async ( + { contracts, multicallWrapper }: ENSArgs<'contracts' | 'multicallWrapper'>, + labels: string[], +) => { + if (labels.length > 2 || labels[1] !== 'eth') { + throw new Error('Only .eth names have expiry dates on the registrar') + } + + const baseRegistrar = await contracts?.getBaseRegistrar()! + + const expiryCall = baseRegistrar.interface.encodeFunctionData('nameExpires', [ + solidityKeccak256(['string'], [labels[0]]), + ]) + const gracePeriodCall = + baseRegistrar.interface.encodeFunctionData('GRACE_PERIOD') + + return multicallWrapper.raw([ + { + to: baseRegistrar.address, + data: expiryCall, + }, + { + to: baseRegistrar.address, + data: gracePeriodCall, + }, + ]) +} + +const getWrapperExpiry = async ( + { contracts }: ENSArgs<'contracts'>, + labels: string[], +) => { + const nameWrapper = await contracts?.getNameWrapper()! + const expiryCall = nameWrapper.interface.encodeFunctionData('getData', [ + namehash(labels.join('.')), + ]) + return { + to: nameWrapper.address, + data: expiryCall, + } +} + +const getContractToUse = ( + contract: ContractOption | undefined, + labels: string[], +) => { + if (contract) return contract + if (labels.length === 2 && labels[1] === 'eth') { + return 'registrar' + } + return 'nameWrapper' +} + +const raw = async ( + ensArgs: ENSArgs<'contracts' | 'multicallWrapper'>, + name: string, + { contract }: Args = {}, +) => { + const labels = name.split('.') + + const contractToUse = getContractToUse(contract, labels) + + return contractToUse === 'nameWrapper' + ? getWrapperExpiry(ensArgs, labels) + : getRegistrarExpiry(ensArgs, labels) +} + +const decodeRegistrarExpiry = async ( + { contracts, multicallWrapper }: ENSArgs<'contracts' | 'multicallWrapper'>, + data: string, +) => { + const result = await multicallWrapper.decode(data) + const baseRegistrar = await contracts?.getBaseRegistrar()! + try { + const [nameExpires] = baseRegistrar.interface.decodeFunctionResult( + 'nameExpires', + result[0].returnData, + ) + const [gracePeriod] = baseRegistrar.interface.decodeFunctionResult( + 'GRACE_PERIOD', + result[1].returnData, + ) + return { + expiry: nameExpires > 0 ? new Date(nameExpires * 1000) : null, + gracePeriod: (gracePeriod as BigNumber).toNumber() * 1000, + } + } catch { + return + } +} + +const decodeWrapperExpiry = async ( + { contracts }: ENSArgs<'contracts'>, + data: string, +) => { + const nameWrapper = await contracts?.getNameWrapper()! + try { + const [, , expiry] = nameWrapper.interface.decodeFunctionResult( + 'getData', + data, + ) + return { + expiry: new Date(expiry * 1000), + gracePeriod: null, + } + } catch { + return + } +} + +const decode = async ( + ensArgs: ENSArgs<'contracts' | 'multicallWrapper'>, + data: string, + name: string, + { contract }: Args = {}, +) => { + if (data === null) return + + const labels = name.split('.') + const contractToUse = getContractToUse(contract, labels) + + return contractToUse === 'nameWrapper' + ? decodeWrapperExpiry(ensArgs, data) + : decodeRegistrarExpiry(ensArgs, data) +} + +export default { + raw, + decode, +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/getHistory.test.ts b/.yalc/@ensdomains/ensjs/src/functions/getHistory.test.ts new file mode 100644 index 000000000..fdecd3a9f --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getHistory.test.ts @@ -0,0 +1,38 @@ +import { ENS } from '..' +import setup from '../tests/setup' + +let ensInstance: ENS +let revert: Awaited>['revert'] + +beforeAll(async () => { + ;({ ensInstance, revert } = await setup()) +}) + +afterAll(async () => { + await revert() +}) + +describe('getHistory', () => { + it('should return null for a non-existent name', async () => { + const result = await ensInstance.getHistory('test123123cool.eth') + expect(result).toBeUndefined() + }) + it('should return the history of a name', async () => { + const result = await ensInstance.getHistory('with-profile.eth') + expect(result).toBeTruthy() + if (result) { + expect(result).toHaveProperty('domain') + expect(result).toHaveProperty('resolver') + expect(result).toHaveProperty('registration') + } + }) + it('should return the history of a wrapped name', async () => { + const result = await ensInstance.getHistory('wrapped.eth') + expect(result).toBeTruthy() + if (result) { + expect(result).toHaveProperty('domain') + expect(result).toHaveProperty('resolver') + expect(result).toHaveProperty('registration') + } + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/getHistory.ts b/.yalc/@ensdomains/ensjs/src/functions/getHistory.ts new file mode 100644 index 000000000..6839e6240 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getHistory.ts @@ -0,0 +1,312 @@ +import { formatsByCoinType } from '@ensdomains/address-encoder' +import { hexStripZeros } from '@ethersproject/bytes' +import { ENSArgs } from '..' +import { decodeContenthash } from '../utils/contentHash' +import { labelhash } from '../utils/labels' +import { namehash } from '../utils/normalise' +import { + AbiChanged, + AddrChanged, + AuthorisationChanged, + ContenthashChanged, + ExpiryExtended, + FusesSet, + InterfaceChanged, + MulticoinAddrChanged, + NameChanged, + NameRegistered, + NameRenewed, + NameTransferred, + NameUnwrapped, + NameWrapped, + NewOwner, + NewResolver, + NewTtl, + PubkeyChanged, + TextChanged, + Transfer, + VersionChanged, + WrappedTransfer, +} from '../utils/subgraph-types' + +type DomainEvent = + | 'NewOwner' + | 'NewResolver' + | 'Transfer' + | 'NewTTL' + | 'WrappedTransfer' + | 'NameWrapped' + | 'NameUnwrapped' + | 'FusesSet' + | 'ExpiryExtended' +type RegistrationEvent = 'NameRegistered' | 'NameRenewed' | 'NameTransferred' +type ResolverEvent = + | 'AddrChanged' + | 'MulticoinAddrChanged' + | 'NameChanged' + | 'AbiChanged' + | 'PubkeyChanged' + | 'TextChanged' + | 'ContenthashChanged' + | 'InterfaceChanged' + | 'AuthorisationChanged' + | 'VersionChanged' + +type EventTypes = 'Domain' | 'Registration' | 'Resolver' +type EventFormat = { + Domain: DomainEvent + Registration: RegistrationEvent + Resolver: ResolverEvent +} + +const eventFormat: { + [key in EventTypes]: { [n in EventFormat[key]]: (args: any) => object } +} = { + Domain: { + NewOwner: (args: NewOwner) => ({ owner: args.owner.id }), + NewResolver: (args: NewResolver) => ({ + resolver: args.resolver.id.split('-')[0], + }), + Transfer: (args: Transfer) => ({ owner: args.owner.id }), + NewTTL: (args: NewTtl) => ({ ttl: args.ttl }), + WrappedTransfer: (args: WrappedTransfer) => ({ owner: args.owner.id }), + NameWrapped: (args: NameWrapped) => ({ + fuses: args.fuses, + owner: args.owner.id, + expiryDate: args.expiryDate, + }), + NameUnwrapped: (args: NameUnwrapped) => ({ owner: args.owner.id }), + FusesSet: (args: FusesSet) => ({ fuses: args.fuses }), + ExpiryExtended: (args: ExpiryExtended) => ({ expiryDate: args.expiryDate }), + }, + Registration: { + NameRegistered: (args: NameRegistered) => ({ + registrant: args.registrant.id, + expiryDate: args.expiryDate, + }), + NameRenewed: (args: NameRenewed) => ({ expiryDate: args.expiryDate }), + NameTransferred: (args: NameTransferred) => ({ owner: args.newOwner.id }), + }, + Resolver: { + AddrChanged: (args: AddrChanged) => ({ addr: args.addr.id }), + MulticoinAddrChanged: ( + args: Omit & { multiaddr: string }, + ) => { + const format = formatsByCoinType[parseInt(args.coinType)] + if (!format) { + return { + coinType: args.coinType, + rawAddr: args.multiaddr, + } + } + if (hexStripZeros(args.multiaddr) === '0x') { + return { + coinType: args.coinType, + coinName: format.name, + rawAddr: '0x', + } + } + return { + coinType: args.coinType, + coinName: format.name, + addr: format.encoder(Buffer.from(args.multiaddr.slice(2), 'hex')), + } + }, + NameChanged: (args: NameChanged) => ({ name: args.name }), + AbiChanged: (args: AbiChanged) => ({ contentType: args.contentType }), + PubkeyChanged: (args: PubkeyChanged) => ({ x: args.x, y: args.y }), + TextChanged: (args: TextChanged) => ({ key: args.key, value: args.value }), + ContenthashChanged: (args: ContenthashChanged) => ({ + hash: decodeContenthash(args.hash), + }), + InterfaceChanged: (args: InterfaceChanged) => ({ + interfaceId: args.interfaceID, + implementer: args.implementer, + }), + AuthorisationChanged: (args: AuthorisationChanged) => ({ + owner: args.owner, + target: args.target, + isAuthorized: args.isAuthorized, + }), + VersionChanged: (args: VersionChanged) => ({ version: args.version }), + }, +} + +const mapEvents = (eventArray: any[], type: T) => + eventArray.map( + (event: { + __typename: EventFormat[T] + blockNumber: number + transactionID: string + id: string + }) => ({ + type: event.__typename, + blockNumber: event.blockNumber, + transactionHash: event.transactionID, + id: event.id, + data: eventFormat[type][event.__typename](event), + }), + ) + +export async function getHistory( + { gqlInstance }: ENSArgs<'gqlInstance'>, + name: string, +) { + const { client } = gqlInstance + const query = gqlInstance.gql` + query getHistory($namehash: String!, $labelhash: String!) { + domain(id: $namehash) { + events { + id + blockNumber + transactionID + __typename + ...on Transfer { + owner { + id + } + } + ...on NewOwner { + owner { + id + } + } + ...on NewResolver { + resolver { + id + } + } + ...on NewTTL { + ttl + } + ...on WrappedTransfer { + owner { + id + } + } + ...on NameWrapped { + fuses + expiryDate + owner { + id + } + } + ...on NameUnwrapped { + owner { + id + } + } + ...on FusesSet { + fuses + } + ...on ExpiryExtended { + expiryDate + } + } + registration { + events { + id + blockNumber + transactionID + __typename + ...on NameRegistered { + registrant { + id + } + expiryDate + } + ...on NameRenewed { + expiryDate + } + ...on NameTransferred { + newOwner { + id + } + } + } + } + resolver { + events { + id + blockNumber + transactionID + __typename + ...on AddrChanged { + addr { + id + } + } + ...on MulticoinAddrChanged { + coinType + multiaddr: addr + } + ...on NameChanged { + name + } + ...on AbiChanged { + contentType + } + ...on PubkeyChanged { + x + y + } + ...on TextChanged { + key + value + } + ...on ContenthashChanged { + hash + } + ...on InterfaceChanged { + interfaceID + implementer + } + ...on AuthorisationChanged { + owner + target + isAuthorized + } + ...on VersionChanged { + version + } + } + } + } + } + ` + + const label = name.split('.')[0] + + const nameHash = namehash(name) + const labelHash = labelhash(label) + + const response = await client.request(query, { + namehash: nameHash, + labelhash: labelHash, + }) + const domain = response?.domain + + if (!domain) return + + const { + events: domainEvents, + registration: { events: registrationEvents }, + resolver: { events: resolverEvents }, + } = domain + + const domainHistory = mapEvents(domainEvents, 'Domain') + const registrationHistory = mapEvents(registrationEvents, 'Registration') + const resolverHistory = mapEvents( + // remove duplicate events for ETH cointype + resolverEvents.filter( + (event: any) => !event.coinType || event.coinType !== '60', + ), + 'Resolver', + ) + + return { + domain: domainHistory, + registration: registrationHistory, + resolver: resolverHistory, + } +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/getName.test.ts b/.yalc/@ensdomains/ensjs/src/functions/getName.test.ts new file mode 100644 index 000000000..0d5683b75 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getName.test.ts @@ -0,0 +1,47 @@ +import { ethers } from 'ethers' +import { ENS } from '..' +import setup from '../tests/setup' + +let ensInstance: ENS +let revert: Awaited>['revert'] +let provider: ethers.providers.JsonRpcProvider +let accounts: string[] + +beforeAll(async () => { + ;({ ensInstance, revert, provider } = await setup()) + accounts = await provider.listAccounts() +}) + +afterAll(async () => { + await revert() +}) + +describe('getName', () => { + it('should get a primary name from an address', async () => { + const result = await ensInstance.getName( + '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + ) + expect(result).toBeTruthy() + if (result) { + expect(result.name).toBe('with-profile.eth') + expect(result.match).toBeTruthy() + } + }) + it('should return null for an address with no primary name', async () => { + const result = await ensInstance.getName( + '0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0', + ) + expect(result?.name).toBeUndefined() + }) + it('should return with a false match for a name with no forward resolution', async () => { + const tx = await ensInstance.setName('with-profile.eth') + await tx?.wait() + + const result = await ensInstance.getName(accounts[0]) + expect(result).toBeTruthy() + if (result) { + expect(result.name).toBe('with-profile.eth') + expect(result.match).toBeFalsy() + } + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/getName.ts b/.yalc/@ensdomains/ensjs/src/functions/getName.ts new file mode 100644 index 000000000..b84d6e3d3 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getName.ts @@ -0,0 +1,41 @@ +import { ENSArgs } from '..' +import { hexEncodeName } from '../utils/hexEncodedName' + +const raw = async ({ contracts }: ENSArgs<'contracts'>, address: string) => { + const universalResolver = await contracts?.getUniversalResolver()! + const reverseNode = `${address.toLowerCase().substring(2)}.addr.reverse` + return { + to: universalResolver.address, + data: universalResolver.interface.encodeFunctionData('reverse(bytes)', [ + hexEncodeName(reverseNode), + ]), + } +} + +const decode = async ( + { contracts }: ENSArgs<'contracts'>, + data: string, + address: string, +) => { + if (data === null) return + const universalResolver = await contracts?.getUniversalResolver()! + try { + const result = universalResolver.interface.decodeFunctionResult( + 'reverse(bytes)', + data, + ) + return { + name: result['0'], + match: result['1'].toLowerCase() === address.toLowerCase(), + reverseResolverAddress: result['2'], + resolverAddress: result['3'], + } + } catch { + return { name: undefined } + } +} + +export default { + raw, + decode, +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/getNames.test.ts b/.yalc/@ensdomains/ensjs/src/functions/getNames.test.ts new file mode 100644 index 000000000..e44696841 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getNames.test.ts @@ -0,0 +1,311 @@ +import { ENS } from '..' +import setup from '../tests/setup' +import { Name } from './getNames' + +let ensInstance: ENS + +beforeAll(async () => { + ;({ ensInstance } = await setup()) +}) + +const testProperties = (obj: object, ...properties: string[]) => + properties.map((property) => expect(obj).toHaveProperty(property)) + +const testNotProperties = (obj: object, ...properties: string[]) => + properties.map((property) => expect(obj).not.toHaveProperty(property)) + +const letterItems = [ + 'w', + '9', + '8', + '7', + '6', + '5', + '4', + ...Array(5).fill('3'), + ...Array(11).fill('2'), + ...Array(11).fill('1'), + '0', +] + +const domainLetterItems = [ + '[', + 'x', + 'w', + 't', + 'l', + 'a', + '9', + '8', + '7', + '6', + '5', + '4', + ...Array(5).fill('3'), + ...Array(11).fill('2'), + ...Array(11).fill('1'), + '0', +] + +describe('getNames', () => { + let totalRegistrations: number = 0 + let totalOwnedNames: number = 0 + it('should get the registrations for an address', async () => { + const result = await ensInstance.getNames({ + address: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + type: 'registrant', + }) + totalRegistrations = result.length + expect(result).toBeTruthy() + testProperties( + result[0], + 'expiryDate', + 'registrationDate', + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'parent', + 'truncatedName', + ) + }) + it('should get the owned names for an address', async () => { + const result = await ensInstance.getNames({ + address: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + type: 'owner', + }) + totalOwnedNames = result.length + expect(result).toBeTruthy() + testProperties( + result[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'parent', + 'truncatedName', + ) + testNotProperties(result[0], 'expiryDate', 'registrationDate') + }) + it('should get wrapped domains for an address', async () => { + const result = await ensInstance.getNames({ + address: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + type: 'wrappedOwner', + }) + expect(result).toBeTruthy() + testProperties( + result[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'parent', + 'truncatedName', + 'expiryDate', + 'fuses', + ) + }) + it('should get the registrations for an address with pagination', async () => { + const pageOne = await ensInstance.getNames({ + address: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + type: 'registrant', + page: 0, + }) + expect(pageOne).toHaveLength(10) + const pageTwo = await ensInstance.getNames({ + address: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + type: 'registrant', + page: 1, + }) + expect(pageTwo).toHaveLength(10) + const pageThree = await ensInstance.getNames({ + address: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + type: 'registrant', + page: 2, + }) + expect(pageThree).toHaveLength(10) + const pageFour = await ensInstance.getNames({ + address: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + type: 'registrant', + page: 3, + }) + expect(pageFour).toHaveLength(totalRegistrations % 10) + }) + it('should get the owned names for an address with pagination', async () => { + const pageOne = await ensInstance.getNames({ + address: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + type: 'owner', + page: 0, + }) + expect(pageOne).toHaveLength(10) + const pageTwo = await ensInstance.getNames({ + address: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + type: 'owner', + page: 1, + }) + expect(pageTwo).toHaveLength(10) + const pageThree = await ensInstance.getNames({ + address: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + type: 'owner', + page: 2, + }) + expect(pageThree).toHaveLength(10) + const pageFour = await ensInstance.getNames({ + address: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + type: 'owner', + page: 3, + }) + expect(pageFour).toHaveLength(10) + const pageFive = await ensInstance.getNames({ + address: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + type: 'owner', + page: 4, + }) + expect(pageFive).toHaveLength(totalOwnedNames % 10) + }) + it('should get wrapped domains for an address with pagination', async () => { + const pageOne = await ensInstance.getNames({ + address: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + type: 'wrappedOwner', + page: 0, + }) + expect(pageOne).toHaveLength(2) + }) + describe('orderBy', () => { + describe('registrations', () => { + it('descending registrationDate', async () => { + const registrationDateOrderedDesc = (await ensInstance.getNames({ + address: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + type: 'registrant', + orderBy: 'registrationDate', + orderDirection: 'desc', + })) as Name[] + registrationDateOrderedDesc.reduce((prev, curr) => { + expect(prev.registrationDate!.getTime()).toBeGreaterThanOrEqual( + curr.registrationDate!.getTime(), + ) + return curr + }) + }) + it('ascending registrationDate', async () => { + const registrationDateOrderedAsc = (await ensInstance.getNames({ + address: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + type: 'registrant', + orderBy: 'registrationDate', + orderDirection: 'asc', + })) as Name[] + registrationDateOrderedAsc.reduce((prev, curr) => { + expect(prev.registrationDate!.getTime()).toBeLessThanOrEqual( + curr.registrationDate!.getTime(), + ) + return curr + }) + }) + it('descending expiryDate', async () => { + const expiryDateOrderedDesc = (await ensInstance.getNames({ + address: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + type: 'registrant', + orderBy: 'expiryDate', + orderDirection: 'desc', + })) as Name[] + expiryDateOrderedDesc.reduce((prev, curr) => { + expect(prev.expiryDate!.getTime()).toBeGreaterThanOrEqual( + curr.expiryDate!.getTime(), + ) + return curr + }) + }) + it('ascending expiryDate', async () => { + const expiryDateOrderedAsc = (await ensInstance.getNames({ + address: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + type: 'registrant', + orderBy: 'expiryDate', + orderDirection: 'asc', + })) as Name[] + expiryDateOrderedAsc.reduce((prev, curr) => { + expect(prev.expiryDate!.getTime()).toBeLessThanOrEqual( + curr.expiryDate!.getTime(), + ) + return curr + }) + }) + it('descending labelName', async () => { + const labelNameOrderedDesc = (await ensInstance.getNames({ + address: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + type: 'registrant', + orderBy: 'labelName', + orderDirection: 'desc', + })) as Name[] + expect(labelNameOrderedDesc.map((n) => n.labelName![0])).toStrictEqual( + letterItems, + ) + }) + it('ascending labelName', async () => { + const labelNameOrderedAsc = (await ensInstance.getNames({ + address: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + type: 'registrant', + orderBy: 'labelName', + orderDirection: 'asc', + })) as Name[] + expect(labelNameOrderedAsc.map((n) => n.labelName![0])).toStrictEqual( + letterItems.reverse(), + ) + }) + }) + describe('owned names', () => { + it('descending createdAt', async () => { + const createdAtOrderedDesc = (await ensInstance.getNames({ + address: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + type: 'owner', + orderBy: 'createdAt', + orderDirection: 'desc', + })) as Name[] + createdAtOrderedDesc.reduce((prev, curr) => { + expect(prev.createdAt!.getTime()).toBeGreaterThanOrEqual( + curr.createdAt!.getTime(), + ) + return curr + }) + }) + it('ascending createdAt', async () => { + const createdAtOrderedAsc = (await ensInstance.getNames({ + address: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + type: 'owner', + orderBy: 'createdAt', + orderDirection: 'asc', + })) as Name[] + createdAtOrderedAsc.reduce((prev, curr) => { + expect(prev.createdAt!.getTime()).toBeLessThanOrEqual( + curr.createdAt!.getTime(), + ) + return curr + }) + }) + it('descending labelName', async () => { + const labelNameOrderedDesc = (await ensInstance.getNames({ + address: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + type: 'owner', + orderBy: 'labelName', + orderDirection: 'desc', + })) as Name[] + expect(labelNameOrderedDesc.map((n) => n.name[0])).toStrictEqual( + domainLetterItems, + ) + }) + it('ascending labelName', async () => { + const labelNameOrderedAsc = (await ensInstance.getNames({ + address: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + type: 'owner', + orderBy: 'labelName', + orderDirection: 'asc', + })) as Name[] + expect(labelNameOrderedAsc.map((n) => n.name[0])).toStrictEqual( + domainLetterItems.reverse(), + ) + }) + }) + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/getNames.ts b/.yalc/@ensdomains/ensjs/src/functions/getNames.ts new file mode 100644 index 000000000..8c781502a --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getNames.ts @@ -0,0 +1,392 @@ +import { ENSArgs } from '..' +import { truncateFormat } from '../utils/format' +import { AllCurrentFuses, decodeFuses } from '../utils/fuses' +import { decryptName } from '../utils/labels' +import { Domain, Registration, WrappedDomain } from '../utils/subgraph-types' + +export type Name = { + id: string + labelName: string | null + truncatedName?: string + labelhash: string + isMigrated: boolean + name: string + parent: { + name: string + } + createdAt?: Date + registrationDate?: Date + expiryDate?: Date + fuses?: AllCurrentFuses + registration?: { + expiryDate: Date + registrationDate: Date + } + type: 'domain' | 'registration' | 'wrappedDomain' +} + +type BaseParams = { + address: string + type: 'registrant' | 'owner' | 'wrappedOwner' | 'all' + page?: number + pageSize?: number + orderDirection?: 'asc' | 'desc' +} + +type RegistrantParams = { + type: 'registrant' + orderBy?: 'registrationDate' | 'expiryDate' | 'labelName' +} + +type OwnerParams = { + type: 'owner' + orderBy?: 'createdAt' | 'labelName' +} + +type WrappedOwnerParams = { + type: 'wrappedOwner' + orderBy?: 'expiryDate' | 'name' +} + +type AllParams = { + type: 'all' + orderBy?: 'labelName' | 'creationDate' + page?: never + pageSize?: never +} + +type Params = BaseParams & + (RegistrantParams | OwnerParams | WrappedOwnerParams | AllParams) + +const mapDomain = ({ name, ...domain }: Domain) => { + const decrypted = name ? decryptName(name) : undefined + return { + ...domain, + name: decrypted, + truncatedName: decrypted ? truncateFormat(decrypted) : undefined, + createdAt: new Date(parseInt(domain.createdAt) * 1000), + type: 'domain', + } +} + +const mapWrappedDomain = (wrappedDomain: WrappedDomain) => { + const domain = mapDomain(wrappedDomain.domain) as Omit< + ReturnType, + 'registration' + > & { + registration?: { + expiryDate: string | Date + registrationDate: string | Date + } + } + if (domain.registration) { + domain.registration = { + expiryDate: new Date( + parseInt(domain.registration.expiryDate as string) * 1000, + ), + registrationDate: new Date( + parseInt(domain.registration.registrationDate as string) * 1000, + ), + } + } + return { + expiryDate: new Date(parseInt(wrappedDomain.expiryDate) * 1000), + fuses: decodeFuses(wrappedDomain.fuses), + ...domain, + type: 'wrappedDomain', + } +} + +const mapRegistration = (registration: Registration) => { + const decrypted = decryptName(registration.domain.name!) + return { + expiryDate: new Date(parseInt(registration.expiryDate) * 1000), + registrationDate: new Date(parseInt(registration.registrationDate) * 1000), + ...registration.domain, + name: decrypted, + truncatedName: truncateFormat(decrypted), + type: 'registration', + } +} + +const getNames = async ( + { gqlInstance }: ENSArgs<'gqlInstance'>, + { + address: _address, + type, + page, + pageSize = 10, + orderDirection, + orderBy = 'labelName', + }: Params, +) => { + const address = _address.toLowerCase() + const client = gqlInstance.client! + const domainQueryData = ` + id + labelName + labelhash + name + isMigrated + parent { + name + } + ` + + let queryVars: object = {} + let finalQuery: string = '' + + if (type === 'all') { + finalQuery = gqlInstance.gql` + query getNames( + $id: ID! + $expiryDate: Int + ) { + account(id: $id) { + registrations( + first: 1000 + where: { expiryDate_gt: $expiryDate } + ) { + registrationDate + expiryDate + domain { + ${domainQueryData} + } + } + domains(first: 1000) { + ${domainQueryData} + createdAt + } + wrappedDomains(first: 1000) { + expiryDate + fuses + domain { + ${domainQueryData} + registration { + registrationDate + expiryDate + } + } + } + } + } + ` + queryVars = { + id: address, + expiryDate: Math.floor(Date.now() / 1000) - 90 * 24 * 60 * 60, + } + } else if (type === 'owner') { + if (typeof page !== 'number') { + finalQuery = gqlInstance.gql` + query getNames( + $id: ID! + $orderBy: Domain_orderBy + $orderDirection: OrderDirection + ) { + account(id: $id) { + domains(orderBy: $orderBy, orderDirection: $orderDirection) { + ${domainQueryData} + createdAt + } + } + } + ` + queryVars = { + id: address, + orderBy, + orderDirection, + } + } else { + finalQuery = gqlInstance.gql` + query getNames( + $id: ID! + $first: Int + $skip: Int + $orderBy: Domain_orderBy + $orderDirection: OrderDirection + ) { + account(id: $id) { + domains( + first: $first + skip: $skip + orderBy: $orderBy + orderDirection: $orderDirection + ) { + ${domainQueryData} + createdAt + } + } + } + ` + + queryVars = { + id: address, + first: pageSize, + skip: (page || 0) * pageSize, + orderBy, + orderDirection, + } + } + } else if (type === 'wrappedOwner') { + if (typeof page !== 'number') { + finalQuery = gqlInstance.gql` + query getNames( + $id: ID! + $orderBy: WrappedDomain_orderBy + $orderDirection: OrderDirection + $expiryDate: Int + ) { + account(id: $id) { + wrappedDomains( + orderBy: $orderBy + orderDirection: $orderDirection + where: { expiryDate_gt: $expiryDate } + ) { + expiryDate + fuses + domain { + ${domainQueryData} + createdAt + } + } + } + } + ` + + queryVars = { + id: address, + expiryDate: Math.floor(Date.now() / 1000) - 90 * 24 * 60 * 60, + } + } else { + finalQuery = gqlInstance.gql` + query getNames( + $id: ID! + $first: Int + $skip: Int + $orderBy: WrappedDomain_orderBy + $orderDirection: OrderDirection + ) { + account(id: $id) { + wrappedDomains( + first: $first + skip: $skip + orderBy: $orderBy + orderDirection: $orderDirection + ) { + expiryDate + fuses + domain { + ${domainQueryData} + createdAt + } + } + } + } + ` + + queryVars = { + id: address, + first: pageSize, + skip: (page || 0) * pageSize, + orderBy: orderBy === 'labelName' ? 'name' : orderBy, + orderDirection, + } + } + } else if (typeof page !== 'number') { + finalQuery = gqlInstance.gql` + query getNames( + $id: ID! + $orderBy: Registration_orderBy + $orderDirection: OrderDirection + $expiryDate: Int + ) { + account(id: $id) { + registrations( + orderBy: $orderBy + orderDirection: $orderDirection + where: { expiryDate_gt: $expiryDate } + ) { + registrationDate + expiryDate + domain { + ${domainQueryData} + } + } + } + } + ` + + queryVars = { + id: address, + orderBy, + orderDirection, + expiryDate: Math.floor(Date.now() / 1000) - 90 * 24 * 60 * 60, + } + } else { + finalQuery = gqlInstance.gql` + query getNames( + $id: ID! + $first: Int + $skip: Int + $orderBy: Registration_orderBy + $orderDirection: OrderDirection + $expiryDate: Int + ) { + account(id: $id) { + registrations( + first: $first + skip: $skip + orderBy: $orderBy + orderDirection: $orderDirection + where: { expiryDate_gt: $expiryDate } + ) { + registrationDate + expiryDate + domain { + ${domainQueryData} + } + } + } + } + ` + + queryVars = { + id: address, + first: pageSize, + skip: (page || 0) * pageSize, + orderBy, + orderDirection, + expiryDate: Math.floor(Date.now() / 1000) - 90 * 24 * 60 * 60, + } + } + + const response = await client.request(finalQuery, queryVars) + const account = response?.account + if (type === 'all') { + return [ + ...(account?.domains.map(mapDomain) || []), + ...(account?.registrations.map(mapRegistration) || []), + ...(account?.wrappedDomains.map(mapWrappedDomain) || []), + ].sort((a, b) => { + if (orderDirection === 'desc') { + if (orderBy === 'labelName') { + return b.name.localeCompare(a.name) + } + return b.createdAt.getTime() - a.createdAt.getTime() + } + if (orderBy === 'labelName') { + return a.name.localeCompare(b.name) + } + return a.createdAt.getTime() - b.createdAt.getTime() + }) as Name[] + } + if (type === 'owner') { + return (account?.domains.map(mapDomain) || []) as Name[] + } + if (type === 'wrappedOwner') { + return (account?.wrappedDomains.map(mapWrappedDomain) || []) as Name[] + } + return (account?.registrations.map(mapRegistration) || []) as Name[] +} + +export default getNames diff --git a/.yalc/@ensdomains/ensjs/src/functions/getOwner.test.ts b/.yalc/@ensdomains/ensjs/src/functions/getOwner.test.ts new file mode 100644 index 000000000..bacb4680c --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getOwner.test.ts @@ -0,0 +1,79 @@ +import { JsonRpcProvider } from '@ethersproject/providers' +import { ENS } from '..' +import setup from '../tests/setup' + +let ensInstance: ENS +let revert: Awaited>['revert'] +let provider: JsonRpcProvider +let accounts: string[] + +beforeAll(async () => { + ;({ ensInstance, revert, provider } = await setup()) + accounts = await provider.listAccounts() +}) + +afterAll(async () => { + await revert() +}) + +describe('getOwner', () => { + it('should return correct ownership level and values for a wrapped .eth name', async () => { + const result = await ensInstance.getOwner('wrapped.eth') + expect(result).toEqual({ + ownershipLevel: 'nameWrapper', + owner: accounts[1], + expired: false, + }) + }) + it('should return correct ownership level and values for an expired wrapped .eth name', async () => { + const result = await ensInstance.getOwner('expired-wrapped.eth') + expect(result).toEqual({ + ownershipLevel: 'nameWrapper', + owner: '0x0000000000000000000000000000000000000000', + expired: true, + }) + }) + it('should return correct ownership level and values for an unwrapped .eth name', async () => { + const result = await ensInstance.getOwner('test123.eth') + expect(result).toEqual({ + ownershipLevel: 'registrar', + owner: accounts[1], + registrant: accounts[1], + expired: false, + }) + }) + it('should return correct ownership level and values for an expired unwrapped .eth name', async () => { + const result = await ensInstance.getOwner('expired.eth') + expect(result).toEqual({ + ownershipLevel: 'registrar', + owner: accounts[1], + registrant: accounts[1].toLowerCase(), + expired: true, + }) + }) + describe('subname', () => { + it('should return correct ownership level and values for a unwrapped name', async () => { + const result = await ensInstance.getOwner('test.with-subnames.eth') + expect(result).toEqual({ + ownershipLevel: 'registry', + owner: accounts[2], + }) + }) + it('should return correct ownership level and values for a wrapped name', async () => { + const result = await ensInstance.getOwner( + 'test.wrapped-with-subnames.eth', + ) + expect(result).toEqual({ + ownershipLevel: 'nameWrapper', + owner: accounts[2], + }) + }) + it('should return correct ownership level and values for an expired wrapped name', async () => { + const result = await ensInstance.getOwner('test.expired-wrapped.eth') + expect(result).toEqual({ + ownershipLevel: 'nameWrapper', + owner: accounts[2], + }) + }) + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/getOwner.ts b/.yalc/@ensdomains/ensjs/src/functions/getOwner.ts new file mode 100644 index 000000000..be2cd3086 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getOwner.ts @@ -0,0 +1,259 @@ +import { defaultAbiCoder } from '@ethersproject/abi/lib/abi-coder' +import type { Result } from '@ethersproject/abi/lib/coders/abstract-coder' +import { hexStripZeros } from '@ethersproject/bytes' +import { ENSArgs } from '..' +import { labelhash } from '../utils/labels' +import { namehash as makeNamehash } from '../utils/normalise' + +type Owner = { + registrant?: string + owner?: string + ownershipLevel: 'nameWrapper' | 'registry' | 'registrar' + expired?: boolean +} + +const singleContractOwnerRaw = async ( + { contracts }: ENSArgs<'contracts'>, + contract: 'nameWrapper' | 'registry' | 'registrar', + namehash: string, + labels: string[], +) => { + switch (contract) { + case 'nameWrapper': { + const nameWrapper = await contracts?.getNameWrapper()! + + return { + to: nameWrapper.address, + data: nameWrapper.interface.encodeFunctionData('ownerOf', [namehash]), + } + } + case 'registry': { + const registry = await contracts?.getRegistry()! + + return { + to: registry.address, + data: registry.interface.encodeFunctionData('owner', [namehash]), + } + } + case 'registrar': { + const registrar = await contracts?.getBaseRegistrar()! + + return { + to: registrar.address, + data: registrar.interface.encodeFunctionData('ownerOf', [ + labelhash(labels[0]), + ]), + } + } + // no default + } +} + +const raw = async ( + { contracts, multicallWrapper }: ENSArgs<'contracts' | 'multicallWrapper'>, + name: string, + contract?: 'nameWrapper' | 'registry' | 'registrar', +) => { + const namehash = makeNamehash(name) + const labels = name.split('.') + + if (contract || labels.length === 1) { + return singleContractOwnerRaw( + { contracts }, + contract || 'registry', + namehash, + labels, + ) + } + + const registryData = await singleContractOwnerRaw( + { contracts }, + 'registry', + namehash, + labels, + ) + const nameWrapperData = await singleContractOwnerRaw( + { contracts }, + 'nameWrapper', + namehash, + labels, + ) + const registrarData = await singleContractOwnerRaw( + { contracts }, + 'registrar', + namehash, + labels, + ) + + const data: { to: string; data: string }[] = [registryData, nameWrapperData] + + if (labels.length === 2 && labels[1] === 'eth') { + data.push(registrarData) + } + + return multicallWrapper.raw(data) +} + +const registrantQuery = ` + query GetRegistrant($namehash: String!) { + domain(id: $namehash) { + registration { + registrant { + id + } + } + } + } +` + +const singleContractOwnerDecode = (data: string) => + defaultAbiCoder.decode(['address'], data)[0] + +const decode = async ( + { + contracts, + multicallWrapper, + gqlInstance, + }: ENSArgs<'contracts' | 'multicallWrapper' | 'gqlInstance'>, + data: string, + name: string, + contract?: 'nameWrapper' | 'registry' | 'registrar', +): Promise => { + if (!data) return + const labels = name.split('.') + if (contract || labels.length === 1) { + const singleOwner = singleContractOwnerDecode(data) + const obj = { + ownershipLevel: contract || 'registry', + } + if (contract === 'registrar') { + return { + ...obj, + registrant: singleOwner as string, + } + } + return { + ...obj, + owner: singleOwner as string, + } + } + const result = await multicallWrapper.decode(data) + if (!result) return + const nameWrapper = await contracts?.getNameWrapper()! + + const decodedData = [result[0][1], result[1][1], result[2]?.[1]].map( + (ret) => ret && ret !== '0x' && defaultAbiCoder.decode(['address'], ret), + ) + + const registryOwner = (decodedData[0] as Result)[0] + const nameWrapperOwner = (decodedData[1] as Result)[0] + let registrarOwner: string | undefined = ( + decodedData[2] as Result | undefined + )?.[0] + let baseReturnObject: { + expired?: boolean + } = {} + + // check for only .eth names + if (labels[labels.length - 1] === 'eth') { + // if there is no registrar owner, the name is expired + // but we still want to get the registrar owner prior to expiry + if (labels.length === 2) { + if (!registrarOwner) { + const graphRegistrantResult = await gqlInstance.client.request( + registrantQuery, + { + namehash: makeNamehash(name), + }, + ) + registrarOwner = + graphRegistrantResult.domain?.registration?.registrant?.id + baseReturnObject = { + expired: true, + } + } else { + baseReturnObject = { + expired: false, + } + } + } + // if the owner on the registrar is the namewrapper, then the namewrapper owner is the owner + // there is no "registrant" for wrapped names + if (registrarOwner?.toLowerCase() === nameWrapper.address.toLowerCase()) { + return { + owner: nameWrapperOwner, + ownershipLevel: 'nameWrapper', + ...baseReturnObject, + } + } + // if there is a registrar owner, then it's not a subdomain but we have also passed the namewrapper clause + // this means that it's an unwrapped second-level name + // the registrant is the owner of the NFT + // the owner is the controller of the records + if (registrarOwner) { + return { + registrant: registrarOwner, + owner: registryOwner, + ownershipLevel: 'registrar', + ...baseReturnObject, + } + } + if (hexStripZeros(registryOwner) !== '0x') { + // if there is no registrar owner, but the label length is two, then the domain is an expired 2LD .eth + // so we still want to return the ownership values + if (labels.length === 2) { + return { + registrant: undefined, + owner: registryOwner, + ownershipLevel: 'registrar', + expired: true, + } + } + // this means that the subname is wrapped + if ( + registryOwner === nameWrapper.address && + nameWrapperOwner && + hexStripZeros(nameWrapperOwner) !== '0x' + ) { + return { + owner: nameWrapperOwner, + ownershipLevel: 'nameWrapper', + } + } + // unwrapped subnames do not have NFTs associated, so do not have a registrant + return { + owner: registryOwner, + ownershipLevel: 'registry', + } + } + // .eth names with no registrar owner are either unregistered or expired + return + } + + // non .eth names inherit the owner from the registry + // there will only ever be an owner for non .eth names, not a registrant + // this is because for unwrapped names, there is no associated NFT + // and for wrapped names, owner and registrant are the same thing + if ( + registryOwner === nameWrapper.address && + nameWrapperOwner && + hexStripZeros(nameWrapperOwner) !== '0x' + ) { + return { + owner: nameWrapperOwner, + ownershipLevel: 'nameWrapper', + } + } + + // for unwrapped non .eth names, the owner is the registry owner + if (hexStripZeros(registryOwner) !== '0x') { + return { + owner: registryOwner, + ownershipLevel: 'registry', + } + } + + // for anything else, return + return +} +export default { raw, decode } diff --git a/.yalc/@ensdomains/ensjs/src/functions/getPrice.test.ts b/.yalc/@ensdomains/ensjs/src/functions/getPrice.test.ts new file mode 100644 index 000000000..657a63ba9 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getPrice.test.ts @@ -0,0 +1,55 @@ +import { BigNumber } from 'ethers' +import { ENS } from '..' +import setup from '../tests/setup' + +let ensInstance: ENS + +beforeAll(async () => { + ;({ ensInstance } = await setup()) +}) + +const yearCost = BigNumber.from('8561643835626') + +describe('getPrice', () => { + it('should return a base and premium price for a name', async () => { + const { base, premium } = (await ensInstance.getPrice( + 'test123', + 86400, + false, + ))! + expect(base.eq(yearCost)).toBe(true) + expect(premium.toNumber()).toBe(0) + }) + + it('should return a base and premium price for an array of names', async () => { + const { base, premium } = (await ensInstance.getPrice( + ['test123', 'to-be-renewed'], + 86400, + false, + ))! + expect(base.eq(yearCost.mul(2))).toBe(true) + expect(premium.toNumber()).toBe(0) + }) + + describe('legacy mode', () => { + it('should return a base and premium price for a name', async () => { + const { base, premium } = (await ensInstance.getPrice( + 'test123', + 86400, + true, + ))! + expect(base.eq(yearCost)).toBe(true) + expect(premium.toNumber()).toBe(0) + }) + + it('should return a base and premium price for an array of names', async () => { + const { base, premium } = (await ensInstance.getPrice( + ['test123', 'to-be-renewed'], + 86400, + true, + ))! + expect(base.eq(yearCost.mul(2))).toBe(true) + expect(premium.toNumber()).toBe(0) + }) + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/getPrice.ts b/.yalc/@ensdomains/ensjs/src/functions/getPrice.ts new file mode 100644 index 000000000..295cd1f4a --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getPrice.ts @@ -0,0 +1,124 @@ +import { defaultAbiCoder } from '@ethersproject/abi/lib/abi-coder' +import { BigNumber } from '@ethersproject/bignumber/lib/bignumber' +import { ENSArgs } from '..' + +const raw = async ( + { contracts, multicallWrapper }: ENSArgs<'contracts' | 'multicallWrapper'>, + nameOrNames: string | string[], + duration: number, + legacy?: boolean, +) => { + const names = Array.isArray(nameOrNames) ? nameOrNames : [nameOrNames] + + if (names.length > 1) { + const bulkRenewal = await contracts?.getBulkRenewal()! + const baseCall = { + to: bulkRenewal.address, + data: bulkRenewal.interface.encodeFunctionData('rentPrice', [ + names, + duration, + ]), + } + + if (legacy) { + return multicallWrapper.raw([ + baseCall, + { + to: bulkRenewal.address, + data: bulkRenewal.interface.encodeFunctionData('rentPrice', [ + names, + 0, + ]), + }, + ]) + } + + return baseCall + } + + const controller = await contracts?.getEthRegistrarController()! + + const baseCall = { + to: controller.address, + data: controller.interface.encodeFunctionData('rentPrice', [ + names[0], + duration, + ]), + } + + if (legacy) { + return multicallWrapper.raw([ + baseCall, + { + to: controller.address, + data: controller.interface.encodeFunctionData('rentPrice', [ + names[0], + 0, + ]), + }, + ]) + } + return baseCall +} + +const decode = async ( + { contracts, multicallWrapper }: ENSArgs<'contracts' | 'multicallWrapper'>, + data: string, + _nameOrNames: string | string[], + _duration: number, + legacy?: boolean, +) => { + if (data === null) return + try { + let base: BigNumber + let premium: BigNumber + + const isBulkRenewal = Array.isArray(_nameOrNames) && _nameOrNames.length > 1 + if (isBulkRenewal && legacy) { + const result = await multicallWrapper.decode(data) + const [price] = defaultAbiCoder.decode( + ['uint256'], + result[0].returnData, + ) as [BigNumber] + ;[premium] = defaultAbiCoder.decode( + ['uint256'], + result[1].returnData, + ) as [BigNumber] + base = price.sub(premium) + } else if (isBulkRenewal) { + const bulkRenewal = await contracts?.getBulkRenewal()! + const result = bulkRenewal.interface.decodeFunctionResult( + 'rentPrice', + data, + ) + ;[base] = result + premium = BigNumber.from(0) + } else if (!isBulkRenewal && legacy) { + const result = await multicallWrapper.decode(data) + const [price] = defaultAbiCoder.decode( + ['uint256'], + result[0].returnData, + ) as [BigNumber] + ;[premium] = defaultAbiCoder.decode( + ['uint256'], + result[1].returnData, + ) as [BigNumber] + base = price.sub(premium) + } else { + const controller = await contracts?.getEthRegistrarController()! + const result = controller.interface.decodeFunctionResult( + 'rentPrice', + data, + ) + ;[base, premium] = result[0] as [BigNumber, BigNumber] + } + return { + base, + premium, + } + } catch { + return + } +} + +export default { raw, decode } diff --git a/.yalc/@ensdomains/ensjs/src/functions/getProfile-ccip.test.ts b/.yalc/@ensdomains/ensjs/src/functions/getProfile-ccip.test.ts new file mode 100644 index 000000000..b7fc61337 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getProfile-ccip.test.ts @@ -0,0 +1,29 @@ +import dotenv from 'dotenv' +import { ENS } from '..' +import setup from '../tests/setup' + +dotenv.config() + +let ensInstance: ENS + +beforeAll(async () => { + ;({ ensInstance } = await setup(true)) +}) + +jest.setTimeout(20000) + +describe('getProfile', () => { + it('should return a profile from a ccip-read name', async () => { + const result = await ensInstance.getProfile('1.offchainexample.eth', { + fallback: { + texts: ['email', 'description'], + contentHash: true, + coinTypes: ['0', '60'], + }, + }) + expect(result).toBeTruthy() + if (result) { + expect(result.address).toBe('0x41563129cDbbD0c5D3e1c86cf9563926b243834d') + } + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/getProfile.test.ts b/.yalc/@ensdomains/ensjs/src/functions/getProfile.test.ts new file mode 100644 index 000000000..bb60fe896 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getProfile.test.ts @@ -0,0 +1,219 @@ +import dotenv from 'dotenv' +import { ethers } from 'ethers' +import { ENS } from '..' +import setup, { deploymentAddresses } from '../tests/setup' + +dotenv.config() + +let ensInstance: ENS +let revert: Awaited>['revert'] +let provider: ethers.providers.JsonRpcProvider +let accounts: string[] + +beforeAll(async () => { + ;({ ensInstance, revert, provider } = await setup()) + accounts = await provider.listAccounts() +}) + +beforeEach(async () => { + await revert() +}) + +afterAll(async () => { + await revert() +}) + +const checkRecords = ( + result: Record | undefined, + textLength = 3, + coinTypeLength = 3, +) => { + expect(result).toBeDefined() + if (result) { + expect(result.records?.texts).toHaveLength(textLength) + expect(result.records?.coinTypes).toHaveLength(coinTypeLength) + expect(result.resolverAddress).toBe( + deploymentAddresses.LegacyPublicResolver, + ) + } +} + +jest.setTimeout(20000) + +describe('getProfile', () => { + describe('with an address', () => { + it('should return a profile object with no other args', async () => { + const result = await ensInstance.getProfile( + '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + ) + expect(result).toBeDefined() + if (result) { + expect((result as any).name).toBe('with-profile.eth') + expect((result as any).address).toBeUndefined() + checkRecords(result) + } + }) + it('should return a profile object with specified records', async () => { + const result = await ensInstance.getProfile( + '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + { texts: ['description', 'url'], coinTypes: ['ETC_LEGACY', '0'] }, + ) + expect(result).toBeDefined() + if (result) { + expect((result as any).name).toBe('with-profile.eth') + expect((result as any).address).toBeUndefined() + checkRecords(result, 2, 3) + } + }) + it('should return a profile object with all of each specified record type', async () => { + const result = await ensInstance.getProfile( + '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + { texts: true, coinTypes: true }, + ) + checkRecords(result) + }) + it('should return null for an address without a name', async () => { + const result = await ensInstance.getProfile( + '0x8e8db5ccef88cca9d624701db544989c996e3216', + ) + expect(result).toBeUndefined() + }) + }) + describe('with a name', () => { + it('should return a profile object with no other args', async () => { + const result = await ensInstance.getProfile('with-profile.eth') + expect((result as any).address).toBe( + '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + ) + checkRecords(result) + }) + it('should return a profile object with specified records', async () => { + const result = await ensInstance.getProfile('with-profile.eth', { + texts: ['description', 'url'], + coinTypes: ['ETC_LEGACY', '0'], + }) + expect((result as any).address).toBe( + '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + ) + checkRecords(result, 2, 3) + }) + it('should return a profile object with all of each specified record type', async () => { + const result = await ensInstance.getProfile('with-profile.eth', { + texts: true, + coinTypes: true, + }) + checkRecords(result) + }) + it('should return a profile object for a specified resolver', async () => { + const tx = await ensInstance.wrapName('test123.eth', { + wrappedOwner: accounts[1], + addressOrIndex: 1, + }) + await tx.wait() + const result = await ensInstance.getProfile('test123.eth', { + resolverAddress: deploymentAddresses.LegacyPublicResolver, + }) + expect(result).toBeDefined() + expect(result?.address).toBe(accounts[1]) + expect(result?.resolverAddress).toBe( + deploymentAddresses.LegacyPublicResolver, + ) + }) + it('should return undefined for an unregistered name', async () => { + const result = await ensInstance.getProfile('test123123123cool.eth') + expect(result).toBeUndefined() + }) + }) + describe('with an old resolver', () => { + it('should use fallback methods for a name with an older resolver (no multicall)', async () => { + const result = await ensInstance.getProfile('with-legacy-resolver.eth') + expect(result).toBeDefined() + if (result) { + expect(result.address).toBe( + '0x70997970C51812dc3A010C7d01b50e0d17dc79C8', + ) + expect(result.resolverAddress).toBe( + deploymentAddresses.NoMulticallResolver, + ) + } + }) + }) + describe('with an unmigrated name', () => { + it('should return an object with isMigrated false and a message', async () => { + const result = await ensInstance.getProfile('legacy.test') + expect(result).toBeTruthy() + if (result) { + expect(result.isMigrated).toBe(false) + } + }) + }) + describe('with invalid resolver', () => { + it('should fail gracefully for a name with invalid resolver', async () => { + const tx = await ensInstance.setResolver('test123.eth', { + contract: 'registry', + resolver: '0xb794F5eA0ba39494cE839613fffBA74279579268', + addressOrIndex: 1, + }) + expect(tx).toBeTruthy() + await tx.wait() + const result = await ensInstance.getProfile('test123.eth') + expect(result).toBeDefined() + if (result) { + expect(result.address).toBeUndefined() + expect(Object.keys(result.records!).length).toBe(0) + expect(result.resolverAddress).toBe( + '0xb794F5eA0ba39494cE839613fffBA74279579268', + ) + expect(result.isInvalidResolverAddress).toBe(true) + } + }) + + it('should fail gracefully for a wrapped name with invalid resolver', async () => { + const tx = await ensInstance.setResolver('wrapped.eth', { + contract: 'nameWrapper', + resolver: '0xb794F5eA0ba39494cE839613fffBA74279579268', + addressOrIndex: 1, + }) + expect(tx).toBeTruthy() + await tx.wait() + const result = await ensInstance.getProfile('wrapped.eth') + expect(result).toBeDefined() + if (result) { + expect(result.address).toBeUndefined() + expect(Object.keys(result.records!).length).toBe(0) + expect(result.resolverAddress).toBe( + '0xb794F5eA0ba39494cE839613fffBA74279579268', + ) + expect(result.isInvalidResolverAddress).toBe(true) + } + }) + + it('should fail gracefully for name with invalid resolver option', async () => { + const result = await ensInstance.getProfile('test123.eth', { + resolverAddress: '0xb794F5eA0ba39494cE839613fffBA74279579268', + }) + expect(result).toBeDefined() + if (result) { + expect(result.address).toBeFalsy() + expect(Object.keys(result.records!).length).toBe(0) + expect(result.resolverAddress).toBe( + '0xb794F5eA0ba39494cE839613fffBA74279579268', + ) + } + }) + + it('should fail gracefully for wrapped name with invalid resolver option', async () => { + const result = await ensInstance.getProfile('wrapped.eth', { + resolverAddress: '0xb794F5eA0ba39494cE839613fffBA74279579268', + }) + expect(result).toBeDefined() + if (result) { + expect(result.address).toBeFalsy() + expect(Object.keys(result.records!).length).toBe(0) + expect(result.resolverAddress).toBe( + '0xb794F5eA0ba39494cE839613fffBA74279579268', + ) + } + }) + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/getProfile.ts b/.yalc/@ensdomains/ensjs/src/functions/getProfile.ts new file mode 100644 index 000000000..05c3d69d0 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getProfile.ts @@ -0,0 +1,681 @@ +import { formatsByName } from '@ensdomains/address-encoder' +import { defaultAbiCoder } from '@ethersproject/abi/lib/abi-coder' +import { hexStripZeros, isBytesLike } from '@ethersproject/bytes' +import { ENSArgs } from '..' +import { decodeContenthash, DecodedContentHash } from '../utils/contentHash' +import { hexEncodeName } from '../utils/hexEncodedName' +import { namehash } from '../utils/normalise' +import { parseInputType } from '../utils/validation' + +type InternalProfileOptions = { + contentHash?: boolean | string | DecodedContentHash + texts?: string[] + coinTypes?: string[] +} + +type ProfileResponse = { + contentHash?: string | DecodedContentHash + texts?: string[] + coinTypes?: string[] +} + +type FallbackRecords = { + contentHash?: boolean + texts?: string[] + coinTypes?: string[] +} + +type DataItem = { + key: string | number + type: 'addr' | 'text' | 'contentHash' + coin?: string + value: string +} + +type ResolvedProfile = { + isMigrated: boolean | null + createdAt: string | null + address?: string + name?: string | null + match?: boolean + message?: string + records?: { + contentHash?: DecodedContentHash | string | null + texts?: DataItem[] + coinTypes?: DataItem[] + } + resolverAddress?: string + isInvalidResolverAddress?: boolean + reverseResolverAddress?: string +} + +type CallObj = { + key: string + data: { + to: string + data: string + } + type: 'addr' | 'text' | 'contentHash' +} + +const makeMulticallData = async ( + { + _getAddr, + _getContentHash, + _getText, + }: ENSArgs<'_getText' | '_getAddr' | '_getContentHash'>, + name: string, + options: InternalProfileOptions, +) => { + let calls: (CallObj | null)[] = [] + if (options.texts) + calls = [ + ...calls, + ...(await Promise.all( + options.texts.map(async (x) => ({ + key: x, + data: await _getText.raw(name, x), + type: 'text' as const, + })), + )), + ] + + if (options.coinTypes) + calls = [ + ...calls, + ...(await Promise.all( + options.coinTypes.map(async (x) => ({ + key: x, + data: await _getAddr.raw(name, x, true), + type: 'addr' as const, + })), + )), + ] + + if (typeof options.contentHash === 'boolean' && options.contentHash) { + calls.push({ + key: 'contentHash', + data: await _getContentHash.raw(name), + type: 'contentHash' as const, + }) + } + + if (!calls.find((x) => x!.key === '60')) { + calls.push({ + key: '60', + data: await _getAddr.raw(name, '60', true), + type: 'addr' as const, + }) + } + + return { data: calls.map((x) => x!.data.data), calls } +} + +const fetchWithoutResolverMulticall = async ( + { multicallWrapper }: ENSArgs<'multicallWrapper'>, + calls: { + key: string | number + data: { + to: string + data: string + } + type: 'addr' | 'text' | 'contentHash' + }[], + resolverAddress: string, +) => { + const callsWithResolver = calls.map((call) => ({ + to: resolverAddress, + data: call.data.data, + })) + + const results = await multicallWrapper(callsWithResolver) + + if (!results || !results.length) return [] + + return results.map((x: [boolean, string]) => x[1]) +} + +const formatRecords = async ( + { + _getText, + _getAddr, + _getContentHash, + }: ENSArgs<'_getText' | '_getAddr' | '_getContentHash'>, + data: any[], + calls: any[], + options: InternalProfileOptions, +) => { + const returnedRecords: DataItem[] = ( + await Promise.all( + data.map(async (item: string, i: number) => { + let decodedFromAbi: any + let itemRet: Record = { + key: calls[i].key, + type: calls[i].type, + } + if (itemRet.type === 'contentHash') { + ;[decodedFromAbi] = defaultAbiCoder.decode(['bytes'], item) + if (hexStripZeros(decodedFromAbi) === '0x') { + return + } + } + switch (calls[i].type) { + case 'text': + itemRet = { + ...itemRet, + value: await _getText.decode(item), + } + if (itemRet.value === '' || itemRet.value === undefined) return + break + case 'addr': + try { + const addr = await _getAddr.decode(item, '', calls[i].key) + if (addr) { + itemRet = { + ...itemRet, + ...addr, + } + break + } else { + return + } + } catch { + return + } + case 'contentHash': + try { + itemRet = { + ...itemRet, + value: await _getContentHash.decode(item), + } + break + } catch { + return + } + // no default + } + return itemRet + }), + ) + ) + .filter((x): x is DataItem => { + return typeof x === 'object' + }) + .filter((x) => x) + + const returnedResponse: { + contentHash?: string | null | DecodedContentHash + coinTypes?: DataItem[] + texts?: DataItem[] + } = {} + + if ( + typeof options.contentHash === 'string' || + typeof options.contentHash === 'object' + ) { + if ( + typeof options.contentHash === 'string' && + hexStripZeros(options.contentHash) === '0x' + ) { + returnedResponse.contentHash = null + } else if ( + isBytesLike((options.contentHash as any).decoded) && + hexStripZeros((options.contentHash as any).decoded) === '0x' + ) { + returnedResponse.contentHash = null + } else { + returnedResponse.contentHash = options.contentHash + } + } else if (options.contentHash) { + const foundRecord = returnedRecords.find( + (item: any) => item.type === 'contentHash', + ) + returnedResponse.contentHash = foundRecord ? foundRecord.value : null + } + if (options.texts) { + returnedResponse.texts = returnedRecords.filter( + (x: any) => x.type === 'text', + ) + } + if (options.coinTypes) { + returnedResponse.coinTypes = returnedRecords.filter( + (x: any) => x.type === 'addr', + ) + } + return returnedResponse +} + +const getDataForName = async ( + { + contracts, + _getAddr, + _getContentHash, + _getText, + multicallWrapper, + }: ENSArgs< + | 'contracts' + | '_getText' + | '_getAddr' + | '_getContentHash' + | 'resolverMulticallWrapper' + | 'multicallWrapper' + >, + name: string, + options: InternalProfileOptions, + specificResolver?: string, +) => { + const universalResolver = await contracts?.getUniversalResolver()! + + const { data, calls } = await makeMulticallData( + { _getAddr, _getContentHash, _getText }, + name, + options, + ) + + let recordData: (string | null)[] | undefined + let resolverAddress: string | undefined = specificResolver + + if (specificResolver) { + try { + const publicResolver = await contracts?.getPublicResolver( + undefined, + specificResolver, + ) + recordData = await publicResolver?.callStatic.multicall(data) + } catch (e: any) { + console.error('getProfile error:', e) + recordData = await fetchWithoutResolverMulticall( + { multicallWrapper }, + calls as CallObj[], + resolverAddress!, + ) + } + } else { + try { + const resolvedData = await universalResolver['resolve(bytes,bytes[])']( + hexEncodeName(name), + data, + { + ccipReadEnabled: true, + }, + ) + recordData = [...resolvedData['0']] + resolverAddress = resolvedData['1'] + for (let i = 0; i < recordData.length; i += 1) { + // error code for reverted call in batch + // this is expected when using offchain resolvers, so should be ignored + if (recordData[i]!.startsWith('0x0d1947a9')) { + calls[i] = null + recordData[i] = null + } + } + } catch { + const registryContract = await contracts?.getRegistry() + resolverAddress = await registryContract?.resolver(namehash(name)) + return { + address: undefined, + records: {}, + resolverAddress, + isInvalidResolverAddress: true, + } + } + } + if ( + !resolverAddress || + !recordData || + hexStripZeros(resolverAddress) === '0x' + ) { + return { + address: undefined, + records: {}, + resolverAddress: undefined, + } + } + + const filteredCalls = calls.filter((x) => x) as CallObj[] + const filteredRecordData = recordData.filter((x) => x) + + const matchAddress = + filteredRecordData[filteredCalls.findIndex((x) => x.key === '60')] + + return { + address: + matchAddress && (await _getAddr.decode(matchAddress).catch(() => false)), + records: await formatRecords( + { _getAddr, _getContentHash, _getText }, + filteredRecordData, + filteredCalls, + options, + ), + resolverAddress, + } +} + +const graphFetch = async ( + { gqlInstance }: ENSArgs<'gqlInstance'>, + name: string, + wantedRecords?: ProfileOptions, + resolverAddress?: string, +) => { + const query = gqlInstance.gql` + query getRecords($id: String!) { + domain(id: $id) { + isMigrated + createdAt + resolver { + texts + coinTypes + contentHash + addr { + id + } + } + } + } + ` + + const customResolverQuery = gqlInstance.gql` + query getRecordsWithCustomResolver($id: String!, $resolverId: String!) { + domain(id: $id) { + isMigrated + createdAt + } + resolver(id: $resolverId) { + texts + coinTypes + contentHash + addr { + id + } + } + } + ` + + const { client } = gqlInstance + + const id = namehash(name) + + let domain: any + let resolverResponse: any + + if (!resolverAddress) { + const response = await client.request(query, { id }) + domain = response?.domain + resolverResponse = domain?.resolver + } else { + const resolverId = `${resolverAddress.toLowerCase()}-${id}` + const response = await client.request(customResolverQuery, { + id, + resolverId, + }) + resolverResponse = response?.resolver + domain = response?.domain + } + + if (!domain) return + + const { isMigrated, createdAt } = domain + + const returnedRecords: ProfileResponse = {} + + if (!resolverResponse || !wantedRecords) return { isMigrated, createdAt } + + Object.keys(wantedRecords).forEach((key: string) => { + const data = wantedRecords[key as keyof ProfileOptions] + if (typeof data === 'boolean' && data) { + if (key === 'contentHash') { + returnedRecords[key] = decodeContenthash(resolverResponse.contentHash) + } else { + returnedRecords[key as keyof ProfileOptions] = resolverResponse[key] + } + } + }) + + return { + ...returnedRecords, + isMigrated, + createdAt, + } +} + +type ProfileOptions = { + contentHash?: boolean + texts?: boolean | string[] + coinTypes?: boolean | string[] +} + +type InputProfileOptions = ProfileOptions & { + resolverAddress?: string + fallback?: FallbackRecords +} + +const getProfileFromName = async ( + { + contracts, + gqlInstance, + _getAddr, + _getContentHash, + _getText, + resolverMulticallWrapper, + multicallWrapper, + }: ENSArgs< + | 'contracts' + | 'gqlInstance' + | '_getText' + | '_getAddr' + | '_getContentHash' + | 'resolverMulticallWrapper' + | 'multicallWrapper' + >, + name: string, + options?: InputProfileOptions, +): Promise => { + const { resolverAddress, fallback, ..._options } = options || {} + const optsLength = Object.keys(_options).length + let usingOptions: InputProfileOptions | undefined + if (!optsLength || _options?.texts === true || _options?.coinTypes === true) { + if (optsLength) usingOptions = _options + else usingOptions = { contentHash: true, texts: true, coinTypes: true } + } + + const graphResult = await graphFetch( + { gqlInstance }, + name, + usingOptions, + resolverAddress, + ) + let isMigrated: boolean | null = null + let createdAt: string | null = null + let result: Awaited> | null = null + if (!graphResult) { + if (!fallback) return + result = await getDataForName( + { + contracts, + _getAddr, + _getContentHash, + _getText, + resolverMulticallWrapper, + multicallWrapper, + }, + name, + fallback, + undefined, + ) + } else { + const { + isMigrated: _isMigrated, + createdAt: _createdAt, + ...wantedRecords + }: { + isMigrated: boolean + createdAt: string + } & InternalProfileOptions = graphResult + isMigrated = _isMigrated + createdAt = _createdAt + let recordsWithFallback = usingOptions + ? wantedRecords + : (_options as InternalProfileOptions) + if ( + (Object.keys(recordsWithFallback).length === 0 || + (!recordsWithFallback.coinTypes && + !recordsWithFallback.texts && + Object.keys(recordsWithFallback.contentHash || {}).length === 0)) && + fallback + ) { + recordsWithFallback = fallback + } + result = await getDataForName( + { + contracts, + _getAddr, + _getContentHash, + _getText, + resolverMulticallWrapper, + multicallWrapper, + }, + name, + recordsWithFallback, + options?.resolverAddress!, + ) + } + if (!result?.resolverAddress) + return { + isMigrated, + createdAt, + message: !result + ? "Records fetch didn't complete" + : "Name doesn't have a resolver", + } + return { ...result, isMigrated, createdAt, message: undefined } +} + +const getProfileFromAddress = async ( + { + contracts, + gqlInstance, + getName, + _getAddr, + _getContentHash, + _getText, + resolverMulticallWrapper, + multicallWrapper, + }: ENSArgs< + | 'contracts' + | 'gqlInstance' + | 'getName' + | '_getText' + | '_getAddr' + | '_getContentHash' + | 'resolverMulticallWrapper' + | 'multicallWrapper' + >, + address: string, + options?: InputProfileOptions, +) => { + let name + try { + name = await getName(address) + } catch (e) { + return + } + if (!name || !name.name || name.name === '') return + if (!name.match) return { ...name, isMigrated: null, createdAt: null } + const result = await getProfileFromName( + { + contracts, + gqlInstance, + _getAddr, + _getContentHash, + _getText, + resolverMulticallWrapper, + multicallWrapper, + }, + name.name, + options, + ) + if (!result || result.message) return + delete (result as any).address + return { + ...result, + ...name, + message: undefined, + } +} + +const mapCoinTypes = (coin: string) => { + if (!Number.isNaN(parseInt(coin))) { + return coin + } + return `${formatsByName[coin.toUpperCase()].coinType}` +} + +export default async function ( + { + contracts, + gqlInstance, + getName, + _getAddr, + _getContentHash, + _getText, + resolverMulticallWrapper, + multicallWrapper, + }: ENSArgs< + | 'contracts' + | 'gqlInstance' + | 'getName' + | '_getText' + | '_getAddr' + | '_getContentHash' + | 'resolverMulticallWrapper' + | 'multicallWrapper' + >, + nameOrAddress: string, + options?: InputProfileOptions, +): Promise { + if (options) { + if (options.coinTypes && typeof options.coinTypes !== 'boolean') { + options.coinTypes = options.coinTypes.map(mapCoinTypes) + } + if (options.fallback && options.fallback.coinTypes) { + options.fallback.coinTypes = options.fallback.coinTypes.map(mapCoinTypes) + } + } + + const inputType = parseInputType(nameOrAddress) + + if (inputType.type === 'unknown' || inputType.info === 'unsupported') { + throw new Error('Invalid input type') + } + + if (inputType.type === 'address') { + return getProfileFromAddress( + { + contracts, + gqlInstance, + getName, + _getAddr, + _getContentHash, + _getText, + resolverMulticallWrapper, + multicallWrapper, + }, + nameOrAddress, + options, + ) + } + + return getProfileFromName( + { + contracts, + gqlInstance, + _getAddr, + _getContentHash, + _getText, + resolverMulticallWrapper, + multicallWrapper, + }, + nameOrAddress, + options, + ) +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/getRecords.ts b/.yalc/@ensdomains/ensjs/src/functions/getRecords.ts new file mode 100644 index 000000000..ea62e3eec --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getRecords.ts @@ -0,0 +1,23 @@ +import { ENSArgs } from '..' +import { parseInputType } from '../utils/validation' + +type ProfileOptions = { + contentHash?: boolean + texts?: boolean | string[] + coinTypes?: boolean | string[] + resolverAddress?: string +} + +export default async function ( + { getProfile }: ENSArgs<'getProfile'>, + name: string, + options?: ProfileOptions, +) { + const inputType = parseInputType(name) + + if (inputType.type !== 'name' && inputType.type !== 'label') { + throw new Error('Input must be an ENS name') + } + + return getProfile(name, options) +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/getResolver.test.ts b/.yalc/@ensdomains/ensjs/src/functions/getResolver.test.ts new file mode 100644 index 000000000..12fd6c345 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getResolver.test.ts @@ -0,0 +1,15 @@ +import { ENS } from '..' +import setup, { deploymentAddresses } from '../tests/setup' + +let ensInstance: ENS + +beforeAll(async () => { + ;({ ensInstance } = await setup()) +}) + +describe('getResolver', () => { + it('should find the resolver for a name with a resolver', async () => { + const result = await ensInstance.getResolver('with-profile.eth') + expect(result).toBe(deploymentAddresses.LegacyPublicResolver) + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/getResolver.ts b/.yalc/@ensdomains/ensjs/src/functions/getResolver.ts new file mode 100644 index 000000000..ba91828f6 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getResolver.ts @@ -0,0 +1,28 @@ +import { hexStripZeros } from '@ethersproject/bytes' +import { ENSArgs } from '..' +import { hexEncodeName } from '../utils/hexEncodedName' + +const raw = async ({ contracts }: ENSArgs<'contracts'>, name: string) => { + const universalResolver = await contracts?.getUniversalResolver()! + return { + to: universalResolver.address, + data: universalResolver.interface.encodeFunctionData('findResolver', [ + hexEncodeName(name), + ]), + } +} + +const decode = async ({ contracts }: ENSArgs<'contracts'>, data: string) => { + const universalResolver = await contracts?.getUniversalResolver()! + const response = universalResolver.interface.decodeFunctionResult( + 'findResolver', + data, + ) + + if (!response || !response[0] || hexStripZeros(response[0]) === '0x') { + return + } + return response[0] +} + +export default { raw, decode } diff --git a/.yalc/@ensdomains/ensjs/src/functions/getSpecificRecord.test.ts b/.yalc/@ensdomains/ensjs/src/functions/getSpecificRecord.test.ts new file mode 100644 index 000000000..7d7a5efad --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getSpecificRecord.test.ts @@ -0,0 +1,241 @@ +import { ENS } from '..' +import setup from '../tests/setup' + +let ensInstance: ENS + +beforeAll(async () => { + ;({ ensInstance } = await setup()) +}) + +const dummyABI = [ + { + type: 'event', + anonymous: false, + name: 'ABIChanged', + inputs: [ + { + type: 'bytes32', + indexed: true, + }, + { + type: 'uint256', + indexed: true, + }, + ], + }, + { + type: 'event', + anonymous: false, + name: 'VersionChanged', + inputs: [ + { + type: 'bytes32', + indexed: true, + }, + { + type: 'uint64', + }, + ], + }, + { + type: 'function', + name: 'ABI', + constant: true, + stateMutability: 'view', + payable: false, + inputs: [ + { + type: 'bytes32', + }, + { + type: 'uint256', + }, + ], + outputs: [ + { + type: 'uint256', + }, + { + type: 'bytes', + }, + ], + }, + { + type: 'function', + name: 'clearRecords', + constant: false, + payable: false, + inputs: [ + { + type: 'bytes32', + }, + ], + outputs: [], + }, + { + type: 'function', + name: 'recordVersions', + constant: true, + stateMutability: 'view', + payable: false, + inputs: [ + { + type: 'bytes32', + }, + ], + outputs: [ + { + type: 'uint64', + }, + ], + }, + { + type: 'function', + name: 'setABI', + constant: false, + payable: false, + inputs: [ + { + type: 'bytes32', + }, + { + type: 'uint256', + }, + { + type: 'bytes', + }, + ], + outputs: [], + }, + { + type: 'function', + name: 'supportsInterface', + constant: true, + stateMutability: 'view', + payable: false, + inputs: [ + { + type: 'bytes4', + }, + ], + outputs: [ + { + type: 'bool', + }, + ], + }, +] + +describe('getSpecificRecord', () => { + describe('getContentHash', () => { + it('should return null for a non-existent name', async () => { + const result = await ensInstance.getContentHash('test123123cool.eth') + expect(result).toBeUndefined() + }) + it('should return null for a name with no contenthash record', async () => { + const result = await ensInstance.getContentHash('with-profile.eth') + expect(result).toBeUndefined() + }) + it('should return the contenthash for a name with the record set', async () => { + const result = await ensInstance.getContentHash('with-contenthash.eth') + expect(result).toMatchObject({ + protocolType: 'ipfs', + decoded: 'bafybeico3uuyj3vphxpvbowchdwjlrlrh62awxscrnii7w7flu5z6fk77y', + error: undefined, + }) + }) + }) + + describe('getText', () => { + it('should return a record from a key', async () => { + const result = await ensInstance.getText( + 'with-profile.eth', + 'description', + ) + expect(result).toBe('Hello2') + }) + + it('should return null for a non-existent key', async () => { + const result = await ensInstance.getText( + 'with-profile.eth', + 'thiskeydoesntexist', + ) + expect(result).toBeUndefined() + }) + }) + + describe('getAddr', () => { + it('should return the ETH addr record if no coinType is provided', async () => { + const result = await ensInstance.getAddr('with-profile.eth') + expect(result).toBe('0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC') + }) + it('should return the correct address based on a coin ID input as a number', async () => { + const result = await ensInstance.getAddr('with-profile.eth', 61) + expect((result as any).addr).toBe( + '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + ) + expect((result as any).coin).toBe('ETC_LEGACY') + }) + it('should return the correct address based on a coin ID input as a string', async () => { + const result = await ensInstance.getAddr('with-profile.eth', '61') + expect((result as any).addr).toBe( + '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + ) + expect((result as any).coin).toBe('ETC_LEGACY') + }) + it('should return the correct address based on a coin name', async () => { + const result = await ensInstance.getAddr('with-profile.eth', 'ETC_LEGACY') + expect((result as any).addr).toBe( + '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + ) + expect((result as any).coin).toBe('ETC_LEGACY') + }) + it('should return null for a non-existent coin', async () => { + const result = await ensInstance.getAddr('with-profile.eth', 'BNB') + expect(result).toBeUndefined() + }) + }) + + describe('getABI', () => { + it('should return object for type 1 ABI', async () => { + const result = await ensInstance.getABI('with-type-1-abi.eth') + expect(result).toBeTruthy() + if (result) { + expect(result.contentType).toBe(1) + expect(result.decoded).toBe(true) + expect(result.abi).toMatchObject(dummyABI) + } + }) + it('should return object for type 2 ABI', async () => { + const result = await ensInstance.getABI('with-type-2-abi.eth') + expect(result).toBeTruthy() + if (result) { + expect(result.contentType).toBe(2) + expect(result.decoded).toBe(true) + expect(result.abi).toMatchObject(dummyABI) + } + }) + it('should return object for type 4 ABI', async () => { + const result = await ensInstance.getABI('with-type-4-abi.eth') + expect(result).toBeTruthy() + if (result) { + expect(result.contentType).toBe(4) + expect(result.decoded).toBe(true) + expect(result.abi).toMatchObject(dummyABI) + } + }) + it('should return unresolved URI for type 8 ABI', async () => { + const result = await ensInstance.getABI('with-type-8-abi.eth') + expect(result).toBeTruthy() + if (result) { + expect(result.contentType).toBe(8) + expect(result.decoded).toBe(false) + expect(result.abi).toBe('https://example.com') + } + }) + it('should return undefined if unsupported contentType', async () => { + const result = await ensInstance.getABI('with-type-256-abi.eth') + expect(result).toBeUndefined() + }) + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/getSpecificRecord.ts b/.yalc/@ensdomains/ensjs/src/functions/getSpecificRecord.ts new file mode 100644 index 000000000..c4a5db4e0 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getSpecificRecord.ts @@ -0,0 +1,330 @@ +import { formatsByCoinType, formatsByName } from '@ensdomains/address-encoder' +import { BigNumber } from '@ethersproject/bignumber' +import { arrayify, hexStripZeros, isBytesLike } from '@ethersproject/bytes' +import { toUtf8String } from '@ethersproject/strings' +import { ENSArgs } from '..' +import { decodeContenthash } from '../utils/contentHash' +import { namehash } from '../utils/normalise' + +export const _getContentHash = { + raw: async ({ contracts }: ENSArgs<'contracts'>, name: string) => { + const publicResolver = await contracts?.getPublicResolver()! + return { + to: '0x0000000000000000000000000000000000000000', + data: publicResolver.interface.encodeFunctionData('contenthash', [ + namehash(name), + ]), + } + }, + decode: async ({ contracts }: ENSArgs<'contracts'>, data: string) => { + let response: any + const publicResolver = await contracts?.getPublicResolver()! + try { + ;[response] = publicResolver.interface.decodeFunctionResult( + 'contenthash', + data, + ) + } catch { + return + } + + if (!response) { + return + } + + const decodedContent = decodeContenthash(response) + + if ( + !decodedContent || + (isBytesLike(decodedContent.decoded) && + hexStripZeros(decodedContent.decoded) === '0x') || + Object.keys(decodedContent).length === 0 + ) { + return + } + + return decodedContent + }, +} + +export const getContentHash = { + raw: async ( + { contracts, universalWrapper }: ENSArgs<'contracts' | 'universalWrapper'>, + name: string, + ) => { + const prData = await _getContentHash.raw({ contracts }, name) + return universalWrapper.raw(name, prData.data) + }, + decode: async ( + { contracts, universalWrapper }: ENSArgs<'contracts' | 'universalWrapper'>, + data: string, + ) => { + const urData = await universalWrapper.decode(data) + if (!urData) return + return _getContentHash.decode({ contracts }, urData.data) + }, +} + +export const _getText = { + raw: async ( + { contracts }: ENSArgs<'contracts'>, + name: string, + key: string, + ) => { + const publicResolver = await contracts?.getPublicResolver()! + return { + to: '0x0000000000000000000000000000000000000000', + data: publicResolver.interface.encodeFunctionData('text', [ + namehash(name), + key, + ]), + } + }, + decode: async ({ contracts }: ENSArgs<'contracts'>, data: string) => { + const publicResolver = await contracts?.getPublicResolver()! + const [response] = publicResolver.interface.decodeFunctionResult( + 'text', + data, + ) + if (!response) { + return + } + return response as string + }, +} + +export const getText = { + raw: async ( + { contracts, universalWrapper }: ENSArgs<'contracts' | 'universalWrapper'>, + name: string, + key: string, + ) => { + const prData = await _getText.raw({ contracts }, name, key) + return universalWrapper.raw(name, prData.data) + }, + decode: async ( + { contracts, universalWrapper }: ENSArgs<'contracts' | 'universalWrapper'>, + data: string, + ) => { + const urData = await universalWrapper.decode(data) + if (!urData) return + return _getText.decode({ contracts }, urData.data) + }, +} + +export const _getAddr = { + raw: async ( + { contracts }: ENSArgs<'contracts'>, + name: string, + coinType?: string | number, + bypassFormat?: boolean, + ) => { + if (!coinType) { + coinType = 60 + } + + const publicResolver = await contracts?.getPublicResolver()! + + if (coinType === 60 || coinType === '60') { + return { + to: '0x0000000000000000000000000000000000000000', + data: publicResolver.interface.encodeFunctionData('addr(bytes32)', [ + namehash(name), + ]), + } + } + + if (bypassFormat) { + return { + to: '0x0000000000000000000000000000000000000000', + data: publicResolver.interface.encodeFunctionData( + 'addr(bytes32,uint256)', + [namehash(name), coinType], + ), + } + } + const formatter = + typeof coinType === 'string' && Number.isNaN(parseInt(coinType)) + ? formatsByName[coinType] + : formatsByCoinType[ + typeof coinType === 'number' ? coinType : parseInt(coinType) + ] + + if (!formatter) { + throw new Error(`No formatter found for coin: ${coinType}`) + } + + return { + to: '0x0000000000000000000000000000000000000000', + data: publicResolver.interface.encodeFunctionData( + 'addr(bytes32,uint256)', + [namehash(name), formatter.coinType], + ), + } + }, + decode: async ( + { contracts }: ENSArgs<'contracts'>, + data: string, + _name: string, + coinType?: string | number, + ) => { + let returnCoinType = true + if (!coinType) { + coinType = 60 + returnCoinType = false + } + + const publicResolver = await contracts?.getPublicResolver()! + const formatter = + typeof coinType === 'string' && Number.isNaN(parseInt(coinType)) + ? formatsByName[coinType] + : formatsByCoinType[ + typeof coinType === 'number' ? coinType : parseInt(coinType) + ] + + let response: string + + if (coinType === 60 || coinType === '60') { + ;[response] = publicResolver.interface.decodeFunctionResult( + 'addr(bytes32)', + data, + ) + } else { + ;[response] = publicResolver.interface.decodeFunctionResult( + 'addr(bytes32,uint256)', + data, + ) + } + + if (!response) return + + if (hexStripZeros(response) === '0x') { + return + } + + const decodedAddr = formatter.encoder(Buffer.from(response.slice(2), 'hex')) + + if (!decodedAddr) { + return + } + + if (!returnCoinType) { + return decodedAddr + } + + return { coin: formatter.name, addr: decodedAddr } + }, +} + +export const getAddr = { + raw: async ( + { contracts, universalWrapper }: ENSArgs<'contracts' | 'universalWrapper'>, + name: string, + coinType?: string | number, + ) => { + const prData = await _getAddr.raw({ contracts }, name, coinType) + return universalWrapper.raw(name, prData.data) + }, + decode: async ( + { contracts, universalWrapper }: ENSArgs<'contracts' | 'universalWrapper'>, + data: string, + _name: string, + coinType?: string | number, + ) => { + const urData = await universalWrapper.decode(data) + if (!urData) return + return _getAddr.decode({ contracts }, urData.data, _name, coinType) + }, +} + +// Supported content types as bitwise OR +// ID 1: JSON +// ID 2: zlib compressed JSON +// ID 4: CBOR +// ID 8: URI +const supportedContentTypes = '0xf' + +export const _getABI = { + raw: async ({ contracts }: ENSArgs<'contracts'>, name: string) => { + const publicResolver = await contracts?.getPublicResolver()! + return { + to: '0x0000000000000000000000000000000000000000', + data: publicResolver.interface.encodeFunctionData('ABI', [ + namehash(name), + supportedContentTypes, + ]), + } + }, + decode: async ({ contracts }: ENSArgs<'contracts'>, data: string) => { + const publicResolver = await contracts?.getPublicResolver()! + const [bnContentType, encodedABIData] = + publicResolver.interface.decodeFunctionResult('ABI', data) + if (!bnContentType || !data) { + return + } + const contentType = (bnContentType as BigNumber).toNumber() + if (!contentType) { + return + } + let abiData: string | object + let decoded = false + switch (contentType) { + // JSON + case 1: + abiData = JSON.parse(toUtf8String(encodedABIData)) + decoded = true + break + // zlib compressed JSON + case 2: { + const { inflate } = await import('pako/dist/pako_inflate.min.js') + abiData = JSON.parse( + inflate(arrayify(encodedABIData), { to: 'string' }), + ) + decoded = true + break + } + // CBOR + case 4: { + const { decodeFirst } = await import('cbor') + abiData = await decodeFirst(arrayify(encodedABIData)) + decoded = true + break + } + // URI + case 8: + abiData = toUtf8String(encodedABIData) + decoded = false + break + default: + try { + abiData = toUtf8String(encodedABIData) + } catch { + abiData = encodedABIData + } + decoded = false + } + return { + contentType, + decoded, + abi: abiData, + } + }, +} + +export const getABI = { + raw: async ( + { contracts, universalWrapper }: ENSArgs<'contracts' | 'universalWrapper'>, + name: string, + ) => { + const prData = await _getABI.raw({ contracts }, name) + return universalWrapper.raw(name, prData.data) + }, + decode: async ( + { contracts, universalWrapper }: ENSArgs<'contracts' | 'universalWrapper'>, + data: string, + ) => { + const urData = await universalWrapper.decode(data) + if (!urData) return + return _getABI.decode({ contracts }, urData.data) + }, +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/getSubnames.test.ts b/.yalc/@ensdomains/ensjs/src/functions/getSubnames.test.ts new file mode 100644 index 000000000..6de809d79 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getSubnames.test.ts @@ -0,0 +1,675 @@ +import { ENS } from '..' +import setup from '../tests/setup' + +let ensInstance: ENS + +beforeAll(async () => { + ;({ ensInstance } = await setup()) +}) + +const testProperties = (obj: object, ...properties: string[]) => + properties.map((property) => expect(obj).toHaveProperty(property)) + +describe('getSubnames', () => { + it('should get the subnames for a name ordered by createdAt in desc order', async () => { + const result = await ensInstance.getSubnames({ + name: 'with-subnames.eth', + pageSize: 10, + orderBy: 'createdAt', + orderDirection: 'desc', + }) + expect(result).toBeTruthy() + expect(result.subnames.length).toBe(4) + expect(result.subnameCount).toBe(4) + expect(result.subnames[0].name).toEqual('addr.with-subnames.eth') + expect(result.subnames[1].name).toEqual('xyz.with-subnames.eth') + expect(result.subnames[2].name).toEqual('legacy.with-subnames.eth') + expect(result.subnames[3].name).toEqual('test.with-subnames.eth') + expect( + result.subnames.every((subname, i, arr) => { + if (arr[i + 1]) { + return (subname as any).createdAt >= (arr[i + 1] as any).createdAt + } + return true + }), + ).toBe(true) + testProperties( + result.subnames[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'owner', + 'truncatedName', + ) + }) + + it('should get the subnames for a name ordered by createdAt in asc order', async () => { + const result = await ensInstance.getSubnames({ + name: 'with-subnames.eth', + pageSize: 10, + orderBy: 'createdAt', + orderDirection: 'asc', + }) + expect(result).toBeTruthy() + expect(result.subnames.length).toBe(4) + expect(result.subnameCount).toBe(4) + expect(result.subnames[0].name).toEqual('test.with-subnames.eth') + expect(result.subnames[1].name).toEqual('legacy.with-subnames.eth') + expect(result.subnames[2].name).toEqual('xyz.with-subnames.eth') + expect(result.subnames[3].name).toEqual('addr.with-subnames.eth') + expect( + result.subnames.every((subname, i, arr) => { + if (arr[i + 1]) { + return (subname as any).createdAt <= (arr[i + 1] as any).createdAt + } + return true + }), + ).toBe(true) + testProperties( + result.subnames[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'owner', + 'truncatedName', + ) + }) + + it('should get the subnames for a name by labelName in desc order', async () => { + const result = await ensInstance.getSubnames({ + name: 'with-subnames.eth', + pageSize: 10, + orderBy: 'labelName', + orderDirection: 'desc', + }) + expect(result).toBeTruthy() + expect(result.subnames.length).toBe(4) + expect(result.subnameCount).toBe(4) + expect(result.subnames[0].name).toEqual('xyz.with-subnames.eth') + expect(result.subnames[1].name).toEqual('test.with-subnames.eth') + expect(result.subnames[2].name).toEqual('legacy.with-subnames.eth') + expect(result.subnames[3].name).toEqual('addr.with-subnames.eth') + testProperties( + result.subnames[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'owner', + 'truncatedName', + ) + }) + + it('should get the subnames for a name by labelName in asc order', async () => { + const result = await ensInstance.getSubnames({ + name: 'with-subnames.eth', + pageSize: 10, + orderBy: 'labelName', + orderDirection: 'asc', + }) + expect(result).toBeTruthy() + expect(result.subnames.length).toBe(4) + expect(result.subnameCount).toBe(4) + expect(result.subnames[0].name).toEqual('addr.with-subnames.eth') + expect(result.subnames[1].name).toEqual('legacy.with-subnames.eth') + expect(result.subnames[2].name).toEqual('test.with-subnames.eth') + expect(result.subnames[3].name).toEqual('xyz.with-subnames.eth') + testProperties( + result.subnames[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'owner', + 'truncatedName', + ) + }) + + describe('with pagination', () => { + it('should get paginated subnames for a name ordered by createdAt in desc order', async () => { + const result = await ensInstance.getSubnames({ + name: 'with-subnames.eth', + pageSize: 2, + orderBy: 'createdAt', + orderDirection: 'desc', + }) + expect(result).toBeTruthy() + expect(result.subnames.length).toBe(2) + expect(result.subnameCount).toBe(4) + expect(result.subnames[0].name).toEqual('addr.with-subnames.eth') + expect(result.subnames[1].name).toEqual('xyz.with-subnames.eth') + expect( + result.subnames.every((subname, i, arr) => { + if (arr[i + 1]) { + return (subname as any).createdAt >= (arr[i + 1] as any).createdAt + } + return true + }), + ).toBe(true) + testProperties( + result.subnames[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'owner', + 'truncatedName', + ) + const result2 = await ensInstance.getSubnames({ + name: 'with-subnames.eth', + pageSize: 2, + orderBy: 'createdAt', + orderDirection: 'desc', + lastSubnames: result.subnames, + }) + expect(result2).toBeTruthy() + expect(result2.subnames.length).toBe(2) + expect(result2.subnameCount).toBe(4) + expect(result2.subnames[0].name).toEqual('legacy.with-subnames.eth') + expect(result2.subnames[1].name).toEqual('test.with-subnames.eth') + expect( + result2.subnames.every((subname, i, arr) => { + if (arr[i + 1]) { + return (subname as any).createdAt >= (arr[i + 1] as any).createdAt + } + return true + }), + ).toBe(true) + testProperties( + result2.subnames[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'owner', + 'truncatedName', + ) + }) + + it('should get paginated subnames for a name ordered by createdAt in asc order', async () => { + const result = await ensInstance.getSubnames({ + name: 'with-subnames.eth', + pageSize: 2, + orderBy: 'createdAt', + orderDirection: 'asc', + }) + expect(result).toBeTruthy() + expect(result.subnames.length).toBe(2) + expect(result.subnameCount).toBe(4) + expect(result.subnames[0].name).toEqual('test.with-subnames.eth') + expect(result.subnames[1].name).toEqual('legacy.with-subnames.eth') + expect( + result.subnames.every((subname, i, arr) => { + if (arr[i + 1]) { + return (subname as any).createdAt <= (arr[i + 1] as any).createdAt + } + return true + }), + ).toBe(true) + testProperties( + result.subnames[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'owner', + 'truncatedName', + ) + const result2 = await ensInstance.getSubnames({ + name: 'with-subnames.eth', + page: 0, + pageSize: 2, + orderBy: 'createdAt', + orderDirection: 'asc', + lastSubnames: result.subnames, + }) + + expect(result2).toBeTruthy() + expect(result2.subnames.length).toBe(2) + expect(result2.subnameCount).toBe(4) + expect(result2.subnames[0].name).toEqual('xyz.with-subnames.eth') + expect(result2.subnames[1].name).toEqual('addr.with-subnames.eth') + expect( + result2.subnames.every((subname, i, arr) => { + if (arr[i + 1]) { + return (subname as any).createdAt <= (arr[i + 1] as any).createdAt + } + return true + }), + ).toBe(true) + testProperties( + result2.subnames[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'owner', + 'truncatedName', + ) + }) + + it('should get paginated subnames for a name by labelName in desc order', async () => { + const result = await ensInstance.getSubnames({ + name: 'with-subnames.eth', + pageSize: 2, + orderBy: 'labelName', + orderDirection: 'desc', + }) + expect(result).toBeTruthy() + expect(result.subnames.length).toBe(2) + expect(result.subnameCount).toBe(4) + expect(result.subnames[0].name).toEqual('xyz.with-subnames.eth') + expect(result.subnames[1].name).toEqual('test.with-subnames.eth') + testProperties( + result.subnames[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'owner', + 'truncatedName', + ) + const result2 = await ensInstance.getSubnames({ + name: 'with-subnames.eth', + pageSize: 2, + orderBy: 'labelName', + orderDirection: 'desc', + lastSubnames: result.subnames, + }) + expect(result2).toBeTruthy() + expect(result2.subnames.length).toBe(2) + expect(result2.subnameCount).toBe(4) + expect(result2.subnames[0].name).toEqual('legacy.with-subnames.eth') + expect(result2.subnames[1].name).toEqual('addr.with-subnames.eth') + testProperties( + result.subnames[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'owner', + 'truncatedName', + ) + }) + + it('should get paginated subnames for a name by labelName in asc order', async () => { + const result = await ensInstance.getSubnames({ + name: 'with-subnames.eth', + pageSize: 2, + orderBy: 'labelName', + orderDirection: 'asc', + }) + expect(result).toBeTruthy() + expect(result.subnames.length).toBe(2) + expect(result.subnameCount).toBe(4) + expect(result.subnames[0].name).toEqual('addr.with-subnames.eth') + expect(result.subnames[1].name).toEqual('legacy.with-subnames.eth') + + testProperties( + result.subnames[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'owner', + 'truncatedName', + ) + + const result2 = await ensInstance.getSubnames({ + name: 'with-subnames.eth', + pageSize: 2, + orderBy: 'labelName', + orderDirection: 'asc', + lastSubnames: result.subnames, + }) + expect(result2).toBeTruthy() + expect(result2.subnames.length).toBe(2) + expect(result2.subnameCount).toBe(4) + expect(result2.subnames[0].name).toEqual('test.with-subnames.eth') + expect(result2.subnames[1].name).toEqual('xyz.with-subnames.eth') + + testProperties( + result2.subnames[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'owner', + 'truncatedName', + ) + }) + }) + + describe('With search query', () => { + it('should get the searched subnames for a name ordered by createdAt in desc order', async () => { + const result = await ensInstance.getSubnames({ + name: 'with-subnames.eth', + pageSize: 10, + orderBy: 'createdAt', + orderDirection: 'desc', + search: 'a', + }) + expect(result).toBeTruthy() + expect(result.subnames.length).toBe(2) + expect(result.subnameCount).toBe(4) + expect(result.subnames[0].name).toEqual('addr.with-subnames.eth') + expect(result.subnames[1].name).toEqual('legacy.with-subnames.eth') + expect( + result.subnames.every((subname, i, arr) => { + if (arr[i + 1]) { + return (subname as any).createdAt >= (arr[i + 1] as any).createdAt + } + return true + }), + ).toBe(true) + testProperties( + result.subnames[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'owner', + 'truncatedName', + ) + }) + + it('should get the searched subnames for a name ordered by createdAt in asc order', async () => { + const result = await ensInstance.getSubnames({ + name: 'with-subnames.eth', + page: 0, + pageSize: 10, + orderBy: 'createdAt', + orderDirection: 'asc', + search: 'a', + }) + expect(result).toBeTruthy() + expect(result.subnames.length).toBe(2) + expect(result.subnameCount).toBe(4) + expect(result.subnames[0].name).toEqual('legacy.with-subnames.eth') + expect(result.subnames[1].name).toEqual('addr.with-subnames.eth') + expect( + result.subnames.every((subname, i, arr) => { + if (arr[i + 1]) { + return (subname as any).createdAt <= (arr[i + 1] as any).createdAt + } + return true + }), + ).toBe(true) + testProperties( + result.subnames[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'owner', + 'truncatedName', + ) + }) + + it('should get the subnames for a name by labelName in desc order', async () => { + const result = await ensInstance.getSubnames({ + name: 'with-subnames.eth', + pageSize: 10, + orderBy: 'labelName', + orderDirection: 'desc', + search: 'a', + }) + expect(result).toBeTruthy() + expect(result.subnames.length).toBe(2) + expect(result.subnameCount).toBe(4) + expect(result.subnames[0].name).toEqual('legacy.with-subnames.eth') + expect(result.subnames[1].name).toEqual('addr.with-subnames.eth') + testProperties( + result.subnames[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'owner', + 'truncatedName', + ) + }) + + it('should get the subnames for a name by labelName in asc order', async () => { + const result = await ensInstance.getSubnames({ + name: 'with-subnames.eth', + pageSize: 10, + orderBy: 'labelName', + orderDirection: 'asc', + search: 'a', + }) + expect(result).toBeTruthy() + expect(result.subnames.length).toBe(2) + expect(result.subnameCount).toBe(4) + expect(result.subnames[0].name).toEqual('addr.with-subnames.eth') + expect(result.subnames[1].name).toEqual('legacy.with-subnames.eth') + testProperties( + result.subnames[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'owner', + 'truncatedName', + ) + }) + }) + + describe('with search query and pagination', () => { + it('should get paginated subnames for a name ordered by createdAt in desc order', async () => { + const result = await ensInstance.getSubnames({ + name: 'with-subnames.eth', + pageSize: 1, + orderBy: 'createdAt', + orderDirection: 'desc', + search: 'a', + }) + expect(result).toBeTruthy() + expect(result.subnames.length).toBe(1) + expect(result.subnameCount).toBe(4) + expect(result.subnames[0].name).toEqual('addr.with-subnames.eth') + testProperties( + result.subnames[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'owner', + 'truncatedName', + ) + const result2 = await ensInstance.getSubnames({ + name: 'with-subnames.eth', + pageSize: 1, + orderBy: 'createdAt', + orderDirection: 'desc', + lastSubnames: result.subnames, + search: 'a', + }) + expect(result2).toBeTruthy() + expect(result2.subnames.length).toBe(1) + expect(result2.subnameCount).toBe(4) + expect(result2.subnames[0].name).toEqual('legacy.with-subnames.eth') + testProperties( + result2.subnames[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'owner', + 'truncatedName', + ) + }) + + it('should get paginated subnames for a name ordered by createdAt in asc order', async () => { + const result = await ensInstance.getSubnames({ + name: 'with-subnames.eth', + pageSize: 1, + orderBy: 'createdAt', + orderDirection: 'asc', + search: 'a', + }) + expect(result).toBeTruthy() + expect(result.subnames.length).toBe(1) + expect(result.subnameCount).toBe(4) + expect(result.subnames[0].name).toEqual('legacy.with-subnames.eth') + expect( + result.subnames.every((subname, i, arr) => { + if (arr[i + 1]) { + return (subname as any).createdAt <= (arr[i + 1] as any).createdAt + } + return true + }), + ).toBe(true) + testProperties( + result.subnames[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'owner', + 'truncatedName', + ) + const result2 = await ensInstance.getSubnames({ + name: 'with-subnames.eth', + page: 0, + pageSize: 2, + orderBy: 'createdAt', + orderDirection: 'asc', + lastSubnames: result.subnames, + search: 'a', + }) + + expect(result2).toBeTruthy() + expect(result2.subnames.length).toBe(1) + expect(result2.subnameCount).toBe(4) + expect(result2.subnames[0].name).toEqual('addr.with-subnames.eth') + + testProperties( + result2.subnames[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'owner', + 'truncatedName', + ) + }) + + it('should get paginated subnames for a name by labelName in desc order', async () => { + const result = await ensInstance.getSubnames({ + name: 'with-subnames.eth', + pageSize: 1, + orderBy: 'labelName', + orderDirection: 'desc', + search: 'a', + }) + expect(result).toBeTruthy() + expect(result.subnames.length).toBe(1) + expect(result.subnameCount).toBe(4) + expect(result.subnames[0].name).toEqual('legacy.with-subnames.eth') + testProperties( + result.subnames[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'owner', + 'truncatedName', + ) + const result2 = await ensInstance.getSubnames({ + name: 'with-subnames.eth', + pageSize: 1, + orderBy: 'labelName', + orderDirection: 'desc', + lastSubnames: result.subnames, + search: 'a', + }) + expect(result2).toBeTruthy() + expect(result2.subnames.length).toBe(1) + expect(result2.subnameCount).toBe(4) + expect(result2.subnames[0].name).toEqual('addr.with-subnames.eth') + testProperties( + result.subnames[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'owner', + 'truncatedName', + ) + }) + + it('should get paginated subnames for a name by labelName in asc order', async () => { + const result = await ensInstance.getSubnames({ + name: 'with-subnames.eth', + pageSize: 1, + orderBy: 'labelName', + orderDirection: 'asc', + search: 'a', + }) + expect(result).toBeTruthy() + expect(result.subnames.length).toBe(1) + expect(result.subnameCount).toBe(4) + expect(result.subnames[0].name).toEqual('addr.with-subnames.eth') + + testProperties( + result.subnames[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'owner', + 'truncatedName', + ) + + const result2 = await ensInstance.getSubnames({ + name: 'with-subnames.eth', + pageSize: 1, + orderBy: 'labelName', + orderDirection: 'asc', + lastSubnames: result.subnames, + search: 'a', + }) + expect(result2).toBeTruthy() + expect(result2.subnames.length).toBe(1) + expect(result2.subnameCount).toBe(4) + expect(result2.subnames[0].name).toEqual('legacy.with-subnames.eth') + + testProperties( + result2.subnames[0], + 'id', + 'labelName', + 'labelhash', + 'name', + 'isMigrated', + 'owner', + 'truncatedName', + ) + }) + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/getSubnames.ts b/.yalc/@ensdomains/ensjs/src/functions/getSubnames.ts new file mode 100644 index 000000000..ffe249327 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getSubnames.ts @@ -0,0 +1,132 @@ +import { ENSArgs } from '..' +import { truncateFormat } from '../utils/format' +import { decryptName } from '../utils/labels' +import { namehash } from '../utils/normalise' + +type Subname = { + id: string + labelName: string | null + truncatedName?: string + labelhash: string + isMigrated: boolean + name: string + owner: { + id: string + } +} + +type Params = { + name: string + page?: number + pageSize?: number + orderDirection?: 'asc' | 'desc' + orderBy?: 'createdAt' | 'labelName' + lastSubnames?: Array + search?: string +} + +const largeQuery = async ( + { gqlInstance }: ENSArgs<'gqlInstance'>, + { + name, + pageSize = 10, + orderDirection, + orderBy, + lastSubnames = [], + search = '', + }: Params, +) => { + const { client } = gqlInstance + + const lastSubname = lastSubnames?.[lastSubnames.length - 1] + const lastCreatedAt = lastSubname?.createdAt + const lastLabelName = lastSubname?.labelName + + let whereFilter = '' + if (orderBy === 'createdAt' && lastCreatedAt) { + whereFilter += + orderDirection === 'asc' + ? 'createdAt_gt: $lastCreatedAt' + : 'createdAt_lt: $lastCreatedAt' + } else if (orderBy === 'labelName' && lastLabelName) { + whereFilter += + orderDirection === 'asc' + ? 'labelName_gt: $lastLabelName' + : 'labelName_lt: $lastLabelName' + } + if (search) { + whereFilter += ' labelName_contains: $search' + } + + const finalQuery = gqlInstance.gql` + query getSubnames( + $id: ID! + $first: Int + $lastCreatedAt: BigInt + $lastLabelName: String + $orderBy: Domain_orderBy + $orderDirection: OrderDirection + $search: String + ) { + domain( + id: $id + ) { + subdomainCount + subdomains( + first: $first + orderBy: $orderBy + orderDirection: $orderDirection + where: { + ${whereFilter} + } + ) { + id + labelName + labelhash + isMigrated + name + subdomainCount + createdAt + owner { + id + } + } + } + } + ` + + const queryVars = { + id: namehash(name), + first: pageSize, + lastCreatedAt, + lastLabelName, + orderBy, + orderDirection, + search: search?.toLowerCase(), + } + const response = await client.request(finalQuery, queryVars) + const domain = response?.domain + const subdomains = domain.subdomains.map((subname: any) => { + const decrypted = decryptName(subname.name) + + return { + ...subname, + name: decrypted, + truncatedName: truncateFormat(decrypted), + } + }) + + return { + subnames: subdomains, + subnameCount: domain.subdomainCount, + } +} + +const getSubnames = ( + injected: ENSArgs<'gqlInstance'>, + functionArgs: Params, +): Promise<{ subnames: Subname[]; subnameCount: number }> => { + return largeQuery(injected, functionArgs) +} + +export default getSubnames diff --git a/.yalc/@ensdomains/ensjs/src/functions/getWrapperData.test.ts b/.yalc/@ensdomains/ensjs/src/functions/getWrapperData.test.ts new file mode 100644 index 000000000..119bf576b --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getWrapperData.test.ts @@ -0,0 +1,64 @@ +import { ENS } from '../index' +import setup from '../tests/setup' + +let ensInstance: ENS +let revert: Awaited>['revert'] +let createSnapshot: Awaited>['createSnapshot'] +let withWrappedSnapshot: any + +beforeAll(async () => { + ;({ ensInstance, revert, createSnapshot } = await setup()) + + withWrappedSnapshot = await createSnapshot() +}) + +afterEach(async () => { + await revert(withWrappedSnapshot) + withWrappedSnapshot = await createSnapshot() +}) + +afterAll(async () => { + await revert() +}) + +describe('getWrapperData', () => { + it('should return default data for an unwrapped name', async () => { + const result = await ensInstance.getWrapperData('with-profile.eth') + expect(result?.expiryDate).toBeUndefined() + expect(result?.rawFuses).toEqual(0) + expect(result?.child.CAN_DO_EVERYTHING).toBeTruthy() + }) + it('should return with CAN_DO_EVERYTHING set to true for a name with no fuses burned', async () => { + const result = await ensInstance.getWrapperData( + 'test.wrapped-with-subnames.eth', + ) + expect(result).toBeTruthy() + if (result) { + expect(result.child.CAN_DO_EVERYTHING).toBe(true) + expect(result.rawFuses).toBe(0) + } + }) + it('should return with other correct fuses', async () => { + const tx = await ensInstance.setFuses('wrapped.eth', { + named: ['CANNOT_UNWRAP', 'CANNOT_CREATE_SUBDOMAIN', 'CANNOT_SET_TTL'], + addressOrIndex: 1, + }) + await tx.wait() + + const result = await ensInstance.getWrapperData('wrapped.eth') + expect(result).toBeTruthy() + if (result) { + expect(result.child.CAN_DO_EVERYTHING).toBe(false) + expect(result.child.CANNOT_UNWRAP).toBe(true) + expect(result.child.CANNOT_CREATE_SUBDOMAIN).toBe(true) + expect(result.child.CANNOT_SET_TTL).toBe(true) + } + }) + it('should return correct expiry', async () => { + const result = await ensInstance.getWrapperData('wrapped.eth') + expect(result).toBeTruthy() + if (result) { + expect(result.expiryDate).toBeInstanceOf(Date) + } + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/getWrapperData.ts b/.yalc/@ensdomains/ensjs/src/functions/getWrapperData.ts new file mode 100644 index 000000000..6b509435e --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/getWrapperData.ts @@ -0,0 +1,43 @@ +import type { BigNumber } from '@ethersproject/bignumber' +import { ENSArgs } from '../index' +import { decodeFuses } from '../utils/fuses' +import { namehash } from '../utils/normalise' + +const raw = async ({ contracts }: ENSArgs<'contracts'>, name: string) => { + const nameWrapper = await contracts?.getNameWrapper()! + return { + to: nameWrapper.address, + data: nameWrapper.interface.encodeFunctionData('getData', [namehash(name)]), + } +} + +const decode = async ({ contracts }: ENSArgs<'contracts'>, data: string) => { + const nameWrapper = await contracts?.getNameWrapper()! + try { + const [owner, fuses, expiry] = nameWrapper.interface.decodeFunctionResult( + 'getData', + data, + ) as [string, number, BigNumber] + + const fuseObj = decodeFuses(fuses) + + const expiryDate = expiry.gt(0) + ? new Date(expiry.toNumber() * 1000) + : undefined + + return { + ...fuseObj, + expiryDate, + rawFuses: fuses, + owner, + } + } catch (e) { + console.error('Error decoding wrapper data: ', e) + return + } +} + +export default { + raw, + decode, +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/importDNSSECName.ts b/.yalc/@ensdomains/ensjs/src/functions/importDNSSECName.ts new file mode 100644 index 000000000..75ea02417 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/importDNSSECName.ts @@ -0,0 +1,54 @@ +import { Oracle as NewOracle } from '@ensdomains/dnssecoraclejs' +import packet from 'dns-packet' +import type { ENSArgs } from '..' +import { EMPTY_ADDRESS } from '../utils/consts' + +export const DNS_OVER_HTTP_ENDPOINT = 'https://1.1.1.1/dns-query' + +export type ImportDNSSECNameProps = { + address: string + proverResult: any +} + +export default async function ( + { contracts, provider }: ENSArgs<'contracts' | 'signer' | 'provider'>, + name: string, + { address, proverResult }: ImportDNSSECNameProps, +) { + const dnsRegistrarContract = await contracts?.getDNSRegistrar() + const resolverContract = await contracts?.getPublicResolver() + const registrarOracle = await dnsRegistrarContract?.oracle() + + if (!registrarOracle) { + throw new Error('No oracle found') + } + + const oracle = new NewOracle(registrarOracle, provider!) + const proofData = await oracle.getProofData(proverResult) + const encodedName = `0x${packet.name.encode(name).toString('hex')}` + const data = proofData.rrsets.map((x) => + Object.values(x), + ) as unknown as Array<{ + rrset: string + sig: string + }> + const { proof } = proofData + + if (address === EMPTY_ADDRESS) { + return dnsRegistrarContract?.populateTransaction.proveAndClaim( + encodedName, + data, + proof, + ) + } + + if (address) { + return dnsRegistrarContract?.populateTransaction.proveAndClaimWithResolver( + encodedName, + data, + proof, + resolverContract!.address, + address, + ) + } +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/initialGetters.ts b/.yalc/@ensdomains/ensjs/src/functions/initialGetters.ts new file mode 100644 index 000000000..37d479fde --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/initialGetters.ts @@ -0,0 +1,12 @@ +export { default as batch } from './batch' +export * from './batchWrappers' +export { default as getExpiry } from './getExpiry' +export { default as getName } from './getName' +export { default as getNames } from './getNames' +export { default as getOwner } from './getOwner' +export { default as getPrice } from './getPrice' +export { default as getProfile } from './getProfile' +export { default as getRecords } from './getRecords' +export * from './getSpecificRecord' +export { default as getSubnames } from './getSubnames' +export { default as supportsTLD } from './supportsTLD' diff --git a/.yalc/@ensdomains/ensjs/src/functions/makeCommitment.test.ts b/.yalc/@ensdomains/ensjs/src/functions/makeCommitment.test.ts new file mode 100644 index 000000000..be783170d --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/makeCommitment.test.ts @@ -0,0 +1,23 @@ +import { ENS } from '..' +import setup from '../tests/setup' +import { makeCommitment } from '../utils/registerHelpers' + +let ensInstance: ENS + +beforeAll(async () => { + ;({ ensInstance } = await setup()) +}) + +describe('makeCommitment', () => { + it('should create a valid commitment', async () => { + const resolver = await ensInstance.contracts!.getPublicResolver()! + const commitment = makeCommitment({ + name: 'test.eth', + owner: '0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC', + duration: 1 * 365 * 24 * 60 * 60, + resolver, + }) + expect(commitment).toHaveProperty('secret') + expect(commitment).toHaveProperty('commitment') + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/normalise.test.ts b/.yalc/@ensdomains/ensjs/src/functions/normalise.test.ts new file mode 100644 index 000000000..2e3668d6e --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/normalise.test.ts @@ -0,0 +1,22 @@ +import { namehash } from '../utils/normalise' + +describe('normalise', () => { + it('should namehash an empty string', () => { + const hash = namehash('') + expect(hash).toEqual( + '0x0000000000000000000000000000000000000000000000000000000000000000', + ) + }) + it('should namehash a TLD', () => { + const hash = namehash('eth') + expect(hash).toEqual( + '0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae', + ) + }) + it('should namehash a 2LD', () => { + const hash = namehash('foo.eth') + expect(hash).toEqual( + '0xde9b09fd7c5f901e23a3f19fecc54828e9c848539801e86591bd9801b019f84f', + ) + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/registerName.test.ts b/.yalc/@ensdomains/ensjs/src/functions/registerName.test.ts new file mode 100644 index 000000000..2c7073ef0 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/registerName.test.ts @@ -0,0 +1,59 @@ +import { ethers } from 'ethers' +import { ENS } from '..' +import setup from '../tests/setup' +import { namehash } from '../utils/normalise' + +let ensInstance: ENS +let revert: Awaited>['revert'] +let provider: ethers.providers.JsonRpcProvider +let accounts: string[] + +beforeAll(async () => { + ;({ ensInstance, revert, provider } = await setup()) + accounts = await provider.listAccounts() +}) + +afterAll(async () => { + await revert() + await provider.send('anvil_removeBlockTimestampInterval', []) +}) + +describe('registerName', () => { + beforeEach(async () => { + await revert() + }) + it('should return a registration transaction and succeed', async () => { + const controller = await ensInstance.contracts!.getEthRegistrarController()! + + const name = 'cool-swag.eth' + const duration = 31536000 + const { customData, ...commitPopTx } = + await ensInstance.commitName.populateTransaction(name, { + duration, + owner: accounts[1], + addressOrIndex: accounts[1], + }) + const commitTx = await provider.getSigner().sendTransaction(commitPopTx) + await commitTx.wait() + + await provider.send('evm_increaseTime', [60]) + await provider.send('evm_mine', []) + + const { secret } = customData! + + const [price] = await controller.rentPrice(name, duration) + + const tx = await ensInstance.registerName(name, { + secret, + duration, + owner: accounts[1], + addressOrIndex: accounts[1], + value: price, + }) + await tx.wait() + + const nameWrapper = await ensInstance.contracts!.getNameWrapper()! + const owner = await nameWrapper.ownerOf(namehash(name)) + expect(owner).toBe(accounts[1]) + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/registerName.ts b/.yalc/@ensdomains/ensjs/src/functions/registerName.ts new file mode 100644 index 000000000..c55c41f5a --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/registerName.ts @@ -0,0 +1,38 @@ +import { BigNumber } from '@ethersproject/bignumber/lib/bignumber' +import { ENSArgs } from '..' +import { + BaseRegistrationParams, + makeRegistrationData, +} from '../utils/registerHelpers' +import { wrappedLabelLengthCheck } from '../utils/wrapper' + +type Params = BaseRegistrationParams & { + value: BigNumber +} + +export default async function ( + { contracts }: ENSArgs<'contracts'>, + name: string, + { resolverAddress, value, ...params }: Params, +) { + const labels = name.split('.') + if (labels.length !== 2 || labels[1] !== 'eth') + throw new Error('Currently only .eth TLD registrations are supported') + + wrappedLabelLengthCheck(labels[0]) + + const controller = await contracts!.getEthRegistrarController() + const _resolver = await contracts!.getPublicResolver( + undefined, + resolverAddress, + ) + const generatedParams = makeRegistrationData({ + name, + resolver: _resolver, + ...params, + }) + + return controller.populateTransaction.register(...generatedParams, { + value, + }) +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/renewNames.test.ts b/.yalc/@ensdomains/ensjs/src/functions/renewNames.test.ts new file mode 100644 index 000000000..3d008e698 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/renewNames.test.ts @@ -0,0 +1,64 @@ +import { ethers } from 'ethers' +import { ENS } from '..' +import setup from '../tests/setup' +import { labelhash } from '../utils/labels' + +let ensInstance: ENS +let revert: Awaited>['revert'] +let provider: ethers.providers.JsonRpcProvider +let accounts: string[] + +beforeAll(async () => { + ;({ ensInstance, revert, provider } = await setup()) + accounts = await provider.listAccounts() +}) + +afterAll(async () => { + await revert() +}) + +describe('renewNames', () => { + beforeEach(async () => { + await revert() + }) + it('should return a renew transaction and succeed', async () => { + const name = 'to-be-renewed.eth' + const label = name.split('.')[0] + const duration = 31536000 + const baseRegistrar = await ensInstance.contracts!.getBaseRegistrar()! + const oldExpiry = await baseRegistrar.nameExpires(labelhash(label)) + + const controller = await ensInstance.contracts!.getEthRegistrarController()! + const [price] = await controller.rentPrice(label, duration) + + const tx = await ensInstance.renewNames(name, { + value: price.mul(2), + duration, + addressOrIndex: accounts[0], + }) + await tx.wait() + + const newExpiry = await baseRegistrar.nameExpires(labelhash(label)) + expect(newExpiry.toNumber()).toBe(oldExpiry.add(31536000).toNumber()) + }) + + it('should return a renew transaction and succeed', async () => { + const names = ['to-be-renewed.eth', 'test123.eth'] + const label = names[0].split('.')[0] + const duration = 31536000 + const baseRegistrar = await ensInstance.contracts!.getBaseRegistrar()! + const oldExpiry = await baseRegistrar.nameExpires(labelhash(label)) + const bulkRenewal = await ensInstance.contracts!.getBulkRenewal()! + const price = await bulkRenewal.rentPrice(names, duration) + + const tx = await ensInstance.renewNames(names, { + value: price.mul(4), + duration, + addressOrIndex: accounts[1], + }) + await tx.wait() + + const newExpiry = await baseRegistrar.nameExpires(labelhash(label)) + expect(newExpiry.toNumber()).toBe(oldExpiry.add(31536000).toNumber()) + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/renewNames.ts b/.yalc/@ensdomains/ensjs/src/functions/renewNames.ts new file mode 100644 index 000000000..fea3416c8 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/renewNames.ts @@ -0,0 +1,54 @@ +import { BigNumber, BigNumberish } from '@ethersproject/bignumber/lib/bignumber' +import { ENSArgs } from '..' +import { MAX_INT_64 } from '../utils/consts' +import { labelhash } from '../utils/labels' +import { namehash } from '../utils/normalise' + +type BaseProps = { + duration: number + value: BigNumber +} + +type WrappedProps = { + duration: BigNumberish +} + +export async function extendWrappedName( + { contracts }: ENSArgs<'contracts'>, + name: string, + options?: WrappedProps, +) { + const expiry = options?.duration || MAX_INT_64 + const labels = name.split('.') + const labelHash = labelhash(labels.shift()!) + const parentNode = namehash(labels.join('.')) + + const nameWrapper = await contracts!.getNameWrapper() + return nameWrapper.populateTransaction.extendExpiry( + parentNode, + labelHash, + expiry, + ) +} + +export default async function ( + { contracts }: ENSArgs<'contracts'>, + nameOrNames: string | string[], + { duration, value }: BaseProps, +) { + const names = Array.isArray(nameOrNames) ? nameOrNames : [nameOrNames] + const labels = names.map((name) => { + const label = name.split('.') + if (label.length !== 2 || label[1] !== 'eth') { + throw new Error('Currently only .eth TLD renewals are supported') + } + return label[0] + }) + + if (labels.length === 1) { + const controller = await contracts!.getEthRegistrarController() + return controller.populateTransaction.renew(labels[0], duration, { value }) + } + const bulkRenewal = await contracts!.getBulkRenewal() + return bulkRenewal.populateTransaction.renewAll(labels, duration, { value }) +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/setFuses.test.ts b/.yalc/@ensdomains/ensjs/src/functions/setFuses.test.ts new file mode 100644 index 000000000..8a07b2173 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/setFuses.test.ts @@ -0,0 +1,240 @@ +import { ethers } from 'ethers' +import { ENS } from '../index' +import setup from '../tests/setup' +import { unnamedUserSettableFuses, userSettableFuseEnum } from '../utils/fuses' +import { namehash } from '../utils/normalise' + +let ensInstance: ENS +let revert: Awaited>['revert'] +let provider: ethers.providers.JsonRpcProvider +let accounts: string[] + +beforeAll(async () => { + ;({ ensInstance, revert, provider } = await setup()) + accounts = await provider.listAccounts() +}) + +afterAll(async () => { + await revert() +}) + +const checkFuses = ( + fuses: number, + expected: (keyof typeof userSettableFuseEnum)[], +) => { + // eslint-disable-next-line guard-for-in + for (const fuse in userSettableFuseEnum) { + const active = + (fuses & + userSettableFuseEnum[fuse as keyof typeof userSettableFuseEnum]) > + 0 + if (expected.includes(fuse as keyof typeof userSettableFuseEnum)) { + try { + expect(active).toBeTruthy() + } catch { + throw new Error(`${fuse} should be true but is false`) + } + } else if (active) { + try { + expect(active).toBeFalsy() + } catch { + throw new Error(`${fuse} should be false but is true`) + } + } + } +} + +const checkUnnamedFuses = ( + fuses: number, + expected: (keyof typeof unnamedUserSettableFuses)[], +) => { + // eslint-disable-next-line guard-for-in + for (const fuse of unnamedUserSettableFuses) { + const active = (fuses & fuse) > 0 + if (expected.includes(fuse as keyof typeof unnamedUserSettableFuses)) { + try { + expect(active).toBeTruthy() + } catch { + throw new Error(`${fuse} should be true but is false`) + } + } else if (active) { + try { + expect(active).toBeFalsy() + } catch { + throw new Error(`${fuse} should be false but is true`) + } + } + } +} + +describe('setFuses', () => { + beforeEach(async () => { + await revert() + }) + describe('Array', () => { + it('should return a setFuses transaction from a named fuse array and succeed', async () => { + const tx = await ensInstance.setFuses('wrapped.eth', { + named: ['CANNOT_UNWRAP', 'CANNOT_CREATE_SUBDOMAIN', 'CANNOT_SET_TTL'], + addressOrIndex: accounts[1], + }) + expect(tx).toBeTruthy() + await tx.wait() + + const nameWrapper = await ensInstance.contracts!.getNameWrapper()! + const [, fuses] = await nameWrapper.getData(namehash('wrapped.eth')) + checkFuses(fuses, [ + 'CANNOT_UNWRAP', + 'CANNOT_CREATE_SUBDOMAIN', + 'CANNOT_SET_TTL', + 'PARENT_CANNOT_CONTROL', + ]) + }) + it('should return a setFuses transaction from an unnamed fuse array and succeed', async () => { + const tx0 = await ensInstance.setFuses('wrapped.eth', { + named: ['CANNOT_UNWRAP'], + addressOrIndex: accounts[1], + }) + expect(tx0).toBeTruthy() + await tx0.wait() + + const tx = await ensInstance.setFuses('wrapped.eth', { + unnamed: [128, 256, 512], + addressOrIndex: accounts[1], + }) + expect(tx).toBeTruthy() + await tx.wait() + + const nameWrapper = await ensInstance.contracts!.getNameWrapper()! + const [, fuses] = await nameWrapper.getData(namehash('wrapped.eth')) + checkUnnamedFuses(fuses, [128, 256, 512]) + }) + it('should return a setFuses transaction from both an unnamed and named fuse array and succeed', async () => { + const tx = await ensInstance.setFuses('wrapped.eth', { + named: ['CANNOT_UNWRAP', 'CANNOT_CREATE_SUBDOMAIN', 'CANNOT_SET_TTL'], + unnamed: [128, 256, 512], + addressOrIndex: accounts[1], + }) + expect(tx).toBeTruthy() + await tx.wait() + + const nameWrapper = await ensInstance.contracts!.getNameWrapper()! + const [, fuses] = await nameWrapper.getData(namehash('wrapped.eth')) + checkFuses(fuses, [ + 'CANNOT_UNWRAP', + 'CANNOT_CREATE_SUBDOMAIN', + 'CANNOT_SET_TTL', + 'PARENT_CANNOT_CONTROL', + ]) + checkUnnamedFuses(fuses, [128, 256, 512]) + }) + it('should throw an error when trying to burn a named fuse in an unnamed fuse array', async () => { + try { + await ensInstance.setFuses('wrapped.eth', { + unnamed: [32] as any, + addressOrIndex: accounts[1], + }) + expect(false).toBeTruthy() + } catch (e: any) { + expect(e.message).toBe( + '32 is not a valid unnamed fuse. If you are trying to set a named fuse, use the named property.', + ) + } + }) + it('should throw an error when trying to burn an unnamed fuse in a named fuse array', async () => { + try { + await ensInstance.setFuses('wrapped.eth', { + named: ['COOL_SWAG_FUSE'] as any, + }) + expect(false).toBeTruthy() + } catch (e: any) { + expect(e.message).toBe('COOL_SWAG_FUSE is not a valid named fuse.') + } + }) + }) + describe('Number', () => { + it('should return a setFuses transaction from a number and succeed', async () => { + const tx = await ensInstance.setFuses('wrapped.eth', { + number: 49, + addressOrIndex: accounts[1], + }) + expect(tx).toBeTruthy() + await tx.wait() + + const nameWrapper = await ensInstance.contracts!.getNameWrapper()! + const [, fuses] = await nameWrapper.getData(namehash('wrapped.eth')) + checkFuses(fuses, [ + 'CANNOT_UNWRAP', + 'CANNOT_CREATE_SUBDOMAIN', + 'CANNOT_SET_TTL', + 'PARENT_CANNOT_CONTROL', + ]) + }) + it('should throw an error if the number is too high', async () => { + try { + await ensInstance.setFuses('wrapped.eth', { + number: 4294967297, + addressOrIndex: accounts[1], + }) + expect(false).toBeTruthy() + } catch (e: any) { + expect(e.message).toBe( + 'Fuse number must be limited to uint32, 4294967297 was too high.', + ) + } + }) + it('should throw an error if the number is too low', async () => { + try { + await ensInstance.setFuses('wrapped.eth', { + number: -1, + addressOrIndex: accounts[1], + }) + expect(false).toBeTruthy() + } catch (e: any) { + expect(e.message).toBe( + 'Fuse number must be limited to uint32, -1 was too low.', + ) + } + }) + it('should throw an error if the number is not an integer', async () => { + try { + await ensInstance.setFuses('wrapped.eth', { + number: 7.5, + }) + expect(false).toBeTruthy() + } catch (e: any) { + expect(e.message).toBe('Fuse number must be an integer, 7.5 was not.') + } + }) + }) +}) + +describe('setChildFuses', () => { + it('should return a setChildFuses transaction and succeed', async () => { + const nameWrapper = await ensInstance.contracts!.getNameWrapper()! + const setParentTx = await ensInstance.setFuses( + 'wrapped-with-subnames.eth', + { + named: ['CANNOT_UNWRAP'], + addressOrIndex: accounts[1], + }, + ) + expect(setParentTx).toBeTruthy() + await setParentTx.wait() + + const tx = await ensInstance.setChildFuses( + 'test.wrapped-with-subnames.eth', + { + fuses: 65537, + addressOrIndex: accounts[1], + }, + ) + expect(tx).toBeTruthy() + await tx.wait() + + const [, fuses] = await nameWrapper.getData( + namehash('test.wrapped-with-subnames.eth'), + ) + + checkFuses(fuses, ['CANNOT_UNWRAP', 'PARENT_CANNOT_CONTROL']) + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/setFuses.ts b/.yalc/@ensdomains/ensjs/src/functions/setFuses.ts new file mode 100644 index 000000000..4000f60eb --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/setFuses.ts @@ -0,0 +1,44 @@ +import { ENSArgs } from '../index' +import { CombinedFuseInput, encodeFuses } from '../utils/fuses' +import { labelhash } from '../utils/labels' +import { namehash } from '../utils/normalise' + +export async function setChildFuses( + { contracts, signer }: ENSArgs<'contracts' | 'signer'>, + name: string, + { + fuses, + expiry = 0, + }: { + fuses: Partial | number + expiry?: number + }, +) { + const encodedFuses = encodeFuses(fuses) + + const labels = name.split('.') + const labelHash = labelhash(labels.shift()!) + const parentNode = namehash(labels.join('.')) + + const nameWrapper = (await contracts!.getNameWrapper()!).connect(signer) + + return nameWrapper.populateTransaction.setChildFuses( + parentNode, + labelHash, + encodedFuses, + expiry, + ) +} + +export default async function ( + { contracts, signer }: ENSArgs<'contracts' | 'signer'>, + name: string, + props: CombinedFuseInput['child'], +) { + const encodedFuses = encodeFuses(props, 'child') + + const nameWrapper = (await contracts!.getNameWrapper()!).connect(signer) + const hash = namehash(name) + + return nameWrapper.populateTransaction.setFuses(hash, encodedFuses) +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/setName.test.ts b/.yalc/@ensdomains/ensjs/src/functions/setName.test.ts new file mode 100644 index 000000000..3cf1430ff --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/setName.test.ts @@ -0,0 +1,62 @@ +import { ethers } from 'ethers' +import { ENS } from '..' +import setup from '../tests/setup' +import { hexEncodeName } from '../utils/hexEncodedName' + +let ensInstance: ENS +let revert: Awaited>['revert'] +let provider: ethers.providers.JsonRpcProvider +let accounts: string[] + +beforeAll(async () => { + ;({ ensInstance, revert, provider } = await setup()) + accounts = await provider.listAccounts() +}) + +afterAll(async () => { + await revert() +}) + +describe('setName', () => { + beforeEach(async () => { + await revert() + }) + it('should return a transaction for a name and set successfully', async () => { + const tx = await ensInstance.setName('test123.eth', { addressOrIndex: 1 }) + expect(tx).toBeTruthy() + await tx?.wait() + + const universalResolver = + await ensInstance.contracts!.getUniversalResolver()! + const reverseNode = `${accounts[1].toLowerCase().substring(2)}.addr.reverse` + const result = await universalResolver['reverse(bytes)']( + hexEncodeName(reverseNode), + ) + expect(result[0]).toBe('test123.eth') + }) + it("should return a transaction for setting another address' name", async () => { + const registry = (await ensInstance.contracts!.getRegistry()!).connect( + provider.getSigner(1), + ) + const setApprovedForAllTx = await registry.setApprovalForAll( + accounts[2], + true, + ) + await setApprovedForAllTx?.wait() + + const tx = await ensInstance.setName('test123.eth', { + address: accounts[1], + addressOrIndex: 2, + }) + expect(tx).toBeTruthy() + await tx?.wait() + + const universalResolver = + await ensInstance.contracts!.getUniversalResolver()! + const reverseNode = `${accounts[1].toLowerCase().substring(2)}.addr.reverse` + const result = await universalResolver['reverse(bytes)']( + hexEncodeName(reverseNode), + ) + expect(result[0]).toBe('test123.eth') + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/setName.ts b/.yalc/@ensdomains/ensjs/src/functions/setName.ts new file mode 100644 index 000000000..89f50c5c9 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/setName.ts @@ -0,0 +1,32 @@ +import { ENSArgs } from '..' + +export default async function ( + { contracts, signer }: ENSArgs<'contracts' | 'signer'>, + name: string, + { + address, + resolver, + }: { + address?: string + resolver?: string + } = {}, +) { + const signerAddress = await signer.getAddress() + + const reverseRegistrar = (await contracts?.getReverseRegistrar())?.connect( + signer, + )! + + if (address) { + const publicResolver = await contracts?.getPublicResolver()! + + return reverseRegistrar.populateTransaction.setNameForAddr( + address, + signerAddress, + resolver || publicResolver.address, + name, + ) + } + + return reverseRegistrar.populateTransaction.setName(name) +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/setRecord.test.ts b/.yalc/@ensdomains/ensjs/src/functions/setRecord.test.ts new file mode 100644 index 000000000..af9715bdb --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/setRecord.test.ts @@ -0,0 +1,249 @@ +import { decodeFirst } from 'cbor' +import { BigNumber } from 'ethers' +import { arrayify, toUtf8String } from 'ethers/lib/utils' +import { inflate } from 'pako' +import { ENS } from '..' +import setup from '../tests/setup' +import { decodeContenthash } from '../utils/contentHash' +import { hexEncodeName } from '../utils/hexEncodedName' +import { namehash } from '../utils/normalise' +import { generateABIInput } from '../utils/recordHelpers' + +let ensInstance: ENS +let revert: Awaited>['revert'] + +beforeAll(async () => { + ;({ ensInstance, revert } = await setup()) +}) + +afterEach(async () => { + await revert() +}) + +const dummyABI = [ + { + type: 'function', + name: 'supportsInterface', + constant: true, + stateMutability: 'view', + payable: false, + inputs: [ + { + type: 'bytes4', + }, + ], + outputs: [ + { + type: 'bool', + }, + ], + }, +] + +describe('setRecord', () => { + it('should allow a text record set', async () => { + const tx = await ensInstance.setRecord('test123.eth', { + type: 'text', + record: { key: 'foo', value: 'bar' }, + addressOrIndex: 1, + }) + expect(tx).toBeTruthy() + await tx.wait() + + const universalResolver = + await ensInstance.contracts!.getUniversalResolver()! + const publicResolver = await ensInstance.contracts!.getPublicResolver()! + const encodedText = await universalResolver['resolve(bytes,bytes)']( + hexEncodeName('test123.eth'), + publicResolver.interface.encodeFunctionData('text', [ + namehash('test123.eth'), + 'foo', + ]), + ) + const [resultText] = publicResolver.interface.decodeFunctionResult( + 'text', + encodedText[0], + ) + expect(resultText).toBe('bar') + }) + it('should allow an address record set', async () => { + const tx = await ensInstance.setRecord('test123.eth', { + type: 'addr', + record: { + key: 'ETC_LEGACY', + value: '0x42D63ae25990889E35F215bC95884039Ba354115', + }, + addressOrIndex: 1, + }) + expect(tx).toBeTruthy() + await tx.wait() + + const universalResolver = + await ensInstance.contracts!.getUniversalResolver()! + const publicResolver = await ensInstance.contracts!.getPublicResolver()! + const encodedAddr = await universalResolver['resolve(bytes,bytes)']( + hexEncodeName('test123.eth'), + publicResolver.interface.encodeFunctionData('addr(bytes32,uint256)', [ + namehash('test123.eth'), + '61', + ]), + ) + const [resultAddr] = publicResolver.interface.decodeFunctionResult( + 'addr(bytes32,uint256)', + encodedAddr[0], + ) + expect(resultAddr).toBe( + '0x42D63ae25990889E35F215bC95884039Ba354115'.toLowerCase(), + ) + }) + it('should allow a contenthash record set', async () => { + const tx = await ensInstance.setRecord('test123.eth', { + type: 'contentHash', + record: + 'ipns://k51qzi5uqu5dgox2z23r6e99oqency055a6xt92xzmyvpz8mwz5ycjavm0u150', + addressOrIndex: 1, + }) + expect(tx).toBeTruthy() + await tx.wait() + + const universalResolver = + await ensInstance.contracts!.getUniversalResolver()! + const publicResolver = await ensInstance.contracts!.getPublicResolver()! + const encodedContent = await universalResolver['resolve(bytes,bytes)']( + hexEncodeName('test123.eth'), + publicResolver.interface.encodeFunctionData('contenthash', [ + namehash('test123.eth'), + ]), + ) + const [resultContent] = publicResolver.interface.decodeFunctionResult( + 'contenthash', + encodedContent[0], + ) + const content = decodeContenthash(resultContent) + expect(content.decoded).toBe( + 'k51qzi5uqu5dgox2z23r6e99oqency055a6xt92xzmyvpz8mwz5ycjavm0u150', + ) + expect(content.protocolType).toBe('ipns') + }) + it('should allow an abi record to be set from an object', async () => { + const tx = await ensInstance.setRecord('test123.eth', { + type: 'abi', + record: { + data: dummyABI, + }, + addressOrIndex: 1, + }) + expect(tx).toBeTruthy() + await tx.wait() + + const universalResolver = + await ensInstance.contracts!.getUniversalResolver()! + const publicResolver = await ensInstance.contracts!.getPublicResolver()! + const encodedRes = await universalResolver['resolve(bytes,bytes)']( + hexEncodeName('test123.eth'), + publicResolver.interface.encodeFunctionData('ABI', [ + namehash('test123.eth'), + '0x0f', + ]), + ) + const [contentType, encodedABI] = + publicResolver.interface.decodeFunctionResult('ABI', encodedRes[0]) as [ + BigNumber, + string, + ] + + expect(contentType.toNumber()).toBe(1) + expect(toUtf8String(encodedABI)).toBe(JSON.stringify(dummyABI)) + }) + it('should allow a zlib encoded abi record to be set', async () => { + const encodedInput = await generateABIInput('zlib', dummyABI) + const tx = await ensInstance.setRecord('test123.eth', { + type: 'abi', + record: encodedInput, + addressOrIndex: 1, + }) + expect(tx).toBeTruthy() + await tx.wait() + + const universalResolver = + await ensInstance.contracts!.getUniversalResolver()! + const publicResolver = await ensInstance.contracts!.getPublicResolver()! + const encodedRes = await universalResolver['resolve(bytes,bytes)']( + hexEncodeName('test123.eth'), + publicResolver.interface.encodeFunctionData('ABI', [ + namehash('test123.eth'), + '0x0f', + ]), + ) + const [contentType, encodedABI] = + publicResolver.interface.decodeFunctionResult('ABI', encodedRes[0]) as [ + BigNumber, + string, + ] + + expect(contentType.toNumber()).toBe(2) + expect(inflate(arrayify(encodedABI), { to: 'string' })).toBe( + JSON.stringify(dummyABI), + ) + }) + it('should allow a cbor encoded abi record to be set', async () => { + const encodedInput = await generateABIInput('cbor', dummyABI) + const tx = await ensInstance.setRecord('test123.eth', { + type: 'abi', + record: encodedInput, + addressOrIndex: 1, + }) + expect(tx).toBeTruthy() + await tx.wait() + + const universalResolver = + await ensInstance.contracts!.getUniversalResolver()! + const publicResolver = await ensInstance.contracts!.getPublicResolver()! + const encodedRes = await universalResolver['resolve(bytes,bytes)']( + hexEncodeName('test123.eth'), + publicResolver.interface.encodeFunctionData('ABI', [ + namehash('test123.eth'), + '0x0f', + ]), + ) + const [contentType, encodedABI] = + publicResolver.interface.decodeFunctionResult('ABI', encodedRes[0]) as [ + BigNumber, + string, + ] + + expect(contentType.toNumber()).toBe(4) + expect(JSON.stringify(await decodeFirst(arrayify(encodedABI)))).toBe( + JSON.stringify(dummyABI), + ) + }) + it('should allow a uri abi record to be set', async () => { + const encodedInput = await generateABIInput('uri', 'https://example.com') + const tx = await ensInstance.setRecord('test123.eth', { + type: 'abi', + record: encodedInput, + addressOrIndex: 1, + }) + expect(tx).toBeTruthy() + await tx.wait() + + const universalResolver = + await ensInstance.contracts!.getUniversalResolver()! + const publicResolver = await ensInstance.contracts!.getPublicResolver()! + const encodedRes = await universalResolver['resolve(bytes,bytes)']( + hexEncodeName('test123.eth'), + publicResolver.interface.encodeFunctionData('ABI', [ + namehash('test123.eth'), + '0x0f', + ]), + ) + const [contentType, encodedABI] = + publicResolver.interface.decodeFunctionResult('ABI', encodedRes[0]) as [ + BigNumber, + string, + ] + + expect(contentType.toNumber()).toBe(8) + expect(toUtf8String(encodedABI)).toBe('https://example.com') + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/setRecord.ts b/.yalc/@ensdomains/ensjs/src/functions/setRecord.ts new file mode 100644 index 000000000..3ff7008b9 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/setRecord.ts @@ -0,0 +1,64 @@ +import { ENSArgs } from '..' +import { namehash } from '../utils/normalise' +import { generateSingleRecordCall, RecordInput } from '../utils/recordHelpers' + +type BaseInput = { + resolverAddress?: string +} + +type ContentHashInput = { + record: RecordInput<'contentHash'> + type: 'contentHash' +} + +type AddrOrTextInput = { + record: RecordInput<'addr' | 'text'> + type: 'addr' | 'text' +} + +type ABIInput = { + record: RecordInput<'abi'> + type: 'abi' +} + +export default async function ( + { + contracts, + provider, + getResolver, + signer, + }: ENSArgs<'contracts' | 'provider' | 'getResolver' | 'signer'>, + name: string, + { + record, + type, + resolverAddress, + }: BaseInput & (ContentHashInput | AddrOrTextInput | ABIInput), +) { + if (!name.includes('.')) { + throw new Error('Input is not an ENS name') + } + + let resolverToUse: string + if (resolverAddress) { + resolverToUse = resolverAddress + } else { + resolverToUse = await getResolver(name) + } + + if (!resolverToUse) { + throw new Error('No resolver found for input address') + } + + const resolver = ( + await contracts?.getPublicResolver(provider, resolverToUse) + )?.connect(signer)! + const hash = namehash(name) + + const call = generateSingleRecordCall(hash, resolver, type)(record) + + return { + to: resolver.address, + data: call, + } +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/setRecords.test.ts b/.yalc/@ensdomains/ensjs/src/functions/setRecords.test.ts new file mode 100644 index 000000000..affbb1535 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/setRecords.test.ts @@ -0,0 +1,64 @@ +import { ENS } from '..' +import setup from '../tests/setup' +import { hexEncodeName } from '../utils/hexEncodedName' +import { namehash } from '../utils/normalise' + +let ensInstance: ENS +let revert: Awaited>['revert'] + +beforeAll(async () => { + ;({ ensInstance, revert } = await setup()) +}) + +afterAll(async () => { + await revert() +}) + +describe('setRecords', () => { + it('should return a transaction to the resolver and set successfully', async () => { + const tx = await ensInstance.setRecords('test123.eth', { + records: { + coinTypes: [ + { + key: 'ETC_LEGACY', + value: '0x42D63ae25990889E35F215bC95884039Ba354115', + }, + ], + texts: [{ key: 'foo', value: 'bar' }], + }, + addressOrIndex: 1, + }) + expect(tx).toBeTruthy() + await tx.wait() + + const universalResolver = + await ensInstance.contracts!.getUniversalResolver()! + const publicResolver = await ensInstance.contracts!.getPublicResolver()! + const encodedText = await universalResolver['resolve(bytes,bytes)']( + hexEncodeName('test123.eth'), + publicResolver.interface.encodeFunctionData('text', [ + namehash('test123.eth'), + 'foo', + ]), + ) + const encodedAddr = await universalResolver['resolve(bytes,bytes)']( + hexEncodeName('test123.eth'), + publicResolver.interface.encodeFunctionData('addr(bytes32,uint256)', [ + namehash('test123.eth'), + '61', + ]), + ) + const [resultText] = publicResolver.interface.decodeFunctionResult( + 'text', + encodedText[0], + ) + const [resultAddr] = publicResolver.interface.decodeFunctionResult( + 'addr(bytes32,uint256)', + encodedAddr[0], + ) + expect(resultText).toBe('bar') + expect(resultAddr).toBe( + '0x42D63ae25990889E35F215bC95884039Ba354115'.toLowerCase(), + ) + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/setRecords.ts b/.yalc/@ensdomains/ensjs/src/functions/setRecords.ts new file mode 100644 index 000000000..82bc4dc1a --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/setRecords.ts @@ -0,0 +1,44 @@ +import { ENSArgs } from '..' +import { namehash } from '../utils/normalise' +import { generateRecordCallArray, RecordOptions } from '../utils/recordHelpers' + +export default async function ( + { + contracts, + provider, + getResolver, + signer, + }: ENSArgs<'contracts' | 'provider' | 'getResolver' | 'signer'>, + name: string, + { + records, + resolverAddress, + }: { + records: RecordOptions + resolverAddress?: string + }, +) { + if (!name.includes('.')) { + throw new Error('Input is not an ENS name') + } + + let resolverToUse: string + if (resolverAddress) { + resolverToUse = resolverAddress + } else { + resolverToUse = await getResolver(name) + } + + if (!resolverToUse) { + throw new Error('No resolver found for input address') + } + + const resolver = ( + await contracts?.getPublicResolver(provider, resolverToUse) + )?.connect(signer)! + const hash = namehash(name) + + const calls: string[] = generateRecordCallArray(hash, records, resolver!) + + return resolver.populateTransaction.multicall(calls) +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/setResolver.test.ts b/.yalc/@ensdomains/ensjs/src/functions/setResolver.test.ts new file mode 100644 index 000000000..cc7cc40c4 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/setResolver.test.ts @@ -0,0 +1,52 @@ +import { ENS } from '..' +import setup from '../tests/setup' +import { hexEncodeName } from '../utils/hexEncodedName' + +let ensInstance: ENS +let revert: Awaited>['revert'] + +beforeAll(async () => { + ;({ ensInstance, revert } = await setup()) +}) + +afterAll(async () => { + await revert() +}) + +describe('setResolver', () => { + beforeEach(async () => { + await revert() + }) + it('should return a transaction to the registry and set successfully', async () => { + const tx = await ensInstance.setResolver('test123.eth', { + contract: 'registry', + resolver: '0xAEfF4f4d8e2cB51854BEa2244B3C5Fb36b41C7fC', + addressOrIndex: 1, + }) + expect(tx).toBeTruthy() + await tx.wait() + + const universalResolver = + await ensInstance.contracts!.getUniversalResolver()! + const [result] = await universalResolver.findResolver( + hexEncodeName('test123.eth'), + ) + expect(result).toBe('0xAEfF4f4d8e2cB51854BEa2244B3C5Fb36b41C7fC') + }) + it('should return a transaction to the namewrapper and set successfully', async () => { + const tx = await ensInstance.setResolver('wrapped.eth', { + contract: 'nameWrapper', + resolver: '0xAEfF4f4d8e2cB51854BEa2244B3C5Fb36b41C7fC', + addressOrIndex: 1, + }) + expect(tx).toBeTruthy() + await tx.wait() + + const universalResolver = + await ensInstance.contracts!.getUniversalResolver()! + const [result] = await universalResolver.findResolver( + hexEncodeName('wrapped.eth'), + ) + expect(result).toBe('0xAEfF4f4d8e2cB51854BEa2244B3C5Fb36b41C7fC') + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/setResolver.ts b/.yalc/@ensdomains/ensjs/src/functions/setResolver.ts new file mode 100644 index 000000000..301883c6a --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/setResolver.ts @@ -0,0 +1,35 @@ +import { ENSArgs } from '..' +import { namehash } from '../utils/normalise' + +export default async function ( + { contracts, signer }: ENSArgs<'contracts' | 'signer'>, + name: string, + { + contract, + resolver, + }: { + contract: 'registry' | 'nameWrapper' + resolver?: string + }, +) { + if (!resolver) { + resolver = (await contracts!.getPublicResolver()!).address + } + + switch (contract) { + case 'registry': { + const registry = (await contracts?.getRegistry())!.connect(signer) + return registry.populateTransaction.setResolver(namehash(name), resolver) + } + case 'nameWrapper': { + const nameWrapper = (await contracts?.getNameWrapper())!.connect(signer) + return nameWrapper.populateTransaction.setResolver( + namehash(name), + resolver, + ) + } + default: { + throw new Error(`Unknown contract: ${contract}`) + } + } +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/supportsTLD.test.ts b/.yalc/@ensdomains/ensjs/src/functions/supportsTLD.test.ts new file mode 100644 index 000000000..8a3815d5c --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/supportsTLD.test.ts @@ -0,0 +1,45 @@ +import { ENS } from '..' +import setup from '../tests/setup' + +let ensInstance: ENS +let revert: Awaited>['revert'] + +beforeAll(async () => { + ;({ ensInstance, revert } = await setup()) +}) + +afterAll(async () => { + await revert() +}) + +describe('supportsTLD', () => { + it('should return true for .eth tld', async () => { + const result = await ensInstance.supportsTLD('eth') + expect(result).toBeTruthy() + }) + + it('should return true for .xyz tld', async () => { + const result = await ensInstance.supportsTLD('xyz') + expect(result).toBeTruthy() + }) + + it('should return false for .com tld', async () => { + const result = await ensInstance.supportsTLD('com') + expect(result).toBeFalsy() + }) + + it('should return true for .eth name', async () => { + const result = await ensInstance.supportsTLD('test123.eth') + expect(result).toBeTruthy() + }) + + it('should return true for .xyz name', async () => { + const result = await ensInstance.supportsTLD('test123.xyz') + expect(result).toBeTruthy() + }) + + it('should return false for .com name', async () => { + const result = await ensInstance.supportsTLD('test123.com') + expect(result).toBeFalsy() + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/supportsTLD.ts b/.yalc/@ensdomains/ensjs/src/functions/supportsTLD.ts new file mode 100644 index 000000000..06c527221 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/supportsTLD.ts @@ -0,0 +1,38 @@ +import { DNSRegistrar__factory } from '../generated/factories/DNSRegistrar__factory' +import { ENSArgs } from '..' + +/* + * 0x2f435428 -> interfaceId for latest IDNSRegistrar + * 0x17d8f49b, 0x1aa2e641 -> interfaceId for claims method of older DNSRegistrar + * */ +const DNSSEC_CLAIM_INTERFACE_IDS = ['0x2f435428', '0x17d8f49b', '0x1aa2e641'] + +export default async function ( + { getOwner, provider }: ENSArgs<'getOwner' | 'provider'>, + name: string, +): Promise { + try { + const labels = name.split('.') + const tld = labels[labels.length - 1] + + if (tld === 'eth') return true + + const tldOwner = await getOwner(tld, 'registry') + if (!tldOwner?.owner) return false + + const dnsRegistrar = DNSRegistrar__factory.connect( + tldOwner.owner, + provider!, + ) + + const supports = await Promise.all( + DNSSEC_CLAIM_INTERFACE_IDS.map((interfaceId) => + dnsRegistrar.supportsInterface(interfaceId), + ), + ) + + return supports.some((s) => !!s) + } catch { + return false + } +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/transferController.ts b/.yalc/@ensdomains/ensjs/src/functions/transferController.ts new file mode 100644 index 000000000..452d75029 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/transferController.ts @@ -0,0 +1,29 @@ +import { keccak256 as solidityKeccak256 } from '@ethersproject/solidity' + +import { ENSArgs } from '..' + +export default async function ( + { contracts, signer }: ENSArgs<'contracts' | 'signer'>, + name: string, + { + newOwner, + isOwner, + }: { + newOwner: string + isOwner: boolean + }, +) { + const baseRegistrar = (await contracts?.getBaseRegistrar())!.connect(signer) + const registry = (await contracts?.getRegistry())!.connect(signer) + const labels = name.split('.') + if (isOwner) { + return registry.populateTransaction.setOwner( + solidityKeccak256(['string'], [labels[0]]), + newOwner, + ) + } + return baseRegistrar.populateTransaction.reclaim( + solidityKeccak256(['string'], [labels[0]]), + newOwner, + ) +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/transferName.test.ts b/.yalc/@ensdomains/ensjs/src/functions/transferName.test.ts new file mode 100644 index 000000000..8e64d39f6 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/transferName.test.ts @@ -0,0 +1,65 @@ +import { ethers, utils } from 'ethers' +import { ENS } from '..' +import setup from '../tests/setup' +import { namehash } from '../utils/normalise' + +let ensInstance: ENS +let revert: Awaited>['revert'] +let provider: ethers.providers.JsonRpcProvider +let accounts: string[] + +beforeAll(async () => { + ;({ ensInstance, revert, provider } = await setup()) + accounts = await provider.listAccounts() +}) + +afterAll(async () => { + await revert() +}) + +describe('transferName', () => { + beforeEach(async () => { + await revert() + }) + it('should allow a transfer on the registrar', async () => { + const tx = await ensInstance.transferName('test123.eth', { + contract: 'baseRegistrar', + newOwner: accounts[2], + addressOrIndex: 1, + }) + expect(tx).toBeTruthy() + await tx.wait() + + const baseRegistrar = await ensInstance.contracts!.getBaseRegistrar()! + const result = await baseRegistrar.ownerOf( + utils.solidityKeccak256(['string'], ['test123']), + ) + expect(result).toBe(accounts[2]) + }) + it('should allow a transfer on the namewrapper', async () => { + const tx = await ensInstance.transferName('wrapped.eth', { + newOwner: accounts[2], + contract: 'nameWrapper', + addressOrIndex: 1, + }) + expect(tx).toBeTruthy() + await tx.wait() + + const nameWrapper = await ensInstance.contracts!.getNameWrapper()! + const result = await nameWrapper.ownerOf(namehash('wrapped.eth')) + expect(result).toBe(accounts[2]) + }) + it('should allow a transfer on the registry', async () => { + const tx = await ensInstance.transferName('test.with-subnames.eth', { + newOwner: accounts[1], + contract: 'registry', + addressOrIndex: accounts[2], + }) + expect(tx).toBeTruthy() + await tx.wait() + + const registry = await ensInstance.contracts!.getRegistry()! + const result = await registry.owner(namehash('test.with-subnames.eth')) + expect(result).toBe(accounts[1]) + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/transferName.ts b/.yalc/@ensdomains/ensjs/src/functions/transferName.ts new file mode 100644 index 000000000..cd930586e --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/transferName.ts @@ -0,0 +1,58 @@ +import { keccak256 as solidityKeccak256 } from '@ethersproject/solidity' +import { ENSArgs } from '..' +import { namehash } from '../utils/normalise' + +export default async function ( + { contracts, signer }: ENSArgs<'contracts' | 'signer'>, + name: string, + { + newOwner, + contract, + reclaim, + }: { + newOwner: string + contract: 'registry' | 'nameWrapper' | 'baseRegistrar' + reclaim?: boolean + }, +) { + const address = await signer.getAddress() + + switch (contract) { + case 'registry': { + const registry = (await contracts?.getRegistry())!.connect(signer) + return registry.populateTransaction.setOwner(namehash(name), newOwner) + } + case 'baseRegistrar': { + const baseRegistrar = (await contracts?.getBaseRegistrar())!.connect( + signer, + ) + const labels = name.split('.') + if (labels.length > 2 || labels[labels.length - 1] !== 'eth') { + throw new Error('Invalid name for baseRegistrar') + } + const tokenId = solidityKeccak256(['string'], [labels[0]]) + + // reclaim if sending manager on unwrapped name + if (reclaim) { + return baseRegistrar.populateTransaction.reclaim(tokenId, newOwner) + } + + return baseRegistrar.populateTransaction[ + 'safeTransferFrom(address,address,uint256)' + ](address, newOwner, tokenId) + } + case 'nameWrapper': { + const nameWrapper = (await contracts?.getNameWrapper())!.connect(signer) + return nameWrapper.populateTransaction.safeTransferFrom( + address, + newOwner, + namehash(name), + 1, + '0x', + ) + } + default: { + throw new Error(`Unknown contract: ${contract}`) + } + } +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/transferSubname.test.ts b/.yalc/@ensdomains/ensjs/src/functions/transferSubname.test.ts new file mode 100644 index 000000000..9c29bf1b8 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/transferSubname.test.ts @@ -0,0 +1,55 @@ +import { ethers } from 'ethers' +import { ENS } from '..' +import setup from '../tests/setup' +import { namehash } from '../utils/normalise' + +let ensInstance: ENS +let revert: Awaited>['revert'] +let provider: ethers.providers.JsonRpcProvider +let accounts: string[] + +beforeAll(async () => { + ;({ ensInstance, revert, provider } = await setup()) + accounts = await provider.listAccounts() +}) + +afterAll(async () => { + await revert() +}) + +describe('transferSubname', () => { + beforeEach(async () => { + await revert() + }) + it('should allow transferring a subname on the registry', async () => { + const tx = await ensInstance.transferSubname('test.with-subnames.eth', { + contract: 'registry', + owner: accounts[1], + addressOrIndex: 1, + }) + expect(tx).toBeTruthy() + await tx.wait() + + const registry = await ensInstance.contracts!.getRegistry()! + const result = await registry.owner(namehash('test.with-subnames.eth')) + expect(result).toBe(accounts[1]) + }) + it('should allow transferring a subname on the nameWrapper', async () => { + const tx = await ensInstance.transferSubname( + 'test.wrapped-with-subnames.eth', + { + contract: 'nameWrapper', + owner: accounts[1], + addressOrIndex: 1, + }, + ) + expect(tx).toBeTruthy() + await tx.wait() + + const nameWrapper = await ensInstance.contracts!.getNameWrapper()! + const result = await nameWrapper.ownerOf( + namehash('test.wrapped-with-subnames.eth'), + ) + expect(result).toBe(accounts[1]) + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/transferSubname.ts b/.yalc/@ensdomains/ensjs/src/functions/transferSubname.ts new file mode 100644 index 000000000..c1bbd85a7 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/transferSubname.ts @@ -0,0 +1,63 @@ +import { keccak256 as solidityKeccak256 } from '@ethersproject/solidity' +import { ENSArgs } from '..' +import { namehash } from '../utils/normalise' +import { Expiry, makeExpiry } from '../utils/wrapper' + +type BaseArgs = { + owner: string + resolverAddress?: string + contract: 'registry' | 'nameWrapper' +} + +type NameWrapperArgs = { + contract: 'nameWrapper' + expiry?: Expiry +} & BaseArgs + +type Args = BaseArgs | NameWrapperArgs + +export default async function ( + { + contracts, + signer, + getExpiry, + }: ENSArgs<'contracts' | 'signer' | 'getExpiry'>, + name: string, + { contract, owner, resolverAddress, ...wrapperArgs }: Args, +) { + const labels = name.split('.') + const label = labels.shift() as string + const labelhash = solidityKeccak256(['string'], [label]) + const parentNodehash = namehash(labels.join('.')) + + switch (contract) { + case 'registry': { + const registry = (await contracts!.getRegistry()!).connect(signer) + + return registry.populateTransaction.setSubnodeOwner( + parentNodehash, + labelhash, + owner, + ) + } + case 'nameWrapper': { + const nameWrapper = (await contracts!.getNameWrapper()!).connect(signer) + const expiry = await makeExpiry( + { getExpiry }, + labels.join('.'), + 'expiry' in wrapperArgs ? wrapperArgs.expiry : undefined, + ) + + return nameWrapper.populateTransaction.setSubnodeOwner( + parentNodehash, + label, + owner, + '0', + expiry, + ) + } + default: { + throw new Error(`Unknown contract: ${contract}`) + } + } +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/types.ts b/.yalc/@ensdomains/ensjs/src/functions/types.ts new file mode 100644 index 000000000..ce3087554 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/types.ts @@ -0,0 +1,100 @@ +import type batch from './batch' +import type { + multicallWrapper, + resolverMulticallWrapper, + universalWrapper, +} from './batchWrappers' +import type commitName from './commitName' +import type createSubname from './createSubname' +import type deleteSubname from './deleteSubname' +import type getAvailable from './getAvailable' +import type getDNSOwner from './getDNSOwner' +import type getExpiry from './getExpiry' +import type { getHistory } from './getHistory' +import type getName from './getName' +import type getNames from './getNames' +import type getOwner from './getOwner' +import type getPrice from './getPrice' +import type getProfile from './getProfile' +import type getRecords from './getRecords' +import type getResolver from './getResolver' +import type { + getABI, + getAddr, + getContentHash, + getText, + _getABI, + _getAddr, + _getContentHash, + _getText, +} from './getSpecificRecord' +import type getSubnames from './getSubnames' +import type getWrapperData from './getWrapperData' +import type importDNSSECName from './importDNSSECName' +import type registerName from './registerName' +import type { + // eslint-disable-next-line import/no-named-default + default as renewNames, + extendWrappedName, +} from './renewNames' +import type setFuses from './setFuses' +import type { setChildFuses } from './setFuses' +import type setName from './setName' +import type setRecord from './setRecord' +import type setRecords from './setRecords' +import type setResolver from './setResolver' +import type supportsTLD from './supportsTLD' +import type transferController from './transferController' +import type transferName from './transferName' +import type transferSubname from './transferSubname' +import type unwrapName from './unwrapName' +import type wrapName from './wrapName' + +type Function = { + batch: typeof batch + multicallWrapper: typeof multicallWrapper + resolverMulticallWrapper: typeof resolverMulticallWrapper + universalWrapper: typeof universalWrapper + setFuses: typeof setFuses + setChildFuses: typeof setChildFuses + commitName: typeof commitName + createSubname: typeof createSubname + deleteSubname: typeof deleteSubname + getAvailable: typeof getAvailable + getDNSOwner: typeof getDNSOwner + getExpiry: typeof getExpiry + getHistory: typeof getHistory + getName: typeof getName + getNames: typeof getNames + getOwner: typeof getOwner + getPrice: typeof getPrice + getProfile: typeof getProfile + getRecords: typeof getRecords + getResolver: typeof getResolver + getAddr: typeof getAddr + getContentHash: typeof getContentHash + getText: typeof getText + getABI: typeof getABI + _getAddr: typeof _getAddr + _getContentHash: typeof _getContentHash + _getText: typeof _getText + _getABI: typeof _getABI + getSubnames: typeof getSubnames + getWrapperData: typeof getWrapperData + importDNSSECName: typeof importDNSSECName + registerName: typeof registerName + renewNames: typeof renewNames + extendWrappedName: typeof extendWrappedName + setName: typeof setName + setRecord: typeof setRecord + setRecords: typeof setRecords + setResolver: typeof setResolver + supportsTLD: typeof supportsTLD + transferController: typeof transferController + transferName: typeof transferName + transferSubname: typeof transferSubname + unwrapName: typeof unwrapName + wrapName: typeof wrapName +} + +export default Function diff --git a/.yalc/@ensdomains/ensjs/src/functions/unwrapName.test.ts b/.yalc/@ensdomains/ensjs/src/functions/unwrapName.test.ts new file mode 100644 index 000000000..ab3b4ac75 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/unwrapName.test.ts @@ -0,0 +1,53 @@ +import { ethers, utils } from 'ethers' +import { ENS } from '..' +import setup from '../tests/setup' +import { namehash } from '../utils/normalise' + +let ensInstance: ENS +let revert: Awaited>['revert'] +let provider: ethers.providers.JsonRpcProvider +let accounts: string[] + +beforeAll(async () => { + ;({ ensInstance, revert, provider } = await setup()) + accounts = await provider.listAccounts() +}) + +afterAll(async () => { + await revert() +}) + +describe('unwrapName', () => { + beforeEach(async () => { + await revert() + }) + it('should return a .eth unwrap name transaction and succeed', async () => { + const tx = await ensInstance.unwrapName('wrapped.eth', { + newController: accounts[1], + newRegistrant: accounts[1], + addressOrIndex: 1, + }) + expect(tx).toBeTruthy() + await tx.wait() + + const baseRegistrar = await ensInstance.contracts!.getBaseRegistrar()! + const result = await baseRegistrar.ownerOf( + utils.solidityKeccak256(['string'], ['wrapped']), + ) + expect(result).toBe(accounts[1]) + }) + it('should return a regular unwrap name transaction and succeed', async () => { + const tx = await ensInstance.unwrapName('test.wrapped-with-subnames.eth', { + newController: accounts[1], + addressOrIndex: 2, + }) + expect(tx).toBeTruthy() + await tx.wait() + + const registry = await ensInstance.contracts!.getRegistry()! + const result = await registry.owner( + namehash('test.wrapped-with-subnames.eth'), + ) + expect(result).toBe(accounts[1]) + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/unwrapName.ts b/.yalc/@ensdomains/ensjs/src/functions/unwrapName.ts new file mode 100644 index 000000000..d5f39954f --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/unwrapName.ts @@ -0,0 +1,43 @@ +import { keccak256 as solidityKeccak256 } from '@ethersproject/solidity' + +import { ENSArgs } from '..' +import { namehash } from '../utils/normalise' + +export default async function ( + { contracts, signer }: ENSArgs<'contracts' | 'signer'>, + name: string, + { + newController, + newRegistrant, + }: { + newController: string + newRegistrant?: string + }, +) { + const labels = name.split('.') + const labelhash = solidityKeccak256(['string'], [labels[0]]) + const parentNodehash = namehash(labels.slice(1).join('.')) + + const nameWrapper = (await contracts!.getNameWrapper()!).connect(signer) + + if (labels.length === 2 && labels[1] === 'eth') { + if (!newRegistrant) { + throw new Error('newRegistrant must be specified for .eth names') + } + + return nameWrapper.populateTransaction.unwrapETH2LD( + labelhash, + newRegistrant, + newController, + ) + } + if (newRegistrant) { + throw new Error('newRegistrant can only be specified for .eth names') + } + + return nameWrapper.populateTransaction.unwrap( + parentNodehash, + labelhash, + newController, + ) +} diff --git a/.yalc/@ensdomains/ensjs/src/functions/wrapName.test.ts b/.yalc/@ensdomains/ensjs/src/functions/wrapName.test.ts new file mode 100644 index 000000000..d694da07f --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/wrapName.test.ts @@ -0,0 +1,151 @@ +import { ethers } from 'ethers' +import { ENS } from '..' +import setup from '../tests/setup' +import { hexEncodeName } from '../utils/hexEncodedName' +import { namehash } from '../utils/normalise' + +let ensInstance: ENS +let revert: Awaited>['revert'] +let provider: ethers.providers.JsonRpcProvider +let accounts: string[] + +beforeAll(async () => { + ;({ ensInstance, revert, provider } = await setup()) + accounts = await provider.listAccounts() +}) + +afterAll(async () => { + await revert() +}) + +const approve = async () => { + const nameWrapper = await ensInstance.contracts!.getNameWrapper()! + const registry = (await ensInstance.contracts!.getRegistry()!).connect( + provider.getSigner(2), + ) + const setApprovedForAllTx = await registry.setApprovalForAll( + nameWrapper.address, + true, + ) + await setApprovedForAllTx?.wait() +} + +describe('wrapName', () => { + beforeEach(async () => { + await revert() + }) + describe('.eth', () => { + it('should return a wrap name transaction and succeed', async () => { + const tx = await ensInstance.wrapName('test123.eth', { + wrappedOwner: accounts[2], + addressOrIndex: 1, + }) + expect(tx).toBeTruthy() + await tx.wait() + + const nameWrapper = await ensInstance.contracts!.getNameWrapper()! + const [, fuses] = await nameWrapper.getData(namehash('test123.eth')) + + expect(fuses).toBe(196608) + }) + it('should allow initial fuses', async () => { + const tx = await ensInstance.wrapName('test123.eth', { + wrappedOwner: accounts[2], + fuseOptions: { + child: { + named: ['CANNOT_UNWRAP', 'CANNOT_SET_TTL'], + }, + }, + addressOrIndex: 1, + }) + expect(tx).toBeTruthy() + await tx.wait() + + const nameWrapper = await ensInstance.contracts!.getNameWrapper()! + const [, fuses] = await nameWrapper.getData(namehash('test123.eth')) + expect(fuses).toBe(196625) + }) + it('should allow an initial resolver address', async () => { + const tx = await ensInstance.wrapName('test123.eth', { + wrappedOwner: accounts[2], + resolverAddress: '0x42D63ae25990889E35F215bC95884039Ba354115', + addressOrIndex: 1, + }) + expect(tx).toBeTruthy() + await tx.wait() + + const universalResolver = + await ensInstance.contracts!.getUniversalResolver()! + const [result] = await universalResolver.findResolver( + hexEncodeName('test123.eth'), + ) + expect(result).toBe('0x42D63ae25990889E35F215bC95884039Ba354115') + }) + it('should throw an error for labels longer than 255 bytes', async () => { + const label = 'a'.repeat(256) + await expect( + ensInstance.wrapName(`${label}.eth`, { + wrappedOwner: accounts[2], + addressOrIndex: 1, + }), + ).rejects.toThrow("Label can't be longer than 255 bytes") + }) + }) + describe('other', () => { + it('should return a wrap name transaction and succeed', async () => { + await approve() + + const tx = await ensInstance.wrapName('test.with-subnames.eth', { + wrappedOwner: accounts[2], + addressOrIndex: 2, + }) + expect(tx).toBeTruthy() + await tx.wait() + + const nameWrapper = await ensInstance.contracts!.getNameWrapper()! + const [, fuses] = await nameWrapper.getData( + namehash('test.with-subnames.eth'), + ) + + expect(fuses).toBe(0) + }) + it('should allow an initial resolver address', async () => { + await approve() + const tx = await ensInstance.wrapName('test.with-subnames.eth', { + wrappedOwner: accounts[2], + resolverAddress: '0x42D63ae25990889E35F215bC95884039Ba354115', + addressOrIndex: 2, + }) + expect(tx).toBeTruthy() + await tx.wait() + + const universalResolver = + await ensInstance.contracts!.getUniversalResolver()! + const [result] = await universalResolver.findResolver( + hexEncodeName('test.with-subnames.eth'), + ) + expect(result).toBe('0x42D63ae25990889E35F215bC95884039Ba354115') + }) + it('should throw an error if contract does not have approval', async () => { + await expect( + ensInstance.wrapName('test.with-subnames.eth', { + wrappedOwner: accounts[2], + addressOrIndex: 2, + }), + ).rejects.toThrow() + }) + it('should throw an error if initial fuses are provided', async () => { + await expect( + ensInstance.wrapName('test.with-subnames.eth', { + wrappedOwner: accounts[2], + fuseOptions: { + child: { + named: ['CANNOT_UNWRAP', 'CANNOT_SET_TTL'], + }, + }, + addressOrIndex: 1, + }), + ).rejects.toThrow() + }) + }) +}) diff --git a/.yalc/@ensdomains/ensjs/src/functions/wrapName.ts b/.yalc/@ensdomains/ensjs/src/functions/wrapName.ts new file mode 100644 index 000000000..16a1ae74a --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/functions/wrapName.ts @@ -0,0 +1,132 @@ +import { defaultAbiCoder } from '@ethersproject/abi/lib/abi-coder' +import { Signer } from '@ethersproject/abstract-signer' +import { keccak256 as solidityKeccak256 } from '@ethersproject/solidity' +import { ENSArgs } from '..' +import { CombinedFuseInput, encodeFuses } from '../utils/fuses' +import { hexEncodeName } from '../utils/hexEncodedName' +import { Expiry, wrappedLabelLengthCheck } from '../utils/wrapper' + +async function wrapETH( + { contracts }: ENSArgs<'contracts'>, + labels: string[], + wrappedOwner: string, + decodedFuses: number, + resolverAddress: string, + signer: Signer, + address: string, +) { + const nameWrapper = await contracts?.getNameWrapper()! + const baseRegistrar = (await contracts!.getBaseRegistrar()!).connect(signer) + + const labelhash = solidityKeccak256(['string'], [labels[0]]) + + const data = defaultAbiCoder.encode( + ['string', 'address', 'uint16', 'address'], + [labels[0], wrappedOwner, decodedFuses, resolverAddress], + ) + + return baseRegistrar.populateTransaction[ + 'safeTransferFrom(address,address,uint256,bytes)' + ](address, nameWrapper.address, labelhash, data) +} + +async function wrapOther( + { contracts }: ENSArgs<'contracts'>, + name: string, + wrappedOwner: string, + resolverAddress: string, + address: string, + signer: Signer, +) { + const nameWrapper = (await contracts!.getNameWrapper()!).connect(signer) + const registry = await contracts?.getRegistry()! + + const hasApproval = await registry.isApprovedForAll( + address, + nameWrapper.address, + ) + + if (!hasApproval) { + throw new Error( + 'NameWrapper must have approval to wrap a name from this address.', + ) + } + + return nameWrapper.populateTransaction.wrap( + hexEncodeName(name), + wrappedOwner, + resolverAddress, + ) +} + +export default async function ( + { contracts, signer }: ENSArgs<'contracts' | 'signer'>, + name: string, + { + wrappedOwner, + fuseOptions, + expiry, + resolverAddress, + }: { + wrappedOwner: string + fuseOptions?: Partial | number + expiry?: Expiry + resolverAddress?: string + }, +) { + const address = await signer.getAddress() + + let decodedFuses: number + + const publicResolver = await contracts?.getPublicResolver()! + if (!resolverAddress) resolverAddress = publicResolver.address + + const labels = name.split('.') + wrappedLabelLengthCheck(labels[0]) + + if (labels.length === 2 && labels[1] === 'eth') { + switch (typeof fuseOptions) { + case 'object': { + decodedFuses = encodeFuses(fuseOptions) + break + } + case 'number': { + decodedFuses = fuseOptions + break + } + case 'undefined': { + decodedFuses = 0 + break + } + default: { + throw new Error(`Invalid fuseOptions type: ${typeof fuseOptions}`) + } + } + + return wrapETH( + { contracts }, + labels, + wrappedOwner, + decodedFuses, + resolverAddress, + signer, + address, + ) + } + if (fuseOptions) + throw new Error( + 'Fuses can not be initially set when wrapping a non .eth name', + ) + if (expiry) + throw new Error( + 'Expiry can not be initially set when wrapping a non .eth name', + ) + return wrapOther( + { contracts }, + name, + wrappedOwner, + resolverAddress, + address, + signer, + ) +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/BaseRegistrarImplementation.ts b/.yalc/@ensdomains/ensjs/src/generated/BaseRegistrarImplementation.ts new file mode 100644 index 000000000..2fd2c5400 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/BaseRegistrarImplementation.ts @@ -0,0 +1,1195 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + EventFragment, + FunctionFragment, + Result, +} from '@ethersproject/abi' +import { Interface } from '@ethersproject/abi' +import type { Listener, Provider } from '@ethersproject/abstract-provider' +import type { Signer } from '@ethersproject/abstract-signer' +import type { BigNumber, BigNumberish } from '@ethersproject/bignumber' +import type { BytesLike } from '@ethersproject/bytes' +import type { + BaseContract, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, +} from '@ethersproject/contracts' +import type { + OnEvent, + PromiseOrValue, + TypedEvent, + TypedEventFilter, + TypedListener, +} from './common' + +export interface BaseRegistrarImplementationInterface extends Interface { + functions: { + 'GRACE_PERIOD()': FunctionFragment + 'addController(address)': FunctionFragment + 'approve(address,uint256)': FunctionFragment + 'available(uint256)': FunctionFragment + 'balanceOf(address)': FunctionFragment + 'baseNode()': FunctionFragment + 'controllers(address)': FunctionFragment + 'ens()': FunctionFragment + 'getApproved(uint256)': FunctionFragment + 'isApprovedForAll(address,address)': FunctionFragment + 'isOwner()': FunctionFragment + 'nameExpires(uint256)': FunctionFragment + 'owner()': FunctionFragment + 'ownerOf(uint256)': FunctionFragment + 'reclaim(uint256,address)': FunctionFragment + 'register(uint256,address,uint256)': FunctionFragment + 'registerOnly(uint256,address,uint256)': FunctionFragment + 'removeController(address)': FunctionFragment + 'renew(uint256,uint256)': FunctionFragment + 'renounceOwnership()': FunctionFragment + 'safeTransferFrom(address,address,uint256)': FunctionFragment + 'safeTransferFrom(address,address,uint256,bytes)': FunctionFragment + 'setApprovalForAll(address,bool)': FunctionFragment + 'setResolver(address)': FunctionFragment + 'supportsInterface(bytes4)': FunctionFragment + 'transferFrom(address,address,uint256)': FunctionFragment + 'transferOwnership(address)': FunctionFragment + } + + getFunction( + nameOrSignatureOrTopic: + | 'GRACE_PERIOD' + | 'addController' + | 'approve' + | 'available' + | 'balanceOf' + | 'baseNode' + | 'controllers' + | 'ens' + | 'getApproved' + | 'isApprovedForAll' + | 'isOwner' + | 'nameExpires' + | 'owner' + | 'ownerOf' + | 'reclaim' + | 'register' + | 'registerOnly' + | 'removeController' + | 'renew' + | 'renounceOwnership' + | 'safeTransferFrom(address,address,uint256)' + | 'safeTransferFrom(address,address,uint256,bytes)' + | 'setApprovalForAll' + | 'setResolver' + | 'supportsInterface' + | 'transferFrom' + | 'transferOwnership', + ): FunctionFragment + + encodeFunctionData( + functionFragment: 'GRACE_PERIOD', + values?: undefined, + ): string + encodeFunctionData( + functionFragment: 'addController', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'approve', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'available', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'balanceOf', + values: [PromiseOrValue], + ): string + encodeFunctionData(functionFragment: 'baseNode', values?: undefined): string + encodeFunctionData( + functionFragment: 'controllers', + values: [PromiseOrValue], + ): string + encodeFunctionData(functionFragment: 'ens', values?: undefined): string + encodeFunctionData( + functionFragment: 'getApproved', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'isApprovedForAll', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData(functionFragment: 'isOwner', values?: undefined): string + encodeFunctionData( + functionFragment: 'nameExpires', + values: [PromiseOrValue], + ): string + encodeFunctionData(functionFragment: 'owner', values?: undefined): string + encodeFunctionData( + functionFragment: 'ownerOf', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'reclaim', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'register', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'registerOnly', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'removeController', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'renew', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'renounceOwnership', + values?: undefined, + ): string + encodeFunctionData( + functionFragment: 'safeTransferFrom(address,address,uint256)', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'safeTransferFrom(address,address,uint256,bytes)', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'setApprovalForAll', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setResolver', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'supportsInterface', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'transferFrom', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'transferOwnership', + values: [PromiseOrValue], + ): string + + decodeFunctionResult( + functionFragment: 'GRACE_PERIOD', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'addController', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'approve', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'available', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'baseNode', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'controllers', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'ens', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'getApproved', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'isApprovedForAll', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'isOwner', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'nameExpires', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'ownerOf', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'reclaim', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'register', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'registerOnly', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'removeController', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'renew', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'renounceOwnership', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'safeTransferFrom(address,address,uint256)', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'safeTransferFrom(address,address,uint256,bytes)', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'setApprovalForAll', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'setResolver', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'supportsInterface', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'transferFrom', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'transferOwnership', + data: BytesLike, + ): Result + + events: { + 'Approval(address,address,uint256)': EventFragment + 'ApprovalForAll(address,address,bool)': EventFragment + 'ControllerAdded(address)': EventFragment + 'ControllerRemoved(address)': EventFragment + 'NameMigrated(uint256,address,uint256)': EventFragment + 'NameRegistered(uint256,address,uint256)': EventFragment + 'NameRenewed(uint256,uint256)': EventFragment + 'OwnershipTransferred(address,address)': EventFragment + 'Transfer(address,address,uint256)': EventFragment + } + + getEvent(nameOrSignatureOrTopic: 'Approval'): EventFragment + getEvent(nameOrSignatureOrTopic: 'ApprovalForAll'): EventFragment + getEvent(nameOrSignatureOrTopic: 'ControllerAdded'): EventFragment + getEvent(nameOrSignatureOrTopic: 'ControllerRemoved'): EventFragment + getEvent(nameOrSignatureOrTopic: 'NameMigrated'): EventFragment + getEvent(nameOrSignatureOrTopic: 'NameRegistered'): EventFragment + getEvent(nameOrSignatureOrTopic: 'NameRenewed'): EventFragment + getEvent(nameOrSignatureOrTopic: 'OwnershipTransferred'): EventFragment + getEvent(nameOrSignatureOrTopic: 'Transfer'): EventFragment +} + +export interface ApprovalEventObject { + owner: string + approved: string + tokenId: BigNumber +} +export type ApprovalEvent = TypedEvent< + [string, string, BigNumber], + ApprovalEventObject +> + +export type ApprovalEventFilter = TypedEventFilter + +export interface ApprovalForAllEventObject { + owner: string + operator: string + approved: boolean +} +export type ApprovalForAllEvent = TypedEvent< + [string, string, boolean], + ApprovalForAllEventObject +> + +export type ApprovalForAllEventFilter = TypedEventFilter + +export interface ControllerAddedEventObject { + controller: string +} +export type ControllerAddedEvent = TypedEvent< + [string], + ControllerAddedEventObject +> + +export type ControllerAddedEventFilter = TypedEventFilter + +export interface ControllerRemovedEventObject { + controller: string +} +export type ControllerRemovedEvent = TypedEvent< + [string], + ControllerRemovedEventObject +> + +export type ControllerRemovedEventFilter = + TypedEventFilter + +export interface NameMigratedEventObject { + id: BigNumber + owner: string + expires: BigNumber +} +export type NameMigratedEvent = TypedEvent< + [BigNumber, string, BigNumber], + NameMigratedEventObject +> + +export type NameMigratedEventFilter = TypedEventFilter + +export interface NameRegisteredEventObject { + id: BigNumber + owner: string + expires: BigNumber +} +export type NameRegisteredEvent = TypedEvent< + [BigNumber, string, BigNumber], + NameRegisteredEventObject +> + +export type NameRegisteredEventFilter = TypedEventFilter + +export interface NameRenewedEventObject { + id: BigNumber + expires: BigNumber +} +export type NameRenewedEvent = TypedEvent< + [BigNumber, BigNumber], + NameRenewedEventObject +> + +export type NameRenewedEventFilter = TypedEventFilter + +export interface OwnershipTransferredEventObject { + previousOwner: string + newOwner: string +} +export type OwnershipTransferredEvent = TypedEvent< + [string, string], + OwnershipTransferredEventObject +> + +export type OwnershipTransferredEventFilter = + TypedEventFilter + +export interface TransferEventObject { + from: string + to: string + tokenId: BigNumber +} +export type TransferEvent = TypedEvent< + [string, string, BigNumber], + TransferEventObject +> + +export type TransferEventFilter = TypedEventFilter + +export interface BaseRegistrarImplementation extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this + attach(addressOrName: string): this + deployed(): Promise + + interface: BaseRegistrarImplementationInterface + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise> + + listeners( + eventFilter?: TypedEventFilter, + ): Array> + listeners(eventName?: string): Array + removeAllListeners( + eventFilter: TypedEventFilter, + ): this + removeAllListeners(eventName?: string): this + off: OnEvent + on: OnEvent + once: OnEvent + removeListener: OnEvent + + functions: { + GRACE_PERIOD(overrides?: CallOverrides): Promise<[BigNumber]> + + addController( + controller: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + approve( + to: PromiseOrValue, + tokenId: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + available( + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + balanceOf( + owner: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[BigNumber]> + + baseNode(overrides?: CallOverrides): Promise<[string]> + + controllers( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + ens(overrides?: CallOverrides): Promise<[string]> + + getApproved( + tokenId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string]> + + isApprovedForAll( + owner: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + isOwner(overrides?: CallOverrides): Promise<[boolean]> + + nameExpires( + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[BigNumber]> + + owner(overrides?: CallOverrides): Promise<[string]> + + ownerOf( + tokenId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string]> + + reclaim( + id: PromiseOrValue, + owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + register( + id: PromiseOrValue, + owner: PromiseOrValue, + duration: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + registerOnly( + id: PromiseOrValue, + owner: PromiseOrValue, + duration: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + removeController( + controller: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + renew( + id: PromiseOrValue, + duration: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + renounceOwnership( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + 'safeTransferFrom(address,address,uint256)'( + from: PromiseOrValue, + to: PromiseOrValue, + tokenId: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + 'safeTransferFrom(address,address,uint256,bytes)'( + from: PromiseOrValue, + to: PromiseOrValue, + tokenId: PromiseOrValue, + _data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setApprovalForAll( + to: PromiseOrValue, + approved: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setResolver( + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + transferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + tokenId: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + } + + GRACE_PERIOD(overrides?: CallOverrides): Promise + + addController( + controller: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + approve( + to: PromiseOrValue, + tokenId: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + available( + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + balanceOf( + owner: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + baseNode(overrides?: CallOverrides): Promise + + controllers( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + ens(overrides?: CallOverrides): Promise + + getApproved( + tokenId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + isApprovedForAll( + owner: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + isOwner(overrides?: CallOverrides): Promise + + nameExpires( + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + owner(overrides?: CallOverrides): Promise + + ownerOf( + tokenId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + reclaim( + id: PromiseOrValue, + owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + register( + id: PromiseOrValue, + owner: PromiseOrValue, + duration: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + registerOnly( + id: PromiseOrValue, + owner: PromiseOrValue, + duration: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + removeController( + controller: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + renew( + id: PromiseOrValue, + duration: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + renounceOwnership( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + 'safeTransferFrom(address,address,uint256)'( + from: PromiseOrValue, + to: PromiseOrValue, + tokenId: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + 'safeTransferFrom(address,address,uint256,bytes)'( + from: PromiseOrValue, + to: PromiseOrValue, + tokenId: PromiseOrValue, + _data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setApprovalForAll( + to: PromiseOrValue, + approved: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setResolver( + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + transferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + tokenId: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + callStatic: { + GRACE_PERIOD(overrides?: CallOverrides): Promise + + addController( + controller: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + approve( + to: PromiseOrValue, + tokenId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + available( + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + balanceOf( + owner: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + baseNode(overrides?: CallOverrides): Promise + + controllers( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + ens(overrides?: CallOverrides): Promise + + getApproved( + tokenId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + isApprovedForAll( + owner: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + isOwner(overrides?: CallOverrides): Promise + + nameExpires( + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + owner(overrides?: CallOverrides): Promise + + ownerOf( + tokenId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + reclaim( + id: PromiseOrValue, + owner: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + register( + id: PromiseOrValue, + owner: PromiseOrValue, + duration: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + registerOnly( + id: PromiseOrValue, + owner: PromiseOrValue, + duration: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + removeController( + controller: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + renew( + id: PromiseOrValue, + duration: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + renounceOwnership(overrides?: CallOverrides): Promise + + 'safeTransferFrom(address,address,uint256)'( + from: PromiseOrValue, + to: PromiseOrValue, + tokenId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + 'safeTransferFrom(address,address,uint256,bytes)'( + from: PromiseOrValue, + to: PromiseOrValue, + tokenId: PromiseOrValue, + _data: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setApprovalForAll( + to: PromiseOrValue, + approved: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setResolver( + resolver: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + transferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + tokenId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + filters: { + 'Approval(address,address,uint256)'( + owner?: PromiseOrValue | null, + approved?: PromiseOrValue | null, + tokenId?: PromiseOrValue | null, + ): ApprovalEventFilter + Approval( + owner?: PromiseOrValue | null, + approved?: PromiseOrValue | null, + tokenId?: PromiseOrValue | null, + ): ApprovalEventFilter + + 'ApprovalForAll(address,address,bool)'( + owner?: PromiseOrValue | null, + operator?: PromiseOrValue | null, + approved?: null, + ): ApprovalForAllEventFilter + ApprovalForAll( + owner?: PromiseOrValue | null, + operator?: PromiseOrValue | null, + approved?: null, + ): ApprovalForAllEventFilter + + 'ControllerAdded(address)'( + controller?: PromiseOrValue | null, + ): ControllerAddedEventFilter + ControllerAdded( + controller?: PromiseOrValue | null, + ): ControllerAddedEventFilter + + 'ControllerRemoved(address)'( + controller?: PromiseOrValue | null, + ): ControllerRemovedEventFilter + ControllerRemoved( + controller?: PromiseOrValue | null, + ): ControllerRemovedEventFilter + + 'NameMigrated(uint256,address,uint256)'( + id?: PromiseOrValue | null, + owner?: PromiseOrValue | null, + expires?: null, + ): NameMigratedEventFilter + NameMigrated( + id?: PromiseOrValue | null, + owner?: PromiseOrValue | null, + expires?: null, + ): NameMigratedEventFilter + + 'NameRegistered(uint256,address,uint256)'( + id?: PromiseOrValue | null, + owner?: PromiseOrValue | null, + expires?: null, + ): NameRegisteredEventFilter + NameRegistered( + id?: PromiseOrValue | null, + owner?: PromiseOrValue | null, + expires?: null, + ): NameRegisteredEventFilter + + 'NameRenewed(uint256,uint256)'( + id?: PromiseOrValue | null, + expires?: null, + ): NameRenewedEventFilter + NameRenewed( + id?: PromiseOrValue | null, + expires?: null, + ): NameRenewedEventFilter + + 'OwnershipTransferred(address,address)'( + previousOwner?: PromiseOrValue | null, + newOwner?: PromiseOrValue | null, + ): OwnershipTransferredEventFilter + OwnershipTransferred( + previousOwner?: PromiseOrValue | null, + newOwner?: PromiseOrValue | null, + ): OwnershipTransferredEventFilter + + 'Transfer(address,address,uint256)'( + from?: PromiseOrValue | null, + to?: PromiseOrValue | null, + tokenId?: PromiseOrValue | null, + ): TransferEventFilter + Transfer( + from?: PromiseOrValue | null, + to?: PromiseOrValue | null, + tokenId?: PromiseOrValue | null, + ): TransferEventFilter + } + + estimateGas: { + GRACE_PERIOD(overrides?: CallOverrides): Promise + + addController( + controller: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + approve( + to: PromiseOrValue, + tokenId: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + available( + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + balanceOf( + owner: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + baseNode(overrides?: CallOverrides): Promise + + controllers( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + ens(overrides?: CallOverrides): Promise + + getApproved( + tokenId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + isApprovedForAll( + owner: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + isOwner(overrides?: CallOverrides): Promise + + nameExpires( + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + owner(overrides?: CallOverrides): Promise + + ownerOf( + tokenId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + reclaim( + id: PromiseOrValue, + owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + register( + id: PromiseOrValue, + owner: PromiseOrValue, + duration: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + registerOnly( + id: PromiseOrValue, + owner: PromiseOrValue, + duration: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + removeController( + controller: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + renew( + id: PromiseOrValue, + duration: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + renounceOwnership( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + 'safeTransferFrom(address,address,uint256)'( + from: PromiseOrValue, + to: PromiseOrValue, + tokenId: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + 'safeTransferFrom(address,address,uint256,bytes)'( + from: PromiseOrValue, + to: PromiseOrValue, + tokenId: PromiseOrValue, + _data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setApprovalForAll( + to: PromiseOrValue, + approved: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setResolver( + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + transferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + tokenId: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + } + + populateTransaction: { + GRACE_PERIOD(overrides?: CallOverrides): Promise + + addController( + controller: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + approve( + to: PromiseOrValue, + tokenId: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + available( + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + balanceOf( + owner: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + baseNode(overrides?: CallOverrides): Promise + + controllers( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + ens(overrides?: CallOverrides): Promise + + getApproved( + tokenId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + isApprovedForAll( + owner: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + isOwner(overrides?: CallOverrides): Promise + + nameExpires( + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + owner(overrides?: CallOverrides): Promise + + ownerOf( + tokenId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + reclaim( + id: PromiseOrValue, + owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + register( + id: PromiseOrValue, + owner: PromiseOrValue, + duration: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + registerOnly( + id: PromiseOrValue, + owner: PromiseOrValue, + duration: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + removeController( + controller: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + renew( + id: PromiseOrValue, + duration: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + renounceOwnership( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + 'safeTransferFrom(address,address,uint256)'( + from: PromiseOrValue, + to: PromiseOrValue, + tokenId: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + 'safeTransferFrom(address,address,uint256,bytes)'( + from: PromiseOrValue, + to: PromiseOrValue, + tokenId: PromiseOrValue, + _data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setApprovalForAll( + to: PromiseOrValue, + approved: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setResolver( + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + transferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + tokenId: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/BulkRenewal.ts b/.yalc/@ensdomains/ensjs/src/generated/BulkRenewal.ts new file mode 100644 index 000000000..f0d33b1da --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/BulkRenewal.ts @@ -0,0 +1,196 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { FunctionFragment, Result } from '@ethersproject/abi' +import { Interface } from '@ethersproject/abi' +import type { Listener, Provider } from '@ethersproject/abstract-provider' +import type { Signer } from '@ethersproject/abstract-signer' +import type { BigNumber, BigNumberish } from '@ethersproject/bignumber' +import type { BytesLike } from '@ethersproject/bytes' +import type { + BaseContract, + CallOverrides, + ContractTransaction, + PayableOverrides, + PopulatedTransaction, +} from '@ethersproject/contracts' +import type { + OnEvent, + PromiseOrValue, + TypedEvent, + TypedEventFilter, + TypedListener, +} from './common' + +export interface BulkRenewalInterface extends Interface { + functions: { + 'ens()': FunctionFragment + 'renewAll(string[],uint256)': FunctionFragment + 'rentPrice(string[],uint256)': FunctionFragment + 'supportsInterface(bytes4)': FunctionFragment + } + + getFunction( + nameOrSignatureOrTopic: + | 'ens' + | 'renewAll' + | 'rentPrice' + | 'supportsInterface', + ): FunctionFragment + + encodeFunctionData(functionFragment: 'ens', values?: undefined): string + encodeFunctionData( + functionFragment: 'renewAll', + values: [PromiseOrValue[], PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'rentPrice', + values: [PromiseOrValue[], PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'supportsInterface', + values: [PromiseOrValue], + ): string + + decodeFunctionResult(functionFragment: 'ens', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'renewAll', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'rentPrice', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'supportsInterface', + data: BytesLike, + ): Result + + events: {} +} + +export interface BulkRenewal extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this + attach(addressOrName: string): this + deployed(): Promise + + interface: BulkRenewalInterface + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise> + + listeners( + eventFilter?: TypedEventFilter, + ): Array> + listeners(eventName?: string): Array + removeAllListeners( + eventFilter: TypedEventFilter, + ): this + removeAllListeners(eventName?: string): this + off: OnEvent + on: OnEvent + once: OnEvent + removeListener: OnEvent + + functions: { + ens(overrides?: CallOverrides): Promise<[string]> + + renewAll( + names: PromiseOrValue[], + duration: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + rentPrice( + names: PromiseOrValue[], + duration: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[BigNumber] & { total: BigNumber }> + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + } + + ens(overrides?: CallOverrides): Promise + + renewAll( + names: PromiseOrValue[], + duration: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + rentPrice( + names: PromiseOrValue[], + duration: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + callStatic: { + ens(overrides?: CallOverrides): Promise + + renewAll( + names: PromiseOrValue[], + duration: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + rentPrice( + names: PromiseOrValue[], + duration: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + filters: {} + + estimateGas: { + ens(overrides?: CallOverrides): Promise + + renewAll( + names: PromiseOrValue[], + duration: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + rentPrice( + names: PromiseOrValue[], + duration: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + populateTransaction: { + ens(overrides?: CallOverrides): Promise + + renewAll( + names: PromiseOrValue[], + duration: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + rentPrice( + names: PromiseOrValue[], + duration: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/DNSRegistrar.ts b/.yalc/@ensdomains/ensjs/src/generated/DNSRegistrar.ts new file mode 100644 index 000000000..6c05884cf --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/DNSRegistrar.ts @@ -0,0 +1,459 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + EventFragment, + FunctionFragment, + Result, +} from '@ethersproject/abi' +import { Interface } from '@ethersproject/abi' +import type { Listener, Provider } from '@ethersproject/abstract-provider' +import type { Signer } from '@ethersproject/abstract-signer' +import type { BigNumber } from '@ethersproject/bignumber' +import type { BytesLike } from '@ethersproject/bytes' +import type { + BaseContract, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, +} from '@ethersproject/contracts' +import type { + OnEvent, + PromiseOrValue, + TypedEvent, + TypedEventFilter, + TypedListener, +} from './common' + +export declare namespace DNSSEC { + export type RRSetWithSignatureStruct = { + rrset: PromiseOrValue + sig: PromiseOrValue + } + + export type RRSetWithSignatureStructOutput = [string, string] & { + rrset: string + sig: string + } +} + +export interface DNSRegistrarInterface extends Interface { + functions: { + 'claim(bytes,bytes)': FunctionFragment + 'ens()': FunctionFragment + 'oracle()': FunctionFragment + 'proveAndClaim(bytes,(bytes,bytes)[],bytes)': FunctionFragment + 'proveAndClaimWithResolver(bytes,(bytes,bytes)[],bytes,address,address)': FunctionFragment + 'setOracle(address)': FunctionFragment + 'setPublicSuffixList(address)': FunctionFragment + 'suffixes()': FunctionFragment + 'supportsInterface(bytes4)': FunctionFragment + } + + getFunction( + nameOrSignatureOrTopic: + | 'claim' + | 'ens' + | 'oracle' + | 'proveAndClaim' + | 'proveAndClaimWithResolver' + | 'setOracle' + | 'setPublicSuffixList' + | 'suffixes' + | 'supportsInterface', + ): FunctionFragment + + encodeFunctionData( + functionFragment: 'claim', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData(functionFragment: 'ens', values?: undefined): string + encodeFunctionData(functionFragment: 'oracle', values?: undefined): string + encodeFunctionData( + functionFragment: 'proveAndClaim', + values: [ + PromiseOrValue, + DNSSEC.RRSetWithSignatureStruct[], + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'proveAndClaimWithResolver', + values: [ + PromiseOrValue, + DNSSEC.RRSetWithSignatureStruct[], + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'setOracle', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setPublicSuffixList', + values: [PromiseOrValue], + ): string + encodeFunctionData(functionFragment: 'suffixes', values?: undefined): string + encodeFunctionData( + functionFragment: 'supportsInterface', + values: [PromiseOrValue], + ): string + + decodeFunctionResult(functionFragment: 'claim', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'ens', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'oracle', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'proveAndClaim', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'proveAndClaimWithResolver', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'setOracle', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'setPublicSuffixList', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'suffixes', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'supportsInterface', + data: BytesLike, + ): Result + + events: { + 'Claim(bytes32,address,bytes)': EventFragment + 'NewOracle(address)': EventFragment + 'NewPublicSuffixList(address)': EventFragment + } + + getEvent(nameOrSignatureOrTopic: 'Claim'): EventFragment + getEvent(nameOrSignatureOrTopic: 'NewOracle'): EventFragment + getEvent(nameOrSignatureOrTopic: 'NewPublicSuffixList'): EventFragment +} + +export interface ClaimEventObject { + node: string + owner: string + dnsname: string +} +export type ClaimEvent = TypedEvent<[string, string, string], ClaimEventObject> + +export type ClaimEventFilter = TypedEventFilter + +export interface NewOracleEventObject { + oracle: string +} +export type NewOracleEvent = TypedEvent<[string], NewOracleEventObject> + +export type NewOracleEventFilter = TypedEventFilter + +export interface NewPublicSuffixListEventObject { + suffixes: string +} +export type NewPublicSuffixListEvent = TypedEvent< + [string], + NewPublicSuffixListEventObject +> + +export type NewPublicSuffixListEventFilter = + TypedEventFilter + +export interface DNSRegistrar extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this + attach(addressOrName: string): this + deployed(): Promise + + interface: DNSRegistrarInterface + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise> + + listeners( + eventFilter?: TypedEventFilter, + ): Array> + listeners(eventName?: string): Array + removeAllListeners( + eventFilter: TypedEventFilter, + ): this + removeAllListeners(eventName?: string): this + off: OnEvent + on: OnEvent + once: OnEvent + removeListener: OnEvent + + functions: { + /** + * Claims a name by proving ownership of its DNS equivalent. + * @param name The name to claim, in DNS wire format. + * @param proof A DNS RRSet proving ownership of the name. Must be verified in the DNSSEC oracle before calling. This RRSET must contain a TXT record for '_ens.' + name, with the value 'a=0x...'. Ownership of the name will be transferred to the address specified in the TXT record. + */ + claim( + name: PromiseOrValue, + proof: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + ens(overrides?: CallOverrides): Promise<[string]> + + oracle(overrides?: CallOverrides): Promise<[string]> + + proveAndClaim( + name: PromiseOrValue, + input: DNSSEC.RRSetWithSignatureStruct[], + proof: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + proveAndClaimWithResolver( + name: PromiseOrValue, + input: DNSSEC.RRSetWithSignatureStruct[], + proof: PromiseOrValue, + resolver: PromiseOrValue, + addr: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setOracle( + _dnssec: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setPublicSuffixList( + _suffixes: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + suffixes(overrides?: CallOverrides): Promise<[string]> + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + } + + /** + * Claims a name by proving ownership of its DNS equivalent. + * @param name The name to claim, in DNS wire format. + * @param proof A DNS RRSet proving ownership of the name. Must be verified in the DNSSEC oracle before calling. This RRSET must contain a TXT record for '_ens.' + name, with the value 'a=0x...'. Ownership of the name will be transferred to the address specified in the TXT record. + */ + claim( + name: PromiseOrValue, + proof: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + ens(overrides?: CallOverrides): Promise + + oracle(overrides?: CallOverrides): Promise + + proveAndClaim( + name: PromiseOrValue, + input: DNSSEC.RRSetWithSignatureStruct[], + proof: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + proveAndClaimWithResolver( + name: PromiseOrValue, + input: DNSSEC.RRSetWithSignatureStruct[], + proof: PromiseOrValue, + resolver: PromiseOrValue, + addr: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setOracle( + _dnssec: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setPublicSuffixList( + _suffixes: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + suffixes(overrides?: CallOverrides): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + callStatic: { + /** + * Claims a name by proving ownership of its DNS equivalent. + * @param name The name to claim, in DNS wire format. + * @param proof A DNS RRSet proving ownership of the name. Must be verified in the DNSSEC oracle before calling. This RRSET must contain a TXT record for '_ens.' + name, with the value 'a=0x...'. Ownership of the name will be transferred to the address specified in the TXT record. + */ + claim( + name: PromiseOrValue, + proof: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + ens(overrides?: CallOverrides): Promise + + oracle(overrides?: CallOverrides): Promise + + proveAndClaim( + name: PromiseOrValue, + input: DNSSEC.RRSetWithSignatureStruct[], + proof: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + proveAndClaimWithResolver( + name: PromiseOrValue, + input: DNSSEC.RRSetWithSignatureStruct[], + proof: PromiseOrValue, + resolver: PromiseOrValue, + addr: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setOracle( + _dnssec: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setPublicSuffixList( + _suffixes: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + suffixes(overrides?: CallOverrides): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + filters: { + 'Claim(bytes32,address,bytes)'( + node?: PromiseOrValue | null, + owner?: PromiseOrValue | null, + dnsname?: null, + ): ClaimEventFilter + Claim( + node?: PromiseOrValue | null, + owner?: PromiseOrValue | null, + dnsname?: null, + ): ClaimEventFilter + + 'NewOracle(address)'(oracle?: null): NewOracleEventFilter + NewOracle(oracle?: null): NewOracleEventFilter + + 'NewPublicSuffixList(address)'( + suffixes?: null, + ): NewPublicSuffixListEventFilter + NewPublicSuffixList(suffixes?: null): NewPublicSuffixListEventFilter + } + + estimateGas: { + /** + * Claims a name by proving ownership of its DNS equivalent. + * @param name The name to claim, in DNS wire format. + * @param proof A DNS RRSet proving ownership of the name. Must be verified in the DNSSEC oracle before calling. This RRSET must contain a TXT record for '_ens.' + name, with the value 'a=0x...'. Ownership of the name will be transferred to the address specified in the TXT record. + */ + claim( + name: PromiseOrValue, + proof: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + ens(overrides?: CallOverrides): Promise + + oracle(overrides?: CallOverrides): Promise + + proveAndClaim( + name: PromiseOrValue, + input: DNSSEC.RRSetWithSignatureStruct[], + proof: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + proveAndClaimWithResolver( + name: PromiseOrValue, + input: DNSSEC.RRSetWithSignatureStruct[], + proof: PromiseOrValue, + resolver: PromiseOrValue, + addr: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setOracle( + _dnssec: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setPublicSuffixList( + _suffixes: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + suffixes(overrides?: CallOverrides): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + populateTransaction: { + /** + * Claims a name by proving ownership of its DNS equivalent. + * @param name The name to claim, in DNS wire format. + * @param proof A DNS RRSet proving ownership of the name. Must be verified in the DNSSEC oracle before calling. This RRSET must contain a TXT record for '_ens.' + name, with the value 'a=0x...'. Ownership of the name will be transferred to the address specified in the TXT record. + */ + claim( + name: PromiseOrValue, + proof: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + ens(overrides?: CallOverrides): Promise + + oracle(overrides?: CallOverrides): Promise + + proveAndClaim( + name: PromiseOrValue, + input: DNSSEC.RRSetWithSignatureStruct[], + proof: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + proveAndClaimWithResolver( + name: PromiseOrValue, + input: DNSSEC.RRSetWithSignatureStruct[], + proof: PromiseOrValue, + resolver: PromiseOrValue, + addr: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setOracle( + _dnssec: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setPublicSuffixList( + _suffixes: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + suffixes(overrides?: CallOverrides): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/DNSSECImpl.ts b/.yalc/@ensdomains/ensjs/src/generated/DNSSECImpl.ts new file mode 100644 index 000000000..382aafda8 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/DNSSECImpl.ts @@ -0,0 +1,794 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + EventFragment, + FunctionFragment, + Result, +} from '@ethersproject/abi' +import { Interface } from '@ethersproject/abi' +import type { Listener, Provider } from '@ethersproject/abstract-provider' +import type { Signer } from '@ethersproject/abstract-signer' +import type { BigNumber, BigNumberish } from '@ethersproject/bignumber' +import type { BytesLike } from '@ethersproject/bytes' +import type { + BaseContract, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, +} from '@ethersproject/contracts' +import type { + OnEvent, + PromiseOrValue, + TypedEvent, + TypedEventFilter, + TypedListener, +} from './common' + +export declare namespace DNSSEC { + export type RRSetWithSignatureStruct = { + rrset: PromiseOrValue + sig: PromiseOrValue + } + + export type RRSetWithSignatureStructOutput = [string, string] & { + rrset: string + sig: string + } +} + +export interface DNSSECImplInterface extends Interface { + functions: { + 'algorithms(uint8)': FunctionFragment + 'anchors()': FunctionFragment + 'deleteRRSet(uint16,bytes,(bytes,bytes),bytes)': FunctionFragment + 'deleteRRSetNSEC3(uint16,bytes,(bytes,bytes),(bytes,bytes),bytes)': FunctionFragment + 'digests(uint8)': FunctionFragment + 'nsec3Digests(uint8)': FunctionFragment + 'owner()': FunctionFragment + 'rrdata(uint16,bytes)': FunctionFragment + 'setAlgorithm(uint8,address)': FunctionFragment + 'setDigest(uint8,address)': FunctionFragment + 'setNSEC3Digest(uint8,address)': FunctionFragment + 'setOwner(address)': FunctionFragment + 'submitRRSet((bytes,bytes),bytes)': FunctionFragment + 'submitRRSets((bytes,bytes)[],bytes)': FunctionFragment + } + + getFunction( + nameOrSignatureOrTopic: + | 'algorithms' + | 'anchors' + | 'deleteRRSet' + | 'deleteRRSetNSEC3' + | 'digests' + | 'nsec3Digests' + | 'owner' + | 'rrdata' + | 'setAlgorithm' + | 'setDigest' + | 'setNSEC3Digest' + | 'setOwner' + | 'submitRRSet' + | 'submitRRSets', + ): FunctionFragment + + encodeFunctionData( + functionFragment: 'algorithms', + values: [PromiseOrValue], + ): string + encodeFunctionData(functionFragment: 'anchors', values?: undefined): string + encodeFunctionData( + functionFragment: 'deleteRRSet', + values: [ + PromiseOrValue, + PromiseOrValue, + DNSSEC.RRSetWithSignatureStruct, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'deleteRRSetNSEC3', + values: [ + PromiseOrValue, + PromiseOrValue, + DNSSEC.RRSetWithSignatureStruct, + DNSSEC.RRSetWithSignatureStruct, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'digests', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'nsec3Digests', + values: [PromiseOrValue], + ): string + encodeFunctionData(functionFragment: 'owner', values?: undefined): string + encodeFunctionData( + functionFragment: 'rrdata', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setAlgorithm', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setDigest', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setNSEC3Digest', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setOwner', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'submitRRSet', + values: [DNSSEC.RRSetWithSignatureStruct, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'submitRRSets', + values: [DNSSEC.RRSetWithSignatureStruct[], PromiseOrValue], + ): string + + decodeFunctionResult(functionFragment: 'algorithms', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'anchors', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'deleteRRSet', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'deleteRRSetNSEC3', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'digests', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'nsec3Digests', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'rrdata', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'setAlgorithm', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'setDigest', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'setNSEC3Digest', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'setOwner', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'submitRRSet', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'submitRRSets', + data: BytesLike, + ): Result + + events: { + 'AlgorithmUpdated(uint8,address)': EventFragment + 'DigestUpdated(uint8,address)': EventFragment + 'Marker()': EventFragment + 'NSEC3DigestUpdated(uint8,address)': EventFragment + 'RRSetUpdated(bytes,bytes)': EventFragment + 'Test(uint256)': EventFragment + } + + getEvent(nameOrSignatureOrTopic: 'AlgorithmUpdated'): EventFragment + getEvent(nameOrSignatureOrTopic: 'DigestUpdated'): EventFragment + getEvent(nameOrSignatureOrTopic: 'Marker'): EventFragment + getEvent(nameOrSignatureOrTopic: 'NSEC3DigestUpdated'): EventFragment + getEvent(nameOrSignatureOrTopic: 'RRSetUpdated'): EventFragment + getEvent(nameOrSignatureOrTopic: 'Test'): EventFragment +} + +export interface AlgorithmUpdatedEventObject { + id: number + addr: string +} +export type AlgorithmUpdatedEvent = TypedEvent< + [number, string], + AlgorithmUpdatedEventObject +> + +export type AlgorithmUpdatedEventFilter = + TypedEventFilter + +export interface DigestUpdatedEventObject { + id: number + addr: string +} +export type DigestUpdatedEvent = TypedEvent< + [number, string], + DigestUpdatedEventObject +> + +export type DigestUpdatedEventFilter = TypedEventFilter + +export interface MarkerEventObject {} +export type MarkerEvent = TypedEvent<[], MarkerEventObject> + +export type MarkerEventFilter = TypedEventFilter + +export interface NSEC3DigestUpdatedEventObject { + id: number + addr: string +} +export type NSEC3DigestUpdatedEvent = TypedEvent< + [number, string], + NSEC3DigestUpdatedEventObject +> + +export type NSEC3DigestUpdatedEventFilter = + TypedEventFilter + +export interface RRSetUpdatedEventObject { + name: string + rrset: string +} +export type RRSetUpdatedEvent = TypedEvent< + [string, string], + RRSetUpdatedEventObject +> + +export type RRSetUpdatedEventFilter = TypedEventFilter + +export interface TestEventObject { + t: BigNumber +} +export type TestEvent = TypedEvent<[BigNumber], TestEventObject> + +export type TestEventFilter = TypedEventFilter + +export interface DNSSECImpl extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this + attach(addressOrName: string): this + deployed(): Promise + + interface: DNSSECImplInterface + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise> + + listeners( + eventFilter?: TypedEventFilter, + ): Array> + listeners(eventName?: string): Array + removeAllListeners( + eventFilter: TypedEventFilter, + ): this + removeAllListeners(eventName?: string): this + off: OnEvent + on: OnEvent + once: OnEvent + removeListener: OnEvent + + functions: { + algorithms( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string]> + + anchors(overrides?: CallOverrides): Promise<[string]> + + deleteRRSet( + deleteType: PromiseOrValue, + deleteName: PromiseOrValue, + nsec: DNSSEC.RRSetWithSignatureStruct, + proof: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + deleteRRSetNSEC3( + deleteType: PromiseOrValue, + deleteName: PromiseOrValue, + closestEncloser: DNSSEC.RRSetWithSignatureStruct, + nextClosest: DNSSEC.RRSetWithSignatureStruct, + dnskey: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + digests( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string]> + + nsec3Digests( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string]> + + owner(overrides?: CallOverrides): Promise<[string]> + + /** + * Returns data about the RRs (if any) known to this oracle with the provided type and name. + * @param dnstype The DNS record type to query. + * @param name The name to query, in DNS label-sequence format. + */ + rrdata( + dnstype: PromiseOrValue, + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[number, number, string]> + + /** + * Sets the contract address for a signature verification algorithm. Callable only by the owner. + * @param algo The address of the algorithm contract. + * @param id The algorithm ID + */ + setAlgorithm( + id: PromiseOrValue, + algo: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + /** + * Sets the contract address for a digest verification algorithm. Callable only by the owner. + * @param digest The address of the digest contract. + * @param id The digest ID + */ + setDigest( + id: PromiseOrValue, + digest: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + /** + * Sets the contract address for an NSEC3 digest algorithm. Callable only by the owner. + * @param digest The address of the digest contract. + * @param id The digest ID + */ + setNSEC3Digest( + id: PromiseOrValue, + digest: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setOwner( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + submitRRSet( + input: DNSSEC.RRSetWithSignatureStruct, + proof: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + submitRRSets( + input: DNSSEC.RRSetWithSignatureStruct[], + _proof: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + } + + algorithms( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + anchors(overrides?: CallOverrides): Promise + + deleteRRSet( + deleteType: PromiseOrValue, + deleteName: PromiseOrValue, + nsec: DNSSEC.RRSetWithSignatureStruct, + proof: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + deleteRRSetNSEC3( + deleteType: PromiseOrValue, + deleteName: PromiseOrValue, + closestEncloser: DNSSEC.RRSetWithSignatureStruct, + nextClosest: DNSSEC.RRSetWithSignatureStruct, + dnskey: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + digests( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + nsec3Digests( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + owner(overrides?: CallOverrides): Promise + + /** + * Returns data about the RRs (if any) known to this oracle with the provided type and name. + * @param dnstype The DNS record type to query. + * @param name The name to query, in DNS label-sequence format. + */ + rrdata( + dnstype: PromiseOrValue, + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[number, number, string]> + + /** + * Sets the contract address for a signature verification algorithm. Callable only by the owner. + * @param algo The address of the algorithm contract. + * @param id The algorithm ID + */ + setAlgorithm( + id: PromiseOrValue, + algo: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + /** + * Sets the contract address for a digest verification algorithm. Callable only by the owner. + * @param digest The address of the digest contract. + * @param id The digest ID + */ + setDigest( + id: PromiseOrValue, + digest: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + /** + * Sets the contract address for an NSEC3 digest algorithm. Callable only by the owner. + * @param digest The address of the digest contract. + * @param id The digest ID + */ + setNSEC3Digest( + id: PromiseOrValue, + digest: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setOwner( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + submitRRSet( + input: DNSSEC.RRSetWithSignatureStruct, + proof: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + submitRRSets( + input: DNSSEC.RRSetWithSignatureStruct[], + _proof: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + callStatic: { + algorithms( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + anchors(overrides?: CallOverrides): Promise + + deleteRRSet( + deleteType: PromiseOrValue, + deleteName: PromiseOrValue, + nsec: DNSSEC.RRSetWithSignatureStruct, + proof: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + deleteRRSetNSEC3( + deleteType: PromiseOrValue, + deleteName: PromiseOrValue, + closestEncloser: DNSSEC.RRSetWithSignatureStruct, + nextClosest: DNSSEC.RRSetWithSignatureStruct, + dnskey: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + digests( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + nsec3Digests( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + owner(overrides?: CallOverrides): Promise + + /** + * Returns data about the RRs (if any) known to this oracle with the provided type and name. + * @param dnstype The DNS record type to query. + * @param name The name to query, in DNS label-sequence format. + */ + rrdata( + dnstype: PromiseOrValue, + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[number, number, string]> + + /** + * Sets the contract address for a signature verification algorithm. Callable only by the owner. + * @param algo The address of the algorithm contract. + * @param id The algorithm ID + */ + setAlgorithm( + id: PromiseOrValue, + algo: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + /** + * Sets the contract address for a digest verification algorithm. Callable only by the owner. + * @param digest The address of the digest contract. + * @param id The digest ID + */ + setDigest( + id: PromiseOrValue, + digest: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + /** + * Sets the contract address for an NSEC3 digest algorithm. Callable only by the owner. + * @param digest The address of the digest contract. + * @param id The digest ID + */ + setNSEC3Digest( + id: PromiseOrValue, + digest: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setOwner( + newOwner: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + submitRRSet( + input: DNSSEC.RRSetWithSignatureStruct, + proof: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + submitRRSets( + input: DNSSEC.RRSetWithSignatureStruct[], + _proof: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + filters: { + 'AlgorithmUpdated(uint8,address)'( + id?: null, + addr?: null, + ): AlgorithmUpdatedEventFilter + AlgorithmUpdated(id?: null, addr?: null): AlgorithmUpdatedEventFilter + + 'DigestUpdated(uint8,address)'( + id?: null, + addr?: null, + ): DigestUpdatedEventFilter + DigestUpdated(id?: null, addr?: null): DigestUpdatedEventFilter + + 'Marker()'(): MarkerEventFilter + Marker(): MarkerEventFilter + + 'NSEC3DigestUpdated(uint8,address)'( + id?: null, + addr?: null, + ): NSEC3DigestUpdatedEventFilter + NSEC3DigestUpdated(id?: null, addr?: null): NSEC3DigestUpdatedEventFilter + + 'RRSetUpdated(bytes,bytes)'( + name?: null, + rrset?: null, + ): RRSetUpdatedEventFilter + RRSetUpdated(name?: null, rrset?: null): RRSetUpdatedEventFilter + + 'Test(uint256)'(t?: null): TestEventFilter + Test(t?: null): TestEventFilter + } + + estimateGas: { + algorithms( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + anchors(overrides?: CallOverrides): Promise + + deleteRRSet( + deleteType: PromiseOrValue, + deleteName: PromiseOrValue, + nsec: DNSSEC.RRSetWithSignatureStruct, + proof: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + deleteRRSetNSEC3( + deleteType: PromiseOrValue, + deleteName: PromiseOrValue, + closestEncloser: DNSSEC.RRSetWithSignatureStruct, + nextClosest: DNSSEC.RRSetWithSignatureStruct, + dnskey: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + digests( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + nsec3Digests( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + owner(overrides?: CallOverrides): Promise + + /** + * Returns data about the RRs (if any) known to this oracle with the provided type and name. + * @param dnstype The DNS record type to query. + * @param name The name to query, in DNS label-sequence format. + */ + rrdata( + dnstype: PromiseOrValue, + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + /** + * Sets the contract address for a signature verification algorithm. Callable only by the owner. + * @param algo The address of the algorithm contract. + * @param id The algorithm ID + */ + setAlgorithm( + id: PromiseOrValue, + algo: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + /** + * Sets the contract address for a digest verification algorithm. Callable only by the owner. + * @param digest The address of the digest contract. + * @param id The digest ID + */ + setDigest( + id: PromiseOrValue, + digest: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + /** + * Sets the contract address for an NSEC3 digest algorithm. Callable only by the owner. + * @param digest The address of the digest contract. + * @param id The digest ID + */ + setNSEC3Digest( + id: PromiseOrValue, + digest: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setOwner( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + submitRRSet( + input: DNSSEC.RRSetWithSignatureStruct, + proof: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + submitRRSets( + input: DNSSEC.RRSetWithSignatureStruct[], + _proof: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + } + + populateTransaction: { + algorithms( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + anchors(overrides?: CallOverrides): Promise + + deleteRRSet( + deleteType: PromiseOrValue, + deleteName: PromiseOrValue, + nsec: DNSSEC.RRSetWithSignatureStruct, + proof: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + deleteRRSetNSEC3( + deleteType: PromiseOrValue, + deleteName: PromiseOrValue, + closestEncloser: DNSSEC.RRSetWithSignatureStruct, + nextClosest: DNSSEC.RRSetWithSignatureStruct, + dnskey: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + digests( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + nsec3Digests( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + owner(overrides?: CallOverrides): Promise + + /** + * Returns data about the RRs (if any) known to this oracle with the provided type and name. + * @param dnstype The DNS record type to query. + * @param name The name to query, in DNS label-sequence format. + */ + rrdata( + dnstype: PromiseOrValue, + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + /** + * Sets the contract address for a signature verification algorithm. Callable only by the owner. + * @param algo The address of the algorithm contract. + * @param id The algorithm ID + */ + setAlgorithm( + id: PromiseOrValue, + algo: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + /** + * Sets the contract address for a digest verification algorithm. Callable only by the owner. + * @param digest The address of the digest contract. + * @param id The digest ID + */ + setDigest( + id: PromiseOrValue, + digest: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + /** + * Sets the contract address for an NSEC3 digest algorithm. Callable only by the owner. + * @param digest The address of the digest contract. + * @param id The digest ID + */ + setNSEC3Digest( + id: PromiseOrValue, + digest: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setOwner( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + submitRRSet( + input: DNSSEC.RRSetWithSignatureStruct, + proof: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + submitRRSets( + input: DNSSEC.RRSetWithSignatureStruct[], + _proof: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/DefaultReverseResolver.ts b/.yalc/@ensdomains/ensjs/src/generated/DefaultReverseResolver.ts new file mode 100644 index 000000000..30e639ab7 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/DefaultReverseResolver.ts @@ -0,0 +1,153 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { FunctionFragment, Result } from '@ethersproject/abi' +import { Interface } from '@ethersproject/abi' +import type { Listener, Provider } from '@ethersproject/abstract-provider' +import type { Signer } from '@ethersproject/abstract-signer' +import type { BigNumber } from '@ethersproject/bignumber' +import type { BytesLike } from '@ethersproject/bytes' +import type { + BaseContract, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, +} from '@ethersproject/contracts' +import type { + OnEvent, + PromiseOrValue, + TypedEvent, + TypedEventFilter, + TypedListener, +} from './common' + +export interface DefaultReverseResolverInterface extends Interface { + functions: { + 'ens()': FunctionFragment + 'name(bytes32)': FunctionFragment + 'setName(bytes32,string)': FunctionFragment + } + + getFunction( + nameOrSignatureOrTopic: 'ens' | 'name' | 'setName', + ): FunctionFragment + + encodeFunctionData(functionFragment: 'ens', values?: undefined): string + encodeFunctionData( + functionFragment: 'name', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setName', + values: [PromiseOrValue, PromiseOrValue], + ): string + + decodeFunctionResult(functionFragment: 'ens', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'setName', data: BytesLike): Result + + events: {} +} + +export interface DefaultReverseResolver extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this + attach(addressOrName: string): this + deployed(): Promise + + interface: DefaultReverseResolverInterface + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise> + + listeners( + eventFilter?: TypedEventFilter, + ): Array> + listeners(eventName?: string): Array + removeAllListeners( + eventFilter: TypedEventFilter, + ): this + removeAllListeners(eventName?: string): this + off: OnEvent + on: OnEvent + once: OnEvent + removeListener: OnEvent + + functions: { + ens(overrides?: CallOverrides): Promise<[string]> + + name( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string]> + + setName( + node: PromiseOrValue, + _name: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + } + + ens(overrides?: CallOverrides): Promise + + name( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setName( + node: PromiseOrValue, + _name: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + callStatic: { + ens(overrides?: CallOverrides): Promise + + name( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setName( + node: PromiseOrValue, + _name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + filters: {} + + estimateGas: { + ens(overrides?: CallOverrides): Promise + + name( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setName( + node: PromiseOrValue, + _name: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + } + + populateTransaction: { + ens(overrides?: CallOverrides): Promise + + name( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setName( + node: PromiseOrValue, + _name: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/ENSRegistry.ts b/.yalc/@ensdomains/ensjs/src/generated/ENSRegistry.ts new file mode 100644 index 000000000..4f59656a3 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/ENSRegistry.ts @@ -0,0 +1,687 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + EventFragment, + FunctionFragment, + Result, +} from '@ethersproject/abi' +import { Interface } from '@ethersproject/abi' +import type { Listener, Provider } from '@ethersproject/abstract-provider' +import type { Signer } from '@ethersproject/abstract-signer' +import type { BigNumber, BigNumberish } from '@ethersproject/bignumber' +import type { BytesLike } from '@ethersproject/bytes' +import type { + BaseContract, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, +} from '@ethersproject/contracts' +import type { + OnEvent, + PromiseOrValue, + TypedEvent, + TypedEventFilter, + TypedListener, +} from './common' + +export interface ENSRegistryInterface extends Interface { + functions: { + 'isApprovedForAll(address,address)': FunctionFragment + 'old()': FunctionFragment + 'owner(bytes32)': FunctionFragment + 'recordExists(bytes32)': FunctionFragment + 'resolver(bytes32)': FunctionFragment + 'setApprovalForAll(address,bool)': FunctionFragment + 'setOwner(bytes32,address)': FunctionFragment + 'setRecord(bytes32,address,address,uint64)': FunctionFragment + 'setResolver(bytes32,address)': FunctionFragment + 'setSubnodeOwner(bytes32,bytes32,address)': FunctionFragment + 'setSubnodeRecord(bytes32,bytes32,address,address,uint64)': FunctionFragment + 'setTTL(bytes32,uint64)': FunctionFragment + 'ttl(bytes32)': FunctionFragment + } + + getFunction( + nameOrSignatureOrTopic: + | 'isApprovedForAll' + | 'old' + | 'owner' + | 'recordExists' + | 'resolver' + | 'setApprovalForAll' + | 'setOwner' + | 'setRecord' + | 'setResolver' + | 'setSubnodeOwner' + | 'setSubnodeRecord' + | 'setTTL' + | 'ttl', + ): FunctionFragment + + encodeFunctionData( + functionFragment: 'isApprovedForAll', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData(functionFragment: 'old', values?: undefined): string + encodeFunctionData( + functionFragment: 'owner', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'recordExists', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'resolver', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setApprovalForAll', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setOwner', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setRecord', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'setResolver', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setSubnodeOwner', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'setSubnodeRecord', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'setTTL', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'ttl', + values: [PromiseOrValue], + ): string + + decodeFunctionResult( + functionFragment: 'isApprovedForAll', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'old', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'recordExists', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'resolver', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'setApprovalForAll', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'setOwner', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'setRecord', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'setResolver', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'setSubnodeOwner', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'setSubnodeRecord', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'setTTL', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'ttl', data: BytesLike): Result + + events: { + 'ApprovalForAll(address,address,bool)': EventFragment + 'NewOwner(bytes32,bytes32,address)': EventFragment + 'NewResolver(bytes32,address)': EventFragment + 'NewTTL(bytes32,uint64)': EventFragment + 'Transfer(bytes32,address)': EventFragment + } + + getEvent(nameOrSignatureOrTopic: 'ApprovalForAll'): EventFragment + getEvent(nameOrSignatureOrTopic: 'NewOwner'): EventFragment + getEvent(nameOrSignatureOrTopic: 'NewResolver'): EventFragment + getEvent(nameOrSignatureOrTopic: 'NewTTL'): EventFragment + getEvent(nameOrSignatureOrTopic: 'Transfer'): EventFragment +} + +export interface ApprovalForAllEventObject { + owner: string + operator: string + approved: boolean +} +export type ApprovalForAllEvent = TypedEvent< + [string, string, boolean], + ApprovalForAllEventObject +> + +export type ApprovalForAllEventFilter = TypedEventFilter + +export interface NewOwnerEventObject { + node: string + label: string + owner: string +} +export type NewOwnerEvent = TypedEvent< + [string, string, string], + NewOwnerEventObject +> + +export type NewOwnerEventFilter = TypedEventFilter + +export interface NewResolverEventObject { + node: string + resolver: string +} +export type NewResolverEvent = TypedEvent< + [string, string], + NewResolverEventObject +> + +export type NewResolverEventFilter = TypedEventFilter + +export interface NewTTLEventObject { + node: string + ttl: BigNumber +} +export type NewTTLEvent = TypedEvent<[string, BigNumber], NewTTLEventObject> + +export type NewTTLEventFilter = TypedEventFilter + +export interface TransferEventObject { + node: string + owner: string +} +export type TransferEvent = TypedEvent<[string, string], TransferEventObject> + +export type TransferEventFilter = TypedEventFilter + +export interface ENSRegistry extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this + attach(addressOrName: string): this + deployed(): Promise + + interface: ENSRegistryInterface + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise> + + listeners( + eventFilter?: TypedEventFilter, + ): Array> + listeners(eventName?: string): Array + removeAllListeners( + eventFilter: TypedEventFilter, + ): this + removeAllListeners(eventName?: string): this + off: OnEvent + on: OnEvent + once: OnEvent + removeListener: OnEvent + + functions: { + isApprovedForAll( + owner: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + old(overrides?: CallOverrides): Promise<[string]> + + owner( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string]> + + recordExists( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + resolver( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string]> + + setApprovalForAll( + operator: PromiseOrValue, + approved: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setOwner( + node: PromiseOrValue, + owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setRecord( + node: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setResolver( + node: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setSubnodeOwner( + node: PromiseOrValue, + label: PromiseOrValue, + owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setSubnodeRecord( + node: PromiseOrValue, + label: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setTTL( + node: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + ttl( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[BigNumber]> + } + + isApprovedForAll( + owner: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + old(overrides?: CallOverrides): Promise + + owner( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + recordExists( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + resolver( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setApprovalForAll( + operator: PromiseOrValue, + approved: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setOwner( + node: PromiseOrValue, + owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setRecord( + node: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setResolver( + node: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setSubnodeOwner( + node: PromiseOrValue, + label: PromiseOrValue, + owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setSubnodeRecord( + node: PromiseOrValue, + label: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setTTL( + node: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + ttl( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + callStatic: { + isApprovedForAll( + owner: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + old(overrides?: CallOverrides): Promise + + owner( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + recordExists( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + resolver( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setApprovalForAll( + operator: PromiseOrValue, + approved: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setOwner( + node: PromiseOrValue, + owner: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setRecord( + node: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setResolver( + node: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setSubnodeOwner( + node: PromiseOrValue, + label: PromiseOrValue, + owner: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setSubnodeRecord( + node: PromiseOrValue, + label: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setTTL( + node: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + ttl( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + filters: { + 'ApprovalForAll(address,address,bool)'( + owner?: PromiseOrValue | null, + operator?: PromiseOrValue | null, + approved?: null, + ): ApprovalForAllEventFilter + ApprovalForAll( + owner?: PromiseOrValue | null, + operator?: PromiseOrValue | null, + approved?: null, + ): ApprovalForAllEventFilter + + 'NewOwner(bytes32,bytes32,address)'( + node?: PromiseOrValue | null, + label?: PromiseOrValue | null, + owner?: null, + ): NewOwnerEventFilter + NewOwner( + node?: PromiseOrValue | null, + label?: PromiseOrValue | null, + owner?: null, + ): NewOwnerEventFilter + + 'NewResolver(bytes32,address)'( + node?: PromiseOrValue | null, + resolver?: null, + ): NewResolverEventFilter + NewResolver( + node?: PromiseOrValue | null, + resolver?: null, + ): NewResolverEventFilter + + 'NewTTL(bytes32,uint64)'( + node?: PromiseOrValue | null, + ttl?: null, + ): NewTTLEventFilter + NewTTL( + node?: PromiseOrValue | null, + ttl?: null, + ): NewTTLEventFilter + + 'Transfer(bytes32,address)'( + node?: PromiseOrValue | null, + owner?: null, + ): TransferEventFilter + Transfer( + node?: PromiseOrValue | null, + owner?: null, + ): TransferEventFilter + } + + estimateGas: { + isApprovedForAll( + owner: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + old(overrides?: CallOverrides): Promise + + owner( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + recordExists( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + resolver( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setApprovalForAll( + operator: PromiseOrValue, + approved: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setOwner( + node: PromiseOrValue, + owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setRecord( + node: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setResolver( + node: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setSubnodeOwner( + node: PromiseOrValue, + label: PromiseOrValue, + owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setSubnodeRecord( + node: PromiseOrValue, + label: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setTTL( + node: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + ttl( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + populateTransaction: { + isApprovedForAll( + owner: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + old(overrides?: CallOverrides): Promise + + owner( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + recordExists( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + resolver( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setApprovalForAll( + operator: PromiseOrValue, + approved: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setOwner( + node: PromiseOrValue, + owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setRecord( + node: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setResolver( + node: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setSubnodeOwner( + node: PromiseOrValue, + label: PromiseOrValue, + owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setSubnodeRecord( + node: PromiseOrValue, + label: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setTTL( + node: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + ttl( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/ETHRegistrarController.ts b/.yalc/@ensdomains/ensjs/src/generated/ETHRegistrarController.ts new file mode 100644 index 000000000..deb019c64 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/ETHRegistrarController.ts @@ -0,0 +1,834 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + EventFragment, + FunctionFragment, + Result, +} from '@ethersproject/abi' +import { Interface } from '@ethersproject/abi' +import type { Listener, Provider } from '@ethersproject/abstract-provider' +import type { Signer } from '@ethersproject/abstract-signer' +import type { BigNumber, BigNumberish } from '@ethersproject/bignumber' +import type { BytesLike } from '@ethersproject/bytes' +import type { + BaseContract, + CallOverrides, + ContractTransaction, + Overrides, + PayableOverrides, + PopulatedTransaction, +} from '@ethersproject/contracts' +import type { + OnEvent, + PromiseOrValue, + TypedEvent, + TypedEventFilter, + TypedListener, +} from './common' + +export declare namespace IPriceOracle { + export type PriceStruct = { + base: PromiseOrValue + premium: PromiseOrValue + } + + export type PriceStructOutput = [BigNumber, BigNumber] & { + base: BigNumber + premium: BigNumber + } +} + +export interface ETHRegistrarControllerInterface extends Interface { + functions: { + 'MIN_REGISTRATION_DURATION()': FunctionFragment + 'available(string)': FunctionFragment + 'commit(bytes32)': FunctionFragment + 'commitments(bytes32)': FunctionFragment + 'makeCommitment(string,address,uint256,bytes32,address,bytes[],bool,uint16)': FunctionFragment + 'maxCommitmentAge()': FunctionFragment + 'minCommitmentAge()': FunctionFragment + 'nameWrapper()': FunctionFragment + 'owner()': FunctionFragment + 'prices()': FunctionFragment + 'recoverFunds(address,address,uint256)': FunctionFragment + 'register(string,address,uint256,bytes32,address,bytes[],bool,uint16)': FunctionFragment + 'renew(string,uint256)': FunctionFragment + 'renounceOwnership()': FunctionFragment + 'rentPrice(string,uint256)': FunctionFragment + 'reverseRegistrar()': FunctionFragment + 'supportsInterface(bytes4)': FunctionFragment + 'transferOwnership(address)': FunctionFragment + 'valid(string)': FunctionFragment + 'withdraw()': FunctionFragment + } + + getFunction( + nameOrSignatureOrTopic: + | 'MIN_REGISTRATION_DURATION' + | 'available' + | 'commit' + | 'commitments' + | 'makeCommitment' + | 'maxCommitmentAge' + | 'minCommitmentAge' + | 'nameWrapper' + | 'owner' + | 'prices' + | 'recoverFunds' + | 'register' + | 'renew' + | 'renounceOwnership' + | 'rentPrice' + | 'reverseRegistrar' + | 'supportsInterface' + | 'transferOwnership' + | 'valid' + | 'withdraw', + ): FunctionFragment + + encodeFunctionData( + functionFragment: 'MIN_REGISTRATION_DURATION', + values?: undefined, + ): string + encodeFunctionData( + functionFragment: 'available', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'commit', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'commitments', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'makeCommitment', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue[], + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'maxCommitmentAge', + values?: undefined, + ): string + encodeFunctionData( + functionFragment: 'minCommitmentAge', + values?: undefined, + ): string + encodeFunctionData( + functionFragment: 'nameWrapper', + values?: undefined, + ): string + encodeFunctionData(functionFragment: 'owner', values?: undefined): string + encodeFunctionData(functionFragment: 'prices', values?: undefined): string + encodeFunctionData( + functionFragment: 'recoverFunds', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'register', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue[], + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'renew', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'renounceOwnership', + values?: undefined, + ): string + encodeFunctionData( + functionFragment: 'rentPrice', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'reverseRegistrar', + values?: undefined, + ): string + encodeFunctionData( + functionFragment: 'supportsInterface', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'transferOwnership', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'valid', + values: [PromiseOrValue], + ): string + encodeFunctionData(functionFragment: 'withdraw', values?: undefined): string + + decodeFunctionResult( + functionFragment: 'MIN_REGISTRATION_DURATION', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'available', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'commit', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'commitments', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'makeCommitment', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'maxCommitmentAge', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'minCommitmentAge', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'nameWrapper', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'prices', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'recoverFunds', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'register', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'renew', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'renounceOwnership', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'rentPrice', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'reverseRegistrar', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'supportsInterface', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'transferOwnership', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'valid', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'withdraw', data: BytesLike): Result + + events: { + 'NameRegistered(string,bytes32,address,uint256,uint256,uint256)': EventFragment + 'NameRenewed(string,bytes32,uint256,uint256)': EventFragment + 'OwnershipTransferred(address,address)': EventFragment + } + + getEvent(nameOrSignatureOrTopic: 'NameRegistered'): EventFragment + getEvent(nameOrSignatureOrTopic: 'NameRenewed'): EventFragment + getEvent(nameOrSignatureOrTopic: 'OwnershipTransferred'): EventFragment +} + +export interface NameRegisteredEventObject { + name: string + label: string + owner: string + baseCost: BigNumber + premium: BigNumber + expires: BigNumber +} +export type NameRegisteredEvent = TypedEvent< + [string, string, string, BigNumber, BigNumber, BigNumber], + NameRegisteredEventObject +> + +export type NameRegisteredEventFilter = TypedEventFilter + +export interface NameRenewedEventObject { + name: string + label: string + cost: BigNumber + expires: BigNumber +} +export type NameRenewedEvent = TypedEvent< + [string, string, BigNumber, BigNumber], + NameRenewedEventObject +> + +export type NameRenewedEventFilter = TypedEventFilter + +export interface OwnershipTransferredEventObject { + previousOwner: string + newOwner: string +} +export type OwnershipTransferredEvent = TypedEvent< + [string, string], + OwnershipTransferredEventObject +> + +export type OwnershipTransferredEventFilter = + TypedEventFilter + +export interface ETHRegistrarController extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this + attach(addressOrName: string): this + deployed(): Promise + + interface: ETHRegistrarControllerInterface + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise> + + listeners( + eventFilter?: TypedEventFilter, + ): Array> + listeners(eventName?: string): Array + removeAllListeners( + eventFilter: TypedEventFilter, + ): this + removeAllListeners(eventName?: string): this + off: OnEvent + on: OnEvent + once: OnEvent + removeListener: OnEvent + + functions: { + MIN_REGISTRATION_DURATION(overrides?: CallOverrides): Promise<[BigNumber]> + + available( + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + commit( + commitment: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + commitments( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[BigNumber]> + + makeCommitment( + name: PromiseOrValue, + owner: PromiseOrValue, + duration: PromiseOrValue, + secret: PromiseOrValue, + resolver: PromiseOrValue, + data: PromiseOrValue[], + reverseRecord: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string]> + + maxCommitmentAge(overrides?: CallOverrides): Promise<[BigNumber]> + + minCommitmentAge(overrides?: CallOverrides): Promise<[BigNumber]> + + nameWrapper(overrides?: CallOverrides): Promise<[string]> + + owner(overrides?: CallOverrides): Promise<[string]> + + prices(overrides?: CallOverrides): Promise<[string]> + + recoverFunds( + _token: PromiseOrValue, + _to: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + register( + name: PromiseOrValue, + owner: PromiseOrValue, + duration: PromiseOrValue, + secret: PromiseOrValue, + resolver: PromiseOrValue, + data: PromiseOrValue[], + reverseRecord: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + renew( + name: PromiseOrValue, + duration: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + renounceOwnership( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + rentPrice( + name: PromiseOrValue, + duration: PromiseOrValue, + overrides?: CallOverrides, + ): Promise< + [IPriceOracle.PriceStructOutput] & { + price: IPriceOracle.PriceStructOutput + } + > + + reverseRegistrar(overrides?: CallOverrides): Promise<[string]> + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + valid( + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + withdraw( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + } + + MIN_REGISTRATION_DURATION(overrides?: CallOverrides): Promise + + available( + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + commit( + commitment: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + commitments( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + makeCommitment( + name: PromiseOrValue, + owner: PromiseOrValue, + duration: PromiseOrValue, + secret: PromiseOrValue, + resolver: PromiseOrValue, + data: PromiseOrValue[], + reverseRecord: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + maxCommitmentAge(overrides?: CallOverrides): Promise + + minCommitmentAge(overrides?: CallOverrides): Promise + + nameWrapper(overrides?: CallOverrides): Promise + + owner(overrides?: CallOverrides): Promise + + prices(overrides?: CallOverrides): Promise + + recoverFunds( + _token: PromiseOrValue, + _to: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + register( + name: PromiseOrValue, + owner: PromiseOrValue, + duration: PromiseOrValue, + secret: PromiseOrValue, + resolver: PromiseOrValue, + data: PromiseOrValue[], + reverseRecord: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + renew( + name: PromiseOrValue, + duration: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + renounceOwnership( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + rentPrice( + name: PromiseOrValue, + duration: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + reverseRegistrar(overrides?: CallOverrides): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + valid( + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + withdraw( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + callStatic: { + MIN_REGISTRATION_DURATION(overrides?: CallOverrides): Promise + + available( + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + commit( + commitment: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + commitments( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + makeCommitment( + name: PromiseOrValue, + owner: PromiseOrValue, + duration: PromiseOrValue, + secret: PromiseOrValue, + resolver: PromiseOrValue, + data: PromiseOrValue[], + reverseRecord: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + maxCommitmentAge(overrides?: CallOverrides): Promise + + minCommitmentAge(overrides?: CallOverrides): Promise + + nameWrapper(overrides?: CallOverrides): Promise + + owner(overrides?: CallOverrides): Promise + + prices(overrides?: CallOverrides): Promise + + recoverFunds( + _token: PromiseOrValue, + _to: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + register( + name: PromiseOrValue, + owner: PromiseOrValue, + duration: PromiseOrValue, + secret: PromiseOrValue, + resolver: PromiseOrValue, + data: PromiseOrValue[], + reverseRecord: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + renew( + name: PromiseOrValue, + duration: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + renounceOwnership(overrides?: CallOverrides): Promise + + rentPrice( + name: PromiseOrValue, + duration: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + reverseRegistrar(overrides?: CallOverrides): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + valid( + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + withdraw(overrides?: CallOverrides): Promise + } + + filters: { + 'NameRegistered(string,bytes32,address,uint256,uint256,uint256)'( + name?: null, + label?: PromiseOrValue | null, + owner?: PromiseOrValue | null, + baseCost?: null, + premium?: null, + expires?: null, + ): NameRegisteredEventFilter + NameRegistered( + name?: null, + label?: PromiseOrValue | null, + owner?: PromiseOrValue | null, + baseCost?: null, + premium?: null, + expires?: null, + ): NameRegisteredEventFilter + + 'NameRenewed(string,bytes32,uint256,uint256)'( + name?: null, + label?: PromiseOrValue | null, + cost?: null, + expires?: null, + ): NameRenewedEventFilter + NameRenewed( + name?: null, + label?: PromiseOrValue | null, + cost?: null, + expires?: null, + ): NameRenewedEventFilter + + 'OwnershipTransferred(address,address)'( + previousOwner?: PromiseOrValue | null, + newOwner?: PromiseOrValue | null, + ): OwnershipTransferredEventFilter + OwnershipTransferred( + previousOwner?: PromiseOrValue | null, + newOwner?: PromiseOrValue | null, + ): OwnershipTransferredEventFilter + } + + estimateGas: { + MIN_REGISTRATION_DURATION(overrides?: CallOverrides): Promise + + available( + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + commit( + commitment: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + commitments( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + makeCommitment( + name: PromiseOrValue, + owner: PromiseOrValue, + duration: PromiseOrValue, + secret: PromiseOrValue, + resolver: PromiseOrValue, + data: PromiseOrValue[], + reverseRecord: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + maxCommitmentAge(overrides?: CallOverrides): Promise + + minCommitmentAge(overrides?: CallOverrides): Promise + + nameWrapper(overrides?: CallOverrides): Promise + + owner(overrides?: CallOverrides): Promise + + prices(overrides?: CallOverrides): Promise + + recoverFunds( + _token: PromiseOrValue, + _to: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + register( + name: PromiseOrValue, + owner: PromiseOrValue, + duration: PromiseOrValue, + secret: PromiseOrValue, + resolver: PromiseOrValue, + data: PromiseOrValue[], + reverseRecord: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + renew( + name: PromiseOrValue, + duration: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + renounceOwnership( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + rentPrice( + name: PromiseOrValue, + duration: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + reverseRegistrar(overrides?: CallOverrides): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + valid( + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + withdraw( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + } + + populateTransaction: { + MIN_REGISTRATION_DURATION( + overrides?: CallOverrides, + ): Promise + + available( + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + commit( + commitment: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + commitments( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + makeCommitment( + name: PromiseOrValue, + owner: PromiseOrValue, + duration: PromiseOrValue, + secret: PromiseOrValue, + resolver: PromiseOrValue, + data: PromiseOrValue[], + reverseRecord: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + maxCommitmentAge(overrides?: CallOverrides): Promise + + minCommitmentAge(overrides?: CallOverrides): Promise + + nameWrapper(overrides?: CallOverrides): Promise + + owner(overrides?: CallOverrides): Promise + + prices(overrides?: CallOverrides): Promise + + recoverFunds( + _token: PromiseOrValue, + _to: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + register( + name: PromiseOrValue, + owner: PromiseOrValue, + duration: PromiseOrValue, + secret: PromiseOrValue, + resolver: PromiseOrValue, + data: PromiseOrValue[], + reverseRecord: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + renew( + name: PromiseOrValue, + duration: PromiseOrValue, + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + renounceOwnership( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + rentPrice( + name: PromiseOrValue, + duration: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + reverseRegistrar(overrides?: CallOverrides): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + valid( + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + withdraw( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/Multicall.ts b/.yalc/@ensdomains/ensjs/src/generated/Multicall.ts new file mode 100644 index 000000000..7ba5feee3 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/Multicall.ts @@ -0,0 +1,591 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { FunctionFragment, Result } from '@ethersproject/abi' +import { Interface } from '@ethersproject/abi' +import type { Listener, Provider } from '@ethersproject/abstract-provider' +import type { Signer } from '@ethersproject/abstract-signer' +import type { BigNumber, BigNumberish } from '@ethersproject/bignumber' +import type { BytesLike } from '@ethersproject/bytes' +import type { + BaseContract, + CallOverrides, + ContractTransaction, + PayableOverrides, + PopulatedTransaction, +} from '@ethersproject/contracts' +import type { + OnEvent, + PromiseOrValue, + TypedEvent, + TypedEventFilter, + TypedListener, +} from './common' + +export declare namespace Multicall3 { + export type CallStruct = { + target: PromiseOrValue + callData: PromiseOrValue + } + + export type CallStructOutput = [string, string] & { + target: string + callData: string + } + + export type Call3Struct = { + target: PromiseOrValue + allowFailure: PromiseOrValue + callData: PromiseOrValue + } + + export type Call3StructOutput = [string, boolean, string] & { + target: string + allowFailure: boolean + callData: string + } + + export type ResultStruct = { + success: PromiseOrValue + returnData: PromiseOrValue + } + + export type ResultStructOutput = [boolean, string] & { + success: boolean + returnData: string + } + + export type Call3ValueStruct = { + target: PromiseOrValue + allowFailure: PromiseOrValue + value: PromiseOrValue + callData: PromiseOrValue + } + + export type Call3ValueStructOutput = [string, boolean, BigNumber, string] & { + target: string + allowFailure: boolean + value: BigNumber + callData: string + } +} + +export interface MulticallInterface extends Interface { + functions: { + 'aggregate((address,bytes)[])': FunctionFragment + 'aggregate3((address,bool,bytes)[])': FunctionFragment + 'aggregate3Value((address,bool,uint256,bytes)[])': FunctionFragment + 'blockAndAggregate((address,bytes)[])': FunctionFragment + 'getBasefee()': FunctionFragment + 'getBlockHash(uint256)': FunctionFragment + 'getBlockNumber()': FunctionFragment + 'getChainId()': FunctionFragment + 'getCurrentBlockCoinbase()': FunctionFragment + 'getCurrentBlockDifficulty()': FunctionFragment + 'getCurrentBlockGasLimit()': FunctionFragment + 'getCurrentBlockTimestamp()': FunctionFragment + 'getEthBalance(address)': FunctionFragment + 'getLastBlockHash()': FunctionFragment + 'tryAggregate(bool,(address,bytes)[])': FunctionFragment + 'tryBlockAndAggregate(bool,(address,bytes)[])': FunctionFragment + } + + getFunction( + nameOrSignatureOrTopic: + | 'aggregate' + | 'aggregate3' + | 'aggregate3Value' + | 'blockAndAggregate' + | 'getBasefee' + | 'getBlockHash' + | 'getBlockNumber' + | 'getChainId' + | 'getCurrentBlockCoinbase' + | 'getCurrentBlockDifficulty' + | 'getCurrentBlockGasLimit' + | 'getCurrentBlockTimestamp' + | 'getEthBalance' + | 'getLastBlockHash' + | 'tryAggregate' + | 'tryBlockAndAggregate', + ): FunctionFragment + + encodeFunctionData( + functionFragment: 'aggregate', + values: [Multicall3.CallStruct[]], + ): string + encodeFunctionData( + functionFragment: 'aggregate3', + values: [Multicall3.Call3Struct[]], + ): string + encodeFunctionData( + functionFragment: 'aggregate3Value', + values: [Multicall3.Call3ValueStruct[]], + ): string + encodeFunctionData( + functionFragment: 'blockAndAggregate', + values: [Multicall3.CallStruct[]], + ): string + encodeFunctionData(functionFragment: 'getBasefee', values?: undefined): string + encodeFunctionData( + functionFragment: 'getBlockHash', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'getBlockNumber', + values?: undefined, + ): string + encodeFunctionData(functionFragment: 'getChainId', values?: undefined): string + encodeFunctionData( + functionFragment: 'getCurrentBlockCoinbase', + values?: undefined, + ): string + encodeFunctionData( + functionFragment: 'getCurrentBlockDifficulty', + values?: undefined, + ): string + encodeFunctionData( + functionFragment: 'getCurrentBlockGasLimit', + values?: undefined, + ): string + encodeFunctionData( + functionFragment: 'getCurrentBlockTimestamp', + values?: undefined, + ): string + encodeFunctionData( + functionFragment: 'getEthBalance', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'getLastBlockHash', + values?: undefined, + ): string + encodeFunctionData( + functionFragment: 'tryAggregate', + values: [PromiseOrValue, Multicall3.CallStruct[]], + ): string + encodeFunctionData( + functionFragment: 'tryBlockAndAggregate', + values: [PromiseOrValue, Multicall3.CallStruct[]], + ): string + + decodeFunctionResult(functionFragment: 'aggregate', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'aggregate3', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'aggregate3Value', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'blockAndAggregate', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'getBasefee', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'getBlockHash', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'getBlockNumber', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'getChainId', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'getCurrentBlockCoinbase', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'getCurrentBlockDifficulty', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'getCurrentBlockGasLimit', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'getCurrentBlockTimestamp', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'getEthBalance', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'getLastBlockHash', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'tryAggregate', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'tryBlockAndAggregate', + data: BytesLike, + ): Result + + events: {} +} + +export interface Multicall extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this + attach(addressOrName: string): this + deployed(): Promise + + interface: MulticallInterface + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise> + + listeners( + eventFilter?: TypedEventFilter, + ): Array> + listeners(eventName?: string): Array + removeAllListeners( + eventFilter: TypedEventFilter, + ): this + removeAllListeners(eventName?: string): this + off: OnEvent + on: OnEvent + once: OnEvent + removeListener: OnEvent + + functions: { + aggregate( + calls: Multicall3.CallStruct[], + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + aggregate3( + calls: Multicall3.Call3Struct[], + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + aggregate3Value( + calls: Multicall3.Call3ValueStruct[], + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + blockAndAggregate( + calls: Multicall3.CallStruct[], + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + getBasefee( + overrides?: CallOverrides, + ): Promise<[BigNumber] & { basefee: BigNumber }> + + getBlockHash( + blockNumber: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string] & { blockHash: string }> + + getBlockNumber( + overrides?: CallOverrides, + ): Promise<[BigNumber] & { blockNumber: BigNumber }> + + getChainId( + overrides?: CallOverrides, + ): Promise<[BigNumber] & { chainid: BigNumber }> + + getCurrentBlockCoinbase( + overrides?: CallOverrides, + ): Promise<[string] & { coinbase: string }> + + getCurrentBlockDifficulty( + overrides?: CallOverrides, + ): Promise<[BigNumber] & { difficulty: BigNumber }> + + getCurrentBlockGasLimit( + overrides?: CallOverrides, + ): Promise<[BigNumber] & { gaslimit: BigNumber }> + + getCurrentBlockTimestamp( + overrides?: CallOverrides, + ): Promise<[BigNumber] & { timestamp: BigNumber }> + + getEthBalance( + addr: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[BigNumber] & { balance: BigNumber }> + + getLastBlockHash( + overrides?: CallOverrides, + ): Promise<[string] & { blockHash: string }> + + tryAggregate( + requireSuccess: PromiseOrValue, + calls: Multicall3.CallStruct[], + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + tryBlockAndAggregate( + requireSuccess: PromiseOrValue, + calls: Multicall3.CallStruct[], + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + } + + aggregate( + calls: Multicall3.CallStruct[], + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + aggregate3( + calls: Multicall3.Call3Struct[], + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + aggregate3Value( + calls: Multicall3.Call3ValueStruct[], + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + blockAndAggregate( + calls: Multicall3.CallStruct[], + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + getBasefee(overrides?: CallOverrides): Promise + + getBlockHash( + blockNumber: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + getBlockNumber(overrides?: CallOverrides): Promise + + getChainId(overrides?: CallOverrides): Promise + + getCurrentBlockCoinbase(overrides?: CallOverrides): Promise + + getCurrentBlockDifficulty(overrides?: CallOverrides): Promise + + getCurrentBlockGasLimit(overrides?: CallOverrides): Promise + + getCurrentBlockTimestamp(overrides?: CallOverrides): Promise + + getEthBalance( + addr: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + getLastBlockHash(overrides?: CallOverrides): Promise + + tryAggregate( + requireSuccess: PromiseOrValue, + calls: Multicall3.CallStruct[], + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + tryBlockAndAggregate( + requireSuccess: PromiseOrValue, + calls: Multicall3.CallStruct[], + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + callStatic: { + aggregate( + calls: Multicall3.CallStruct[], + overrides?: CallOverrides, + ): Promise< + [BigNumber, string[]] & { blockNumber: BigNumber; returnData: string[] } + > + + aggregate3( + calls: Multicall3.Call3Struct[], + overrides?: CallOverrides, + ): Promise + + aggregate3Value( + calls: Multicall3.Call3ValueStruct[], + overrides?: CallOverrides, + ): Promise + + blockAndAggregate( + calls: Multicall3.CallStruct[], + overrides?: CallOverrides, + ): Promise< + [BigNumber, string, Multicall3.ResultStructOutput[]] & { + blockNumber: BigNumber + blockHash: string + returnData: Multicall3.ResultStructOutput[] + } + > + + getBasefee(overrides?: CallOverrides): Promise + + getBlockHash( + blockNumber: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + getBlockNumber(overrides?: CallOverrides): Promise + + getChainId(overrides?: CallOverrides): Promise + + getCurrentBlockCoinbase(overrides?: CallOverrides): Promise + + getCurrentBlockDifficulty(overrides?: CallOverrides): Promise + + getCurrentBlockGasLimit(overrides?: CallOverrides): Promise + + getCurrentBlockTimestamp(overrides?: CallOverrides): Promise + + getEthBalance( + addr: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + getLastBlockHash(overrides?: CallOverrides): Promise + + tryAggregate( + requireSuccess: PromiseOrValue, + calls: Multicall3.CallStruct[], + overrides?: CallOverrides, + ): Promise + + tryBlockAndAggregate( + requireSuccess: PromiseOrValue, + calls: Multicall3.CallStruct[], + overrides?: CallOverrides, + ): Promise< + [BigNumber, string, Multicall3.ResultStructOutput[]] & { + blockNumber: BigNumber + blockHash: string + returnData: Multicall3.ResultStructOutput[] + } + > + } + + filters: {} + + estimateGas: { + aggregate( + calls: Multicall3.CallStruct[], + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + aggregate3( + calls: Multicall3.Call3Struct[], + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + aggregate3Value( + calls: Multicall3.Call3ValueStruct[], + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + blockAndAggregate( + calls: Multicall3.CallStruct[], + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + getBasefee(overrides?: CallOverrides): Promise + + getBlockHash( + blockNumber: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + getBlockNumber(overrides?: CallOverrides): Promise + + getChainId(overrides?: CallOverrides): Promise + + getCurrentBlockCoinbase(overrides?: CallOverrides): Promise + + getCurrentBlockDifficulty(overrides?: CallOverrides): Promise + + getCurrentBlockGasLimit(overrides?: CallOverrides): Promise + + getCurrentBlockTimestamp(overrides?: CallOverrides): Promise + + getEthBalance( + addr: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + getLastBlockHash(overrides?: CallOverrides): Promise + + tryAggregate( + requireSuccess: PromiseOrValue, + calls: Multicall3.CallStruct[], + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + tryBlockAndAggregate( + requireSuccess: PromiseOrValue, + calls: Multicall3.CallStruct[], + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + } + + populateTransaction: { + aggregate( + calls: Multicall3.CallStruct[], + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + aggregate3( + calls: Multicall3.Call3Struct[], + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + aggregate3Value( + calls: Multicall3.Call3ValueStruct[], + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + blockAndAggregate( + calls: Multicall3.CallStruct[], + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + getBasefee(overrides?: CallOverrides): Promise + + getBlockHash( + blockNumber: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + getBlockNumber(overrides?: CallOverrides): Promise + + getChainId(overrides?: CallOverrides): Promise + + getCurrentBlockCoinbase( + overrides?: CallOverrides, + ): Promise + + getCurrentBlockDifficulty( + overrides?: CallOverrides, + ): Promise + + getCurrentBlockGasLimit( + overrides?: CallOverrides, + ): Promise + + getCurrentBlockTimestamp( + overrides?: CallOverrides, + ): Promise + + getEthBalance( + addr: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + getLastBlockHash(overrides?: CallOverrides): Promise + + tryAggregate( + requireSuccess: PromiseOrValue, + calls: Multicall3.CallStruct[], + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + + tryBlockAndAggregate( + requireSuccess: PromiseOrValue, + calls: Multicall3.CallStruct[], + overrides?: PayableOverrides & { from?: PromiseOrValue }, + ): Promise + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/NameWrapper.ts b/.yalc/@ensdomains/ensjs/src/generated/NameWrapper.ts new file mode 100644 index 000000000..e156380d9 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/NameWrapper.ts @@ -0,0 +1,2124 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + EventFragment, + FunctionFragment, + Result, +} from '@ethersproject/abi' +import { Interface } from '@ethersproject/abi' +import type { Listener, Provider } from '@ethersproject/abstract-provider' +import type { Signer } from '@ethersproject/abstract-signer' +import type { BigNumber, BigNumberish } from '@ethersproject/bignumber' +import type { BytesLike } from '@ethersproject/bytes' +import type { + BaseContract, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, +} from '@ethersproject/contracts' +import type { + OnEvent, + PromiseOrValue, + TypedEvent, + TypedEventFilter, + TypedListener, +} from './common' + +export interface NameWrapperInterface extends Interface { + functions: { + '_tokens(uint256)': FunctionFragment + 'allFusesBurned(bytes32,uint32)': FunctionFragment + 'balanceOf(address,uint256)': FunctionFragment + 'balanceOfBatch(address[],uint256[])': FunctionFragment + 'canModifyName(bytes32,address)': FunctionFragment + 'controllers(address)': FunctionFragment + 'ens()': FunctionFragment + 'extendExpiry(bytes32,bytes32,uint64)': FunctionFragment + 'getData(uint256)': FunctionFragment + 'isApprovedForAll(address,address)': FunctionFragment + 'isWrapped(bytes32)': FunctionFragment + 'metadataService()': FunctionFragment + 'name()': FunctionFragment + 'names(bytes32)': FunctionFragment + 'onERC721Received(address,address,uint256,bytes)': FunctionFragment + 'owner()': FunctionFragment + 'ownerOf(uint256)': FunctionFragment + 'recoverFunds(address,address,uint256)': FunctionFragment + 'registerAndWrapETH2LD(string,address,uint256,address,uint16)': FunctionFragment + 'registrar()': FunctionFragment + 'renew(uint256,uint256)': FunctionFragment + 'renounceOwnership()': FunctionFragment + 'safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)': FunctionFragment + 'safeTransferFrom(address,address,uint256,uint256,bytes)': FunctionFragment + 'setApprovalForAll(address,bool)': FunctionFragment + 'setChildFuses(bytes32,bytes32,uint32,uint64)': FunctionFragment + 'setController(address,bool)': FunctionFragment + 'setFuses(bytes32,uint16)': FunctionFragment + 'setMetadataService(address)': FunctionFragment + 'setRecord(bytes32,address,address,uint64)': FunctionFragment + 'setResolver(bytes32,address)': FunctionFragment + 'setSubnodeOwner(bytes32,string,address,uint32,uint64)': FunctionFragment + 'setSubnodeRecord(bytes32,string,address,address,uint64,uint32,uint64)': FunctionFragment + 'setTTL(bytes32,uint64)': FunctionFragment + 'setUpgradeContract(address)': FunctionFragment + 'supportsInterface(bytes4)': FunctionFragment + 'transferOwnership(address)': FunctionFragment + 'unwrap(bytes32,bytes32,address)': FunctionFragment + 'unwrapETH2LD(bytes32,address,address)': FunctionFragment + 'upgrade(bytes32,string,address,address)': FunctionFragment + 'upgradeContract()': FunctionFragment + 'upgradeETH2LD(string,address,address)': FunctionFragment + 'uri(uint256)': FunctionFragment + 'wrap(bytes,address,address)': FunctionFragment + 'wrapETH2LD(string,address,uint16,address)': FunctionFragment + } + + getFunction( + nameOrSignatureOrTopic: + | '_tokens' + | 'allFusesBurned' + | 'balanceOf' + | 'balanceOfBatch' + | 'canModifyName' + | 'controllers' + | 'ens' + | 'extendExpiry' + | 'getData' + | 'isApprovedForAll' + | 'isWrapped' + | 'metadataService' + | 'name' + | 'names' + | 'onERC721Received' + | 'owner' + | 'ownerOf' + | 'recoverFunds' + | 'registerAndWrapETH2LD' + | 'registrar' + | 'renew' + | 'renounceOwnership' + | 'safeBatchTransferFrom' + | 'safeTransferFrom' + | 'setApprovalForAll' + | 'setChildFuses' + | 'setController' + | 'setFuses' + | 'setMetadataService' + | 'setRecord' + | 'setResolver' + | 'setSubnodeOwner' + | 'setSubnodeRecord' + | 'setTTL' + | 'setUpgradeContract' + | 'supportsInterface' + | 'transferOwnership' + | 'unwrap' + | 'unwrapETH2LD' + | 'upgrade' + | 'upgradeContract' + | 'upgradeETH2LD' + | 'uri' + | 'wrap' + | 'wrapETH2LD', + ): FunctionFragment + + encodeFunctionData( + functionFragment: '_tokens', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'allFusesBurned', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'balanceOf', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'balanceOfBatch', + values: [PromiseOrValue[], PromiseOrValue[]], + ): string + encodeFunctionData( + functionFragment: 'canModifyName', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'controllers', + values: [PromiseOrValue], + ): string + encodeFunctionData(functionFragment: 'ens', values?: undefined): string + encodeFunctionData( + functionFragment: 'extendExpiry', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'getData', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'isApprovedForAll', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'isWrapped', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'metadataService', + values?: undefined, + ): string + encodeFunctionData(functionFragment: 'name', values?: undefined): string + encodeFunctionData( + functionFragment: 'names', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'onERC721Received', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData(functionFragment: 'owner', values?: undefined): string + encodeFunctionData( + functionFragment: 'ownerOf', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'recoverFunds', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'registerAndWrapETH2LD', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData(functionFragment: 'registrar', values?: undefined): string + encodeFunctionData( + functionFragment: 'renew', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'renounceOwnership', + values?: undefined, + ): string + encodeFunctionData( + functionFragment: 'safeBatchTransferFrom', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue[], + PromiseOrValue[], + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'safeTransferFrom', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'setApprovalForAll', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setChildFuses', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'setController', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setFuses', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setMetadataService', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setRecord', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'setResolver', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setSubnodeOwner', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'setSubnodeRecord', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'setTTL', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setUpgradeContract', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'supportsInterface', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'transferOwnership', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'unwrap', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'unwrapETH2LD', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'upgrade', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'upgradeContract', + values?: undefined, + ): string + encodeFunctionData( + functionFragment: 'upgradeETH2LD', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'uri', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'wrap', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'wrapETH2LD', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + + decodeFunctionResult(functionFragment: '_tokens', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'allFusesBurned', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'balanceOf', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'balanceOfBatch', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'canModifyName', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'controllers', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'ens', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'extendExpiry', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'getData', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'isApprovedForAll', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'isWrapped', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'metadataService', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'names', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'onERC721Received', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'ownerOf', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'recoverFunds', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'registerAndWrapETH2LD', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'registrar', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'renew', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'renounceOwnership', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'safeBatchTransferFrom', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'safeTransferFrom', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'setApprovalForAll', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'setChildFuses', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'setController', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'setFuses', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'setMetadataService', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'setRecord', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'setResolver', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'setSubnodeOwner', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'setSubnodeRecord', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'setTTL', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'setUpgradeContract', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'supportsInterface', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'transferOwnership', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'unwrap', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'unwrapETH2LD', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'upgrade', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'upgradeContract', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'upgradeETH2LD', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'uri', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'wrap', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'wrapETH2LD', data: BytesLike): Result + + events: { + 'ApprovalForAll(address,address,bool)': EventFragment + 'ControllerChanged(address,bool)': EventFragment + 'ExpiryExtended(bytes32,uint64)': EventFragment + 'FusesSet(bytes32,uint32)': EventFragment + 'NameUnwrapped(bytes32,address)': EventFragment + 'NameWrapped(bytes32,bytes,address,uint32,uint64)': EventFragment + 'OwnershipTransferred(address,address)': EventFragment + 'TransferBatch(address,address,address,uint256[],uint256[])': EventFragment + 'TransferSingle(address,address,address,uint256,uint256)': EventFragment + 'URI(string,uint256)': EventFragment + } + + getEvent(nameOrSignatureOrTopic: 'ApprovalForAll'): EventFragment + getEvent(nameOrSignatureOrTopic: 'ControllerChanged'): EventFragment + getEvent(nameOrSignatureOrTopic: 'ExpiryExtended'): EventFragment + getEvent(nameOrSignatureOrTopic: 'FusesSet'): EventFragment + getEvent(nameOrSignatureOrTopic: 'NameUnwrapped'): EventFragment + getEvent(nameOrSignatureOrTopic: 'NameWrapped'): EventFragment + getEvent(nameOrSignatureOrTopic: 'OwnershipTransferred'): EventFragment + getEvent(nameOrSignatureOrTopic: 'TransferBatch'): EventFragment + getEvent(nameOrSignatureOrTopic: 'TransferSingle'): EventFragment + getEvent(nameOrSignatureOrTopic: 'URI'): EventFragment +} + +export interface ApprovalForAllEventObject { + account: string + operator: string + approved: boolean +} +export type ApprovalForAllEvent = TypedEvent< + [string, string, boolean], + ApprovalForAllEventObject +> + +export type ApprovalForAllEventFilter = TypedEventFilter + +export interface ControllerChangedEventObject { + controller: string + active: boolean +} +export type ControllerChangedEvent = TypedEvent< + [string, boolean], + ControllerChangedEventObject +> + +export type ControllerChangedEventFilter = + TypedEventFilter + +export interface ExpiryExtendedEventObject { + node: string + expiry: BigNumber +} +export type ExpiryExtendedEvent = TypedEvent< + [string, BigNumber], + ExpiryExtendedEventObject +> + +export type ExpiryExtendedEventFilter = TypedEventFilter + +export interface FusesSetEventObject { + node: string + fuses: number +} +export type FusesSetEvent = TypedEvent<[string, number], FusesSetEventObject> + +export type FusesSetEventFilter = TypedEventFilter + +export interface NameUnwrappedEventObject { + node: string + owner: string +} +export type NameUnwrappedEvent = TypedEvent< + [string, string], + NameUnwrappedEventObject +> + +export type NameUnwrappedEventFilter = TypedEventFilter + +export interface NameWrappedEventObject { + node: string + name: string + owner: string + fuses: number + expiry: BigNumber +} +export type NameWrappedEvent = TypedEvent< + [string, string, string, number, BigNumber], + NameWrappedEventObject +> + +export type NameWrappedEventFilter = TypedEventFilter + +export interface OwnershipTransferredEventObject { + previousOwner: string + newOwner: string +} +export type OwnershipTransferredEvent = TypedEvent< + [string, string], + OwnershipTransferredEventObject +> + +export type OwnershipTransferredEventFilter = + TypedEventFilter + +export interface TransferBatchEventObject { + operator: string + from: string + to: string + ids: BigNumber[] + values: BigNumber[] +} +export type TransferBatchEvent = TypedEvent< + [string, string, string, BigNumber[], BigNumber[]], + TransferBatchEventObject +> + +export type TransferBatchEventFilter = TypedEventFilter + +export interface TransferSingleEventObject { + operator: string + from: string + to: string + id: BigNumber + value: BigNumber +} +export type TransferSingleEvent = TypedEvent< + [string, string, string, BigNumber, BigNumber], + TransferSingleEventObject +> + +export type TransferSingleEventFilter = TypedEventFilter + +export interface URIEventObject { + value: string + id: BigNumber +} +export type URIEvent = TypedEvent<[string, BigNumber], URIEventObject> + +export type URIEventFilter = TypedEventFilter + +export interface NameWrapper extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this + attach(addressOrName: string): this + deployed(): Promise + + interface: NameWrapperInterface + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise> + + listeners( + eventFilter?: TypedEventFilter, + ): Array> + listeners(eventName?: string): Array + removeAllListeners( + eventFilter: TypedEventFilter, + ): this + removeAllListeners(eventName?: string): this + off: OnEvent + on: OnEvent + once: OnEvent + removeListener: OnEvent + + functions: { + _tokens( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[BigNumber]> + + allFusesBurned( + node: PromiseOrValue, + fuseMask: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + balanceOf( + account: PromiseOrValue, + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[BigNumber]> + + balanceOfBatch( + accounts: PromiseOrValue[], + ids: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise<[BigNumber[]]> + + canModifyName( + node: PromiseOrValue, + addr: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + controllers( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + ens(overrides?: CallOverrides): Promise<[string]> + + extendExpiry( + parentNode: PromiseOrValue, + labelhash: PromiseOrValue, + expiry: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + getData( + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise< + [string, number, BigNumber] & { + owner: string + fuses: number + expiry: BigNumber + } + > + + isApprovedForAll( + account: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + isWrapped( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + metadataService(overrides?: CallOverrides): Promise<[string]> + + name(overrides?: CallOverrides): Promise<[string]> + + names( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string]> + + onERC721Received( + to: PromiseOrValue, + arg1: PromiseOrValue, + tokenId: PromiseOrValue, + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + owner(overrides?: CallOverrides): Promise<[string]> + + ownerOf( + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string] & { owner: string }> + + recoverFunds( + _token: PromiseOrValue, + _to: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + registerAndWrapETH2LD( + label: PromiseOrValue, + wrappedOwner: PromiseOrValue, + duration: PromiseOrValue, + resolver: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + registrar(overrides?: CallOverrides): Promise<[string]> + + renew( + tokenId: PromiseOrValue, + duration: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + renounceOwnership( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + safeBatchTransferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + ids: PromiseOrValue[], + amounts: PromiseOrValue[], + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + safeTransferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + id: PromiseOrValue, + amount: PromiseOrValue, + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setApprovalForAll( + operator: PromiseOrValue, + approved: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setChildFuses( + parentNode: PromiseOrValue, + labelhash: PromiseOrValue, + fuses: PromiseOrValue, + expiry: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setController( + controller: PromiseOrValue, + active: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setFuses( + node: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setMetadataService( + _metadataService: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setRecord( + node: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setResolver( + node: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setSubnodeOwner( + parentNode: PromiseOrValue, + label: PromiseOrValue, + owner: PromiseOrValue, + fuses: PromiseOrValue, + expiry: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setSubnodeRecord( + parentNode: PromiseOrValue, + label: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + ttl: PromiseOrValue, + fuses: PromiseOrValue, + expiry: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setTTL( + node: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setUpgradeContract( + _upgradeAddress: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + supportsInterface( + interfaceId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + unwrap( + parentNode: PromiseOrValue, + labelhash: PromiseOrValue, + controller: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + unwrapETH2LD( + labelhash: PromiseOrValue, + registrant: PromiseOrValue, + controller: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + upgrade( + parentNode: PromiseOrValue, + label: PromiseOrValue, + wrappedOwner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + upgradeContract(overrides?: CallOverrides): Promise<[string]> + + upgradeETH2LD( + label: PromiseOrValue, + wrappedOwner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + uri( + tokenId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string]> + + wrap( + name: PromiseOrValue, + wrappedOwner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + wrapETH2LD( + label: PromiseOrValue, + wrappedOwner: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + } + + _tokens( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + allFusesBurned( + node: PromiseOrValue, + fuseMask: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + balanceOf( + account: PromiseOrValue, + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + balanceOfBatch( + accounts: PromiseOrValue[], + ids: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise + + canModifyName( + node: PromiseOrValue, + addr: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + controllers( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + ens(overrides?: CallOverrides): Promise + + extendExpiry( + parentNode: PromiseOrValue, + labelhash: PromiseOrValue, + expiry: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + getData( + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise< + [string, number, BigNumber] & { + owner: string + fuses: number + expiry: BigNumber + } + > + + isApprovedForAll( + account: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + isWrapped( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + metadataService(overrides?: CallOverrides): Promise + + name(overrides?: CallOverrides): Promise + + names( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + onERC721Received( + to: PromiseOrValue, + arg1: PromiseOrValue, + tokenId: PromiseOrValue, + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + owner(overrides?: CallOverrides): Promise + + ownerOf( + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + recoverFunds( + _token: PromiseOrValue, + _to: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + registerAndWrapETH2LD( + label: PromiseOrValue, + wrappedOwner: PromiseOrValue, + duration: PromiseOrValue, + resolver: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + registrar(overrides?: CallOverrides): Promise + + renew( + tokenId: PromiseOrValue, + duration: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + renounceOwnership( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + safeBatchTransferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + ids: PromiseOrValue[], + amounts: PromiseOrValue[], + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + safeTransferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + id: PromiseOrValue, + amount: PromiseOrValue, + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setApprovalForAll( + operator: PromiseOrValue, + approved: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setChildFuses( + parentNode: PromiseOrValue, + labelhash: PromiseOrValue, + fuses: PromiseOrValue, + expiry: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setController( + controller: PromiseOrValue, + active: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setFuses( + node: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setMetadataService( + _metadataService: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setRecord( + node: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setResolver( + node: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setSubnodeOwner( + parentNode: PromiseOrValue, + label: PromiseOrValue, + owner: PromiseOrValue, + fuses: PromiseOrValue, + expiry: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setSubnodeRecord( + parentNode: PromiseOrValue, + label: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + ttl: PromiseOrValue, + fuses: PromiseOrValue, + expiry: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setTTL( + node: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setUpgradeContract( + _upgradeAddress: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + supportsInterface( + interfaceId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + unwrap( + parentNode: PromiseOrValue, + labelhash: PromiseOrValue, + controller: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + unwrapETH2LD( + labelhash: PromiseOrValue, + registrant: PromiseOrValue, + controller: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + upgrade( + parentNode: PromiseOrValue, + label: PromiseOrValue, + wrappedOwner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + upgradeContract(overrides?: CallOverrides): Promise + + upgradeETH2LD( + label: PromiseOrValue, + wrappedOwner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + uri( + tokenId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + wrap( + name: PromiseOrValue, + wrappedOwner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + wrapETH2LD( + label: PromiseOrValue, + wrappedOwner: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + callStatic: { + _tokens( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + allFusesBurned( + node: PromiseOrValue, + fuseMask: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + balanceOf( + account: PromiseOrValue, + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + balanceOfBatch( + accounts: PromiseOrValue[], + ids: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise + + canModifyName( + node: PromiseOrValue, + addr: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + controllers( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + ens(overrides?: CallOverrides): Promise + + extendExpiry( + parentNode: PromiseOrValue, + labelhash: PromiseOrValue, + expiry: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + getData( + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise< + [string, number, BigNumber] & { + owner: string + fuses: number + expiry: BigNumber + } + > + + isApprovedForAll( + account: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + isWrapped( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + metadataService(overrides?: CallOverrides): Promise + + name(overrides?: CallOverrides): Promise + + names( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + onERC721Received( + to: PromiseOrValue, + arg1: PromiseOrValue, + tokenId: PromiseOrValue, + data: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + owner(overrides?: CallOverrides): Promise + + ownerOf( + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + recoverFunds( + _token: PromiseOrValue, + _to: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + registerAndWrapETH2LD( + label: PromiseOrValue, + wrappedOwner: PromiseOrValue, + duration: PromiseOrValue, + resolver: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + registrar(overrides?: CallOverrides): Promise + + renew( + tokenId: PromiseOrValue, + duration: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + renounceOwnership(overrides?: CallOverrides): Promise + + safeBatchTransferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + ids: PromiseOrValue[], + amounts: PromiseOrValue[], + data: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + safeTransferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + id: PromiseOrValue, + amount: PromiseOrValue, + data: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setApprovalForAll( + operator: PromiseOrValue, + approved: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setChildFuses( + parentNode: PromiseOrValue, + labelhash: PromiseOrValue, + fuses: PromiseOrValue, + expiry: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setController( + controller: PromiseOrValue, + active: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setFuses( + node: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setMetadataService( + _metadataService: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setRecord( + node: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setResolver( + node: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setSubnodeOwner( + parentNode: PromiseOrValue, + label: PromiseOrValue, + owner: PromiseOrValue, + fuses: PromiseOrValue, + expiry: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setSubnodeRecord( + parentNode: PromiseOrValue, + label: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + ttl: PromiseOrValue, + fuses: PromiseOrValue, + expiry: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setTTL( + node: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setUpgradeContract( + _upgradeAddress: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + supportsInterface( + interfaceId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + unwrap( + parentNode: PromiseOrValue, + labelhash: PromiseOrValue, + controller: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + unwrapETH2LD( + labelhash: PromiseOrValue, + registrant: PromiseOrValue, + controller: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + upgrade( + parentNode: PromiseOrValue, + label: PromiseOrValue, + wrappedOwner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + upgradeContract(overrides?: CallOverrides): Promise + + upgradeETH2LD( + label: PromiseOrValue, + wrappedOwner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + uri( + tokenId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + wrap( + name: PromiseOrValue, + wrappedOwner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + wrapETH2LD( + label: PromiseOrValue, + wrappedOwner: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + filters: { + 'ApprovalForAll(address,address,bool)'( + account?: PromiseOrValue | null, + operator?: PromiseOrValue | null, + approved?: null, + ): ApprovalForAllEventFilter + ApprovalForAll( + account?: PromiseOrValue | null, + operator?: PromiseOrValue | null, + approved?: null, + ): ApprovalForAllEventFilter + + 'ControllerChanged(address,bool)'( + controller?: PromiseOrValue | null, + active?: null, + ): ControllerChangedEventFilter + ControllerChanged( + controller?: PromiseOrValue | null, + active?: null, + ): ControllerChangedEventFilter + + 'ExpiryExtended(bytes32,uint64)'( + node?: PromiseOrValue | null, + expiry?: null, + ): ExpiryExtendedEventFilter + ExpiryExtended( + node?: PromiseOrValue | null, + expiry?: null, + ): ExpiryExtendedEventFilter + + 'FusesSet(bytes32,uint32)'( + node?: PromiseOrValue | null, + fuses?: null, + ): FusesSetEventFilter + FusesSet( + node?: PromiseOrValue | null, + fuses?: null, + ): FusesSetEventFilter + + 'NameUnwrapped(bytes32,address)'( + node?: PromiseOrValue | null, + owner?: null, + ): NameUnwrappedEventFilter + NameUnwrapped( + node?: PromiseOrValue | null, + owner?: null, + ): NameUnwrappedEventFilter + + 'NameWrapped(bytes32,bytes,address,uint32,uint64)'( + node?: PromiseOrValue | null, + name?: null, + owner?: null, + fuses?: null, + expiry?: null, + ): NameWrappedEventFilter + NameWrapped( + node?: PromiseOrValue | null, + name?: null, + owner?: null, + fuses?: null, + expiry?: null, + ): NameWrappedEventFilter + + 'OwnershipTransferred(address,address)'( + previousOwner?: PromiseOrValue | null, + newOwner?: PromiseOrValue | null, + ): OwnershipTransferredEventFilter + OwnershipTransferred( + previousOwner?: PromiseOrValue | null, + newOwner?: PromiseOrValue | null, + ): OwnershipTransferredEventFilter + + 'TransferBatch(address,address,address,uint256[],uint256[])'( + operator?: PromiseOrValue | null, + from?: PromiseOrValue | null, + to?: PromiseOrValue | null, + ids?: null, + values?: null, + ): TransferBatchEventFilter + TransferBatch( + operator?: PromiseOrValue | null, + from?: PromiseOrValue | null, + to?: PromiseOrValue | null, + ids?: null, + values?: null, + ): TransferBatchEventFilter + + 'TransferSingle(address,address,address,uint256,uint256)'( + operator?: PromiseOrValue | null, + from?: PromiseOrValue | null, + to?: PromiseOrValue | null, + id?: null, + value?: null, + ): TransferSingleEventFilter + TransferSingle( + operator?: PromiseOrValue | null, + from?: PromiseOrValue | null, + to?: PromiseOrValue | null, + id?: null, + value?: null, + ): TransferSingleEventFilter + + 'URI(string,uint256)'( + value?: null, + id?: PromiseOrValue | null, + ): URIEventFilter + URI(value?: null, id?: PromiseOrValue | null): URIEventFilter + } + + estimateGas: { + _tokens( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + allFusesBurned( + node: PromiseOrValue, + fuseMask: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + balanceOf( + account: PromiseOrValue, + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + balanceOfBatch( + accounts: PromiseOrValue[], + ids: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise + + canModifyName( + node: PromiseOrValue, + addr: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + controllers( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + ens(overrides?: CallOverrides): Promise + + extendExpiry( + parentNode: PromiseOrValue, + labelhash: PromiseOrValue, + expiry: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + getData( + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + isApprovedForAll( + account: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + isWrapped( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + metadataService(overrides?: CallOverrides): Promise + + name(overrides?: CallOverrides): Promise + + names( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + onERC721Received( + to: PromiseOrValue, + arg1: PromiseOrValue, + tokenId: PromiseOrValue, + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + owner(overrides?: CallOverrides): Promise + + ownerOf( + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + recoverFunds( + _token: PromiseOrValue, + _to: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + registerAndWrapETH2LD( + label: PromiseOrValue, + wrappedOwner: PromiseOrValue, + duration: PromiseOrValue, + resolver: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + registrar(overrides?: CallOverrides): Promise + + renew( + tokenId: PromiseOrValue, + duration: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + renounceOwnership( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + safeBatchTransferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + ids: PromiseOrValue[], + amounts: PromiseOrValue[], + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + safeTransferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + id: PromiseOrValue, + amount: PromiseOrValue, + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setApprovalForAll( + operator: PromiseOrValue, + approved: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setChildFuses( + parentNode: PromiseOrValue, + labelhash: PromiseOrValue, + fuses: PromiseOrValue, + expiry: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setController( + controller: PromiseOrValue, + active: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setFuses( + node: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setMetadataService( + _metadataService: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setRecord( + node: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setResolver( + node: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setSubnodeOwner( + parentNode: PromiseOrValue, + label: PromiseOrValue, + owner: PromiseOrValue, + fuses: PromiseOrValue, + expiry: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setSubnodeRecord( + parentNode: PromiseOrValue, + label: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + ttl: PromiseOrValue, + fuses: PromiseOrValue, + expiry: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setTTL( + node: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setUpgradeContract( + _upgradeAddress: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + supportsInterface( + interfaceId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + unwrap( + parentNode: PromiseOrValue, + labelhash: PromiseOrValue, + controller: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + unwrapETH2LD( + labelhash: PromiseOrValue, + registrant: PromiseOrValue, + controller: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + upgrade( + parentNode: PromiseOrValue, + label: PromiseOrValue, + wrappedOwner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + upgradeContract(overrides?: CallOverrides): Promise + + upgradeETH2LD( + label: PromiseOrValue, + wrappedOwner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + uri( + tokenId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + wrap( + name: PromiseOrValue, + wrappedOwner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + wrapETH2LD( + label: PromiseOrValue, + wrappedOwner: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + } + + populateTransaction: { + _tokens( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + allFusesBurned( + node: PromiseOrValue, + fuseMask: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + balanceOf( + account: PromiseOrValue, + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + balanceOfBatch( + accounts: PromiseOrValue[], + ids: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise + + canModifyName( + node: PromiseOrValue, + addr: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + controllers( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + ens(overrides?: CallOverrides): Promise + + extendExpiry( + parentNode: PromiseOrValue, + labelhash: PromiseOrValue, + expiry: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + getData( + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + isApprovedForAll( + account: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + isWrapped( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + metadataService(overrides?: CallOverrides): Promise + + name(overrides?: CallOverrides): Promise + + names( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + onERC721Received( + to: PromiseOrValue, + arg1: PromiseOrValue, + tokenId: PromiseOrValue, + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + owner(overrides?: CallOverrides): Promise + + ownerOf( + id: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + recoverFunds( + _token: PromiseOrValue, + _to: PromiseOrValue, + _amount: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + registerAndWrapETH2LD( + label: PromiseOrValue, + wrappedOwner: PromiseOrValue, + duration: PromiseOrValue, + resolver: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + registrar(overrides?: CallOverrides): Promise + + renew( + tokenId: PromiseOrValue, + duration: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + renounceOwnership( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + safeBatchTransferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + ids: PromiseOrValue[], + amounts: PromiseOrValue[], + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + safeTransferFrom( + from: PromiseOrValue, + to: PromiseOrValue, + id: PromiseOrValue, + amount: PromiseOrValue, + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setApprovalForAll( + operator: PromiseOrValue, + approved: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setChildFuses( + parentNode: PromiseOrValue, + labelhash: PromiseOrValue, + fuses: PromiseOrValue, + expiry: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setController( + controller: PromiseOrValue, + active: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setFuses( + node: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setMetadataService( + _metadataService: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setRecord( + node: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setResolver( + node: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setSubnodeOwner( + parentNode: PromiseOrValue, + label: PromiseOrValue, + owner: PromiseOrValue, + fuses: PromiseOrValue, + expiry: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setSubnodeRecord( + parentNode: PromiseOrValue, + label: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + ttl: PromiseOrValue, + fuses: PromiseOrValue, + expiry: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setTTL( + node: PromiseOrValue, + ttl: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setUpgradeContract( + _upgradeAddress: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + supportsInterface( + interfaceId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + unwrap( + parentNode: PromiseOrValue, + labelhash: PromiseOrValue, + controller: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + unwrapETH2LD( + labelhash: PromiseOrValue, + registrant: PromiseOrValue, + controller: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + upgrade( + parentNode: PromiseOrValue, + label: PromiseOrValue, + wrappedOwner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + upgradeContract(overrides?: CallOverrides): Promise + + upgradeETH2LD( + label: PromiseOrValue, + wrappedOwner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + uri( + tokenId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + wrap( + name: PromiseOrValue, + wrappedOwner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + wrapETH2LD( + label: PromiseOrValue, + wrappedOwner: PromiseOrValue, + ownerControlledFuses: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/P256SHA256Algorithm.ts b/.yalc/@ensdomains/ensjs/src/generated/P256SHA256Algorithm.ts new file mode 100644 index 000000000..289eb63d0 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/P256SHA256Algorithm.ts @@ -0,0 +1,144 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { FunctionFragment, Result } from '@ethersproject/abi' +import { Interface } from '@ethersproject/abi' +import type { Listener, Provider } from '@ethersproject/abstract-provider' +import type { Signer } from '@ethersproject/abstract-signer' +import type { BigNumber } from '@ethersproject/bignumber' +import type { BytesLike } from '@ethersproject/bytes' +import type { + BaseContract, + CallOverrides, + PopulatedTransaction, +} from '@ethersproject/contracts' +import type { + OnEvent, + PromiseOrValue, + TypedEvent, + TypedEventFilter, + TypedListener, +} from './common' + +export interface P256SHA256AlgorithmInterface extends Interface { + functions: { + 'verify(bytes,bytes,bytes)': FunctionFragment + } + + getFunction(nameOrSignatureOrTopic: 'verify'): FunctionFragment + + encodeFunctionData( + functionFragment: 'verify', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + + decodeFunctionResult(functionFragment: 'verify', data: BytesLike): Result + + events: {} +} + +export interface P256SHA256Algorithm extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this + attach(addressOrName: string): this + deployed(): Promise + + interface: P256SHA256AlgorithmInterface + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise> + + listeners( + eventFilter?: TypedEventFilter, + ): Array> + listeners(eventName?: string): Array + removeAllListeners( + eventFilter: TypedEventFilter, + ): this + removeAllListeners(eventName?: string): this + off: OnEvent + on: OnEvent + once: OnEvent + removeListener: OnEvent + + functions: { + /** + * Verifies a signature. + * @param data The signed data to verify. + * @param key The public key to verify with. + * @param signature The signature to verify. + */ + verify( + key: PromiseOrValue, + data: PromiseOrValue, + signature: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + } + + /** + * Verifies a signature. + * @param data The signed data to verify. + * @param key The public key to verify with. + * @param signature The signature to verify. + */ + verify( + key: PromiseOrValue, + data: PromiseOrValue, + signature: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + callStatic: { + /** + * Verifies a signature. + * @param data The signed data to verify. + * @param key The public key to verify with. + * @param signature The signature to verify. + */ + verify( + key: PromiseOrValue, + data: PromiseOrValue, + signature: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + filters: {} + + estimateGas: { + /** + * Verifies a signature. + * @param data The signed data to verify. + * @param key The public key to verify with. + * @param signature The signature to verify. + */ + verify( + key: PromiseOrValue, + data: PromiseOrValue, + signature: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + populateTransaction: { + /** + * Verifies a signature. + * @param data The signed data to verify. + * @param key The public key to verify with. + * @param signature The signature to verify. + */ + verify( + key: PromiseOrValue, + data: PromiseOrValue, + signature: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/PublicResolver.ts b/.yalc/@ensdomains/ensjs/src/generated/PublicResolver.ts new file mode 100644 index 000000000..f7664623a --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/PublicResolver.ts @@ -0,0 +1,1613 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + EventFragment, + FunctionFragment, + Result, +} from '@ethersproject/abi' +import { Interface } from '@ethersproject/abi' +import type { Listener, Provider } from '@ethersproject/abstract-provider' +import type { Signer } from '@ethersproject/abstract-signer' +import type { BigNumber, BigNumberish } from '@ethersproject/bignumber' +import type { BytesLike } from '@ethersproject/bytes' +import type { + BaseContract, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, +} from '@ethersproject/contracts' +import type { + OnEvent, + PromiseOrValue, + TypedEvent, + TypedEventFilter, + TypedListener, +} from './common' + +export interface PublicResolverInterface extends Interface { + functions: { + 'ABI(bytes32,uint256)': FunctionFragment + 'addr(bytes32)': FunctionFragment + 'addr(bytes32,uint256)': FunctionFragment + 'approve(bytes32,address,bool)': FunctionFragment + 'clearRecords(bytes32)': FunctionFragment + 'contenthash(bytes32)': FunctionFragment + 'dnsRecord(bytes32,bytes32,uint16)': FunctionFragment + 'hasDNSRecords(bytes32,bytes32)': FunctionFragment + 'interfaceImplementer(bytes32,bytes4)': FunctionFragment + 'isApprovedFor(address,bytes32,address)': FunctionFragment + 'isApprovedForAll(address,address)': FunctionFragment + 'multicall(bytes[])': FunctionFragment + 'multicallWithNodeCheck(bytes32,bytes[])': FunctionFragment + 'name(bytes32)': FunctionFragment + 'pubkey(bytes32)': FunctionFragment + 'recordVersions(bytes32)': FunctionFragment + 'setABI(bytes32,uint256,bytes)': FunctionFragment + 'setAddr(bytes32,uint256,bytes)': FunctionFragment + 'setAddr(bytes32,address)': FunctionFragment + 'setApprovalForAll(address,bool)': FunctionFragment + 'setContenthash(bytes32,bytes)': FunctionFragment + 'setDNSRecords(bytes32,bytes)': FunctionFragment + 'setInterface(bytes32,bytes4,address)': FunctionFragment + 'setName(bytes32,string)': FunctionFragment + 'setPubkey(bytes32,bytes32,bytes32)': FunctionFragment + 'setText(bytes32,string,string)': FunctionFragment + 'setZonehash(bytes32,bytes)': FunctionFragment + 'supportsInterface(bytes4)': FunctionFragment + 'text(bytes32,string)': FunctionFragment + 'zonehash(bytes32)': FunctionFragment + } + + getFunction( + nameOrSignatureOrTopic: + | 'ABI' + | 'addr(bytes32)' + | 'addr(bytes32,uint256)' + | 'approve' + | 'clearRecords' + | 'contenthash' + | 'dnsRecord' + | 'hasDNSRecords' + | 'interfaceImplementer' + | 'isApprovedFor' + | 'isApprovedForAll' + | 'multicall' + | 'multicallWithNodeCheck' + | 'name' + | 'pubkey' + | 'recordVersions' + | 'setABI' + | 'setAddr(bytes32,uint256,bytes)' + | 'setAddr(bytes32,address)' + | 'setApprovalForAll' + | 'setContenthash' + | 'setDNSRecords' + | 'setInterface' + | 'setName' + | 'setPubkey' + | 'setText' + | 'setZonehash' + | 'supportsInterface' + | 'text' + | 'zonehash', + ): FunctionFragment + + encodeFunctionData( + functionFragment: 'ABI', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'addr(bytes32)', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'addr(bytes32,uint256)', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'approve', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'clearRecords', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'contenthash', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'dnsRecord', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'hasDNSRecords', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'interfaceImplementer', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'isApprovedFor', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'isApprovedForAll', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'multicall', + values: [PromiseOrValue[]], + ): string + encodeFunctionData( + functionFragment: 'multicallWithNodeCheck', + values: [PromiseOrValue, PromiseOrValue[]], + ): string + encodeFunctionData( + functionFragment: 'name', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'pubkey', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'recordVersions', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setABI', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'setAddr(bytes32,uint256,bytes)', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'setAddr(bytes32,address)', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setApprovalForAll', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setContenthash', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setDNSRecords', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setInterface', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'setName', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setPubkey', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'setText', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'setZonehash', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'supportsInterface', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'text', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'zonehash', + values: [PromiseOrValue], + ): string + + decodeFunctionResult(functionFragment: 'ABI', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'addr(bytes32)', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'addr(bytes32,uint256)', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'approve', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'clearRecords', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'contenthash', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'dnsRecord', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'hasDNSRecords', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'interfaceImplementer', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'isApprovedFor', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'isApprovedForAll', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'multicall', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'multicallWithNodeCheck', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'name', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'pubkey', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'recordVersions', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'setABI', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'setAddr(bytes32,uint256,bytes)', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'setAddr(bytes32,address)', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'setApprovalForAll', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'setContenthash', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'setDNSRecords', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'setInterface', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'setName', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'setPubkey', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'setText', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'setZonehash', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'supportsInterface', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'text', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'zonehash', data: BytesLike): Result + + events: { + 'ABIChanged(bytes32,uint256)': EventFragment + 'AddrChanged(bytes32,address)': EventFragment + 'AddressChanged(bytes32,uint256,bytes)': EventFragment + 'ApprovalForAll(address,address,bool)': EventFragment + 'Approved(address,bytes32,address,bool)': EventFragment + 'ContenthashChanged(bytes32,bytes)': EventFragment + 'DNSRecordChanged(bytes32,bytes,uint16,bytes)': EventFragment + 'DNSRecordDeleted(bytes32,bytes,uint16)': EventFragment + 'DNSZonehashChanged(bytes32,bytes,bytes)': EventFragment + 'InterfaceChanged(bytes32,bytes4,address)': EventFragment + 'NameChanged(bytes32,string)': EventFragment + 'PubkeyChanged(bytes32,bytes32,bytes32)': EventFragment + 'TextChanged(bytes32,string,string,string)': EventFragment + 'VersionChanged(bytes32,uint64)': EventFragment + } + + getEvent(nameOrSignatureOrTopic: 'ABIChanged'): EventFragment + getEvent(nameOrSignatureOrTopic: 'AddrChanged'): EventFragment + getEvent(nameOrSignatureOrTopic: 'AddressChanged'): EventFragment + getEvent(nameOrSignatureOrTopic: 'ApprovalForAll'): EventFragment + getEvent(nameOrSignatureOrTopic: 'Approved'): EventFragment + getEvent(nameOrSignatureOrTopic: 'ContenthashChanged'): EventFragment + getEvent(nameOrSignatureOrTopic: 'DNSRecordChanged'): EventFragment + getEvent(nameOrSignatureOrTopic: 'DNSRecordDeleted'): EventFragment + getEvent(nameOrSignatureOrTopic: 'DNSZonehashChanged'): EventFragment + getEvent(nameOrSignatureOrTopic: 'InterfaceChanged'): EventFragment + getEvent(nameOrSignatureOrTopic: 'NameChanged'): EventFragment + getEvent(nameOrSignatureOrTopic: 'PubkeyChanged'): EventFragment + getEvent(nameOrSignatureOrTopic: 'TextChanged'): EventFragment + getEvent(nameOrSignatureOrTopic: 'VersionChanged'): EventFragment +} + +export interface ABIChangedEventObject { + node: string + contentType: BigNumber +} +export type ABIChangedEvent = TypedEvent< + [string, BigNumber], + ABIChangedEventObject +> + +export type ABIChangedEventFilter = TypedEventFilter + +export interface AddrChangedEventObject { + node: string + a: string +} +export type AddrChangedEvent = TypedEvent< + [string, string], + AddrChangedEventObject +> + +export type AddrChangedEventFilter = TypedEventFilter + +export interface AddressChangedEventObject { + node: string + coinType: BigNumber + newAddress: string +} +export type AddressChangedEvent = TypedEvent< + [string, BigNumber, string], + AddressChangedEventObject +> + +export type AddressChangedEventFilter = TypedEventFilter + +export interface ApprovalForAllEventObject { + owner: string + operator: string + approved: boolean +} +export type ApprovalForAllEvent = TypedEvent< + [string, string, boolean], + ApprovalForAllEventObject +> + +export type ApprovalForAllEventFilter = TypedEventFilter + +export interface ApprovedEventObject { + owner: string + node: string + delegate: string + approved: boolean +} +export type ApprovedEvent = TypedEvent< + [string, string, string, boolean], + ApprovedEventObject +> + +export type ApprovedEventFilter = TypedEventFilter + +export interface ContenthashChangedEventObject { + node: string + hash: string +} +export type ContenthashChangedEvent = TypedEvent< + [string, string], + ContenthashChangedEventObject +> + +export type ContenthashChangedEventFilter = + TypedEventFilter + +export interface DNSRecordChangedEventObject { + node: string + name: string + resource: number + record: string +} +export type DNSRecordChangedEvent = TypedEvent< + [string, string, number, string], + DNSRecordChangedEventObject +> + +export type DNSRecordChangedEventFilter = + TypedEventFilter + +export interface DNSRecordDeletedEventObject { + node: string + name: string + resource: number +} +export type DNSRecordDeletedEvent = TypedEvent< + [string, string, number], + DNSRecordDeletedEventObject +> + +export type DNSRecordDeletedEventFilter = + TypedEventFilter + +export interface DNSZonehashChangedEventObject { + node: string + lastzonehash: string + zonehash: string +} +export type DNSZonehashChangedEvent = TypedEvent< + [string, string, string], + DNSZonehashChangedEventObject +> + +export type DNSZonehashChangedEventFilter = + TypedEventFilter + +export interface InterfaceChangedEventObject { + node: string + interfaceID: string + implementer: string +} +export type InterfaceChangedEvent = TypedEvent< + [string, string, string], + InterfaceChangedEventObject +> + +export type InterfaceChangedEventFilter = + TypedEventFilter + +export interface NameChangedEventObject { + node: string + name: string +} +export type NameChangedEvent = TypedEvent< + [string, string], + NameChangedEventObject +> + +export type NameChangedEventFilter = TypedEventFilter + +export interface PubkeyChangedEventObject { + node: string + x: string + y: string +} +export type PubkeyChangedEvent = TypedEvent< + [string, string, string], + PubkeyChangedEventObject +> + +export type PubkeyChangedEventFilter = TypedEventFilter + +export interface TextChangedEventObject { + node: string + indexedKey: string + key: string + value: string +} +export type TextChangedEvent = TypedEvent< + [string, string, string, string], + TextChangedEventObject +> + +export type TextChangedEventFilter = TypedEventFilter + +export interface VersionChangedEventObject { + node: string + newVersion: BigNumber +} +export type VersionChangedEvent = TypedEvent< + [string, BigNumber], + VersionChangedEventObject +> + +export type VersionChangedEventFilter = TypedEventFilter + +export interface PublicResolver extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this + attach(addressOrName: string): this + deployed(): Promise + + interface: PublicResolverInterface + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise> + + listeners( + eventFilter?: TypedEventFilter, + ): Array> + listeners(eventName?: string): Array + removeAllListeners( + eventFilter: TypedEventFilter, + ): this + removeAllListeners(eventName?: string): this + off: OnEvent + on: OnEvent + once: OnEvent + removeListener: OnEvent + + functions: { + ABI( + node: PromiseOrValue, + contentTypes: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[BigNumber, string]> + + 'addr(bytes32)'( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string]> + + 'addr(bytes32,uint256)'( + node: PromiseOrValue, + coinType: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string]> + + approve( + node: PromiseOrValue, + delegate: PromiseOrValue, + approved: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + clearRecords( + node: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + contenthash( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string]> + + dnsRecord( + node: PromiseOrValue, + name: PromiseOrValue, + resource: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string]> + + hasDNSRecords( + node: PromiseOrValue, + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + interfaceImplementer( + node: PromiseOrValue, + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string]> + + isApprovedFor( + owner: PromiseOrValue, + node: PromiseOrValue, + delegate: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + isApprovedForAll( + account: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + multicall( + data: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + multicallWithNodeCheck( + nodehash: PromiseOrValue, + data: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + name( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string]> + + pubkey( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string, string] & { x: string; y: string }> + + recordVersions( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[BigNumber]> + + setABI( + node: PromiseOrValue, + contentType: PromiseOrValue, + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + 'setAddr(bytes32,uint256,bytes)'( + node: PromiseOrValue, + coinType: PromiseOrValue, + a: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + 'setAddr(bytes32,address)'( + node: PromiseOrValue, + a: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setApprovalForAll( + operator: PromiseOrValue, + approved: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setContenthash( + node: PromiseOrValue, + hash: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setDNSRecords( + node: PromiseOrValue, + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setInterface( + node: PromiseOrValue, + interfaceID: PromiseOrValue, + implementer: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setName( + node: PromiseOrValue, + newName: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setPubkey( + node: PromiseOrValue, + x: PromiseOrValue, + y: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setText( + node: PromiseOrValue, + key: PromiseOrValue, + value: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setZonehash( + node: PromiseOrValue, + hash: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + text( + node: PromiseOrValue, + key: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string]> + + zonehash( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string]> + } + + ABI( + node: PromiseOrValue, + contentTypes: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[BigNumber, string]> + + 'addr(bytes32)'( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + 'addr(bytes32,uint256)'( + node: PromiseOrValue, + coinType: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + approve( + node: PromiseOrValue, + delegate: PromiseOrValue, + approved: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + clearRecords( + node: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + contenthash( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + dnsRecord( + node: PromiseOrValue, + name: PromiseOrValue, + resource: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + hasDNSRecords( + node: PromiseOrValue, + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + interfaceImplementer( + node: PromiseOrValue, + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + isApprovedFor( + owner: PromiseOrValue, + node: PromiseOrValue, + delegate: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + isApprovedForAll( + account: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + multicall( + data: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + multicallWithNodeCheck( + nodehash: PromiseOrValue, + data: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + name( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + pubkey( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string, string] & { x: string; y: string }> + + recordVersions( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setABI( + node: PromiseOrValue, + contentType: PromiseOrValue, + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + 'setAddr(bytes32,uint256,bytes)'( + node: PromiseOrValue, + coinType: PromiseOrValue, + a: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + 'setAddr(bytes32,address)'( + node: PromiseOrValue, + a: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setApprovalForAll( + operator: PromiseOrValue, + approved: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setContenthash( + node: PromiseOrValue, + hash: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setDNSRecords( + node: PromiseOrValue, + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setInterface( + node: PromiseOrValue, + interfaceID: PromiseOrValue, + implementer: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setName( + node: PromiseOrValue, + newName: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setPubkey( + node: PromiseOrValue, + x: PromiseOrValue, + y: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setText( + node: PromiseOrValue, + key: PromiseOrValue, + value: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setZonehash( + node: PromiseOrValue, + hash: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + text( + node: PromiseOrValue, + key: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + zonehash( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + callStatic: { + ABI( + node: PromiseOrValue, + contentTypes: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[BigNumber, string]> + + 'addr(bytes32)'( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + 'addr(bytes32,uint256)'( + node: PromiseOrValue, + coinType: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + approve( + node: PromiseOrValue, + delegate: PromiseOrValue, + approved: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + clearRecords( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + contenthash( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + dnsRecord( + node: PromiseOrValue, + name: PromiseOrValue, + resource: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + hasDNSRecords( + node: PromiseOrValue, + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + interfaceImplementer( + node: PromiseOrValue, + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + isApprovedFor( + owner: PromiseOrValue, + node: PromiseOrValue, + delegate: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + isApprovedForAll( + account: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + multicall( + data: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise + + multicallWithNodeCheck( + nodehash: PromiseOrValue, + data: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise + + name( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + pubkey( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string, string] & { x: string; y: string }> + + recordVersions( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setABI( + node: PromiseOrValue, + contentType: PromiseOrValue, + data: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + 'setAddr(bytes32,uint256,bytes)'( + node: PromiseOrValue, + coinType: PromiseOrValue, + a: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + 'setAddr(bytes32,address)'( + node: PromiseOrValue, + a: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setApprovalForAll( + operator: PromiseOrValue, + approved: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setContenthash( + node: PromiseOrValue, + hash: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setDNSRecords( + node: PromiseOrValue, + data: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setInterface( + node: PromiseOrValue, + interfaceID: PromiseOrValue, + implementer: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setName( + node: PromiseOrValue, + newName: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setPubkey( + node: PromiseOrValue, + x: PromiseOrValue, + y: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setText( + node: PromiseOrValue, + key: PromiseOrValue, + value: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setZonehash( + node: PromiseOrValue, + hash: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + text( + node: PromiseOrValue, + key: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + zonehash( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + filters: { + 'ABIChanged(bytes32,uint256)'( + node?: PromiseOrValue | null, + contentType?: PromiseOrValue | null, + ): ABIChangedEventFilter + ABIChanged( + node?: PromiseOrValue | null, + contentType?: PromiseOrValue | null, + ): ABIChangedEventFilter + + 'AddrChanged(bytes32,address)'( + node?: PromiseOrValue | null, + a?: null, + ): AddrChangedEventFilter + AddrChanged( + node?: PromiseOrValue | null, + a?: null, + ): AddrChangedEventFilter + + 'AddressChanged(bytes32,uint256,bytes)'( + node?: PromiseOrValue | null, + coinType?: null, + newAddress?: null, + ): AddressChangedEventFilter + AddressChanged( + node?: PromiseOrValue | null, + coinType?: null, + newAddress?: null, + ): AddressChangedEventFilter + + 'ApprovalForAll(address,address,bool)'( + owner?: PromiseOrValue | null, + operator?: PromiseOrValue | null, + approved?: null, + ): ApprovalForAllEventFilter + ApprovalForAll( + owner?: PromiseOrValue | null, + operator?: PromiseOrValue | null, + approved?: null, + ): ApprovalForAllEventFilter + + 'Approved(address,bytes32,address,bool)'( + owner?: null, + node?: PromiseOrValue | null, + delegate?: PromiseOrValue | null, + approved?: PromiseOrValue | null, + ): ApprovedEventFilter + Approved( + owner?: null, + node?: PromiseOrValue | null, + delegate?: PromiseOrValue | null, + approved?: PromiseOrValue | null, + ): ApprovedEventFilter + + 'ContenthashChanged(bytes32,bytes)'( + node?: PromiseOrValue | null, + hash?: null, + ): ContenthashChangedEventFilter + ContenthashChanged( + node?: PromiseOrValue | null, + hash?: null, + ): ContenthashChangedEventFilter + + 'DNSRecordChanged(bytes32,bytes,uint16,bytes)'( + node?: PromiseOrValue | null, + name?: null, + resource?: null, + record?: null, + ): DNSRecordChangedEventFilter + DNSRecordChanged( + node?: PromiseOrValue | null, + name?: null, + resource?: null, + record?: null, + ): DNSRecordChangedEventFilter + + 'DNSRecordDeleted(bytes32,bytes,uint16)'( + node?: PromiseOrValue | null, + name?: null, + resource?: null, + ): DNSRecordDeletedEventFilter + DNSRecordDeleted( + node?: PromiseOrValue | null, + name?: null, + resource?: null, + ): DNSRecordDeletedEventFilter + + 'DNSZonehashChanged(bytes32,bytes,bytes)'( + node?: PromiseOrValue | null, + lastzonehash?: null, + zonehash?: null, + ): DNSZonehashChangedEventFilter + DNSZonehashChanged( + node?: PromiseOrValue | null, + lastzonehash?: null, + zonehash?: null, + ): DNSZonehashChangedEventFilter + + 'InterfaceChanged(bytes32,bytes4,address)'( + node?: PromiseOrValue | null, + interfaceID?: PromiseOrValue | null, + implementer?: null, + ): InterfaceChangedEventFilter + InterfaceChanged( + node?: PromiseOrValue | null, + interfaceID?: PromiseOrValue | null, + implementer?: null, + ): InterfaceChangedEventFilter + + 'NameChanged(bytes32,string)'( + node?: PromiseOrValue | null, + name?: null, + ): NameChangedEventFilter + NameChanged( + node?: PromiseOrValue | null, + name?: null, + ): NameChangedEventFilter + + 'PubkeyChanged(bytes32,bytes32,bytes32)'( + node?: PromiseOrValue | null, + x?: null, + y?: null, + ): PubkeyChangedEventFilter + PubkeyChanged( + node?: PromiseOrValue | null, + x?: null, + y?: null, + ): PubkeyChangedEventFilter + + 'TextChanged(bytes32,string,string,string)'( + node?: PromiseOrValue | null, + indexedKey?: PromiseOrValue | null, + key?: null, + value?: null, + ): TextChangedEventFilter + TextChanged( + node?: PromiseOrValue | null, + indexedKey?: PromiseOrValue | null, + key?: null, + value?: null, + ): TextChangedEventFilter + + 'VersionChanged(bytes32,uint64)'( + node?: PromiseOrValue | null, + newVersion?: null, + ): VersionChangedEventFilter + VersionChanged( + node?: PromiseOrValue | null, + newVersion?: null, + ): VersionChangedEventFilter + } + + estimateGas: { + ABI( + node: PromiseOrValue, + contentTypes: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + 'addr(bytes32)'( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + 'addr(bytes32,uint256)'( + node: PromiseOrValue, + coinType: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + approve( + node: PromiseOrValue, + delegate: PromiseOrValue, + approved: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + clearRecords( + node: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + contenthash( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + dnsRecord( + node: PromiseOrValue, + name: PromiseOrValue, + resource: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + hasDNSRecords( + node: PromiseOrValue, + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + interfaceImplementer( + node: PromiseOrValue, + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + isApprovedFor( + owner: PromiseOrValue, + node: PromiseOrValue, + delegate: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + isApprovedForAll( + account: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + multicall( + data: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + multicallWithNodeCheck( + nodehash: PromiseOrValue, + data: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + name( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + pubkey( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + recordVersions( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setABI( + node: PromiseOrValue, + contentType: PromiseOrValue, + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + 'setAddr(bytes32,uint256,bytes)'( + node: PromiseOrValue, + coinType: PromiseOrValue, + a: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + 'setAddr(bytes32,address)'( + node: PromiseOrValue, + a: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setApprovalForAll( + operator: PromiseOrValue, + approved: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setContenthash( + node: PromiseOrValue, + hash: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setDNSRecords( + node: PromiseOrValue, + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setInterface( + node: PromiseOrValue, + interfaceID: PromiseOrValue, + implementer: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setName( + node: PromiseOrValue, + newName: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setPubkey( + node: PromiseOrValue, + x: PromiseOrValue, + y: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setText( + node: PromiseOrValue, + key: PromiseOrValue, + value: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setZonehash( + node: PromiseOrValue, + hash: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + text( + node: PromiseOrValue, + key: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + zonehash( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + populateTransaction: { + ABI( + node: PromiseOrValue, + contentTypes: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + 'addr(bytes32)'( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + 'addr(bytes32,uint256)'( + node: PromiseOrValue, + coinType: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + approve( + node: PromiseOrValue, + delegate: PromiseOrValue, + approved: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + clearRecords( + node: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + contenthash( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + dnsRecord( + node: PromiseOrValue, + name: PromiseOrValue, + resource: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + hasDNSRecords( + node: PromiseOrValue, + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + interfaceImplementer( + node: PromiseOrValue, + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + isApprovedFor( + owner: PromiseOrValue, + node: PromiseOrValue, + delegate: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + isApprovedForAll( + account: PromiseOrValue, + operator: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + multicall( + data: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + multicallWithNodeCheck( + nodehash: PromiseOrValue, + data: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + name( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + pubkey( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + recordVersions( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setABI( + node: PromiseOrValue, + contentType: PromiseOrValue, + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + 'setAddr(bytes32,uint256,bytes)'( + node: PromiseOrValue, + coinType: PromiseOrValue, + a: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + 'setAddr(bytes32,address)'( + node: PromiseOrValue, + a: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setApprovalForAll( + operator: PromiseOrValue, + approved: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setContenthash( + node: PromiseOrValue, + hash: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setDNSRecords( + node: PromiseOrValue, + data: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setInterface( + node: PromiseOrValue, + interfaceID: PromiseOrValue, + implementer: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setName( + node: PromiseOrValue, + newName: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setPubkey( + node: PromiseOrValue, + x: PromiseOrValue, + y: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setText( + node: PromiseOrValue, + key: PromiseOrValue, + value: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setZonehash( + node: PromiseOrValue, + hash: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + text( + node: PromiseOrValue, + key: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + zonehash( + node: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/RSASHA1Algorithm.ts b/.yalc/@ensdomains/ensjs/src/generated/RSASHA1Algorithm.ts new file mode 100644 index 000000000..7d39e459d --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/RSASHA1Algorithm.ts @@ -0,0 +1,114 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { FunctionFragment, Result } from '@ethersproject/abi' +import { Interface } from '@ethersproject/abi' +import type { Listener, Provider } from '@ethersproject/abstract-provider' +import type { Signer } from '@ethersproject/abstract-signer' +import type { BigNumber } from '@ethersproject/bignumber' +import type { BytesLike } from '@ethersproject/bytes' +import type { + BaseContract, + CallOverrides, + PopulatedTransaction, +} from '@ethersproject/contracts' +import type { + OnEvent, + PromiseOrValue, + TypedEvent, + TypedEventFilter, + TypedListener, +} from './common' + +export interface RSASHA1AlgorithmInterface extends Interface { + functions: { + 'verify(bytes,bytes,bytes)': FunctionFragment + } + + getFunction(nameOrSignatureOrTopic: 'verify'): FunctionFragment + + encodeFunctionData( + functionFragment: 'verify', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + + decodeFunctionResult(functionFragment: 'verify', data: BytesLike): Result + + events: {} +} + +export interface RSASHA1Algorithm extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this + attach(addressOrName: string): this + deployed(): Promise + + interface: RSASHA1AlgorithmInterface + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise> + + listeners( + eventFilter?: TypedEventFilter, + ): Array> + listeners(eventName?: string): Array + removeAllListeners( + eventFilter: TypedEventFilter, + ): this + removeAllListeners(eventName?: string): this + off: OnEvent + on: OnEvent + once: OnEvent + removeListener: OnEvent + + functions: { + verify( + key: PromiseOrValue, + data: PromiseOrValue, + sig: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + } + + verify( + key: PromiseOrValue, + data: PromiseOrValue, + sig: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + callStatic: { + verify( + key: PromiseOrValue, + data: PromiseOrValue, + sig: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + filters: {} + + estimateGas: { + verify( + key: PromiseOrValue, + data: PromiseOrValue, + sig: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + populateTransaction: { + verify( + key: PromiseOrValue, + data: PromiseOrValue, + sig: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/RSASHA256Algorithm.ts b/.yalc/@ensdomains/ensjs/src/generated/RSASHA256Algorithm.ts new file mode 100644 index 000000000..610b3b8d5 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/RSASHA256Algorithm.ts @@ -0,0 +1,114 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { FunctionFragment, Result } from '@ethersproject/abi' +import { Interface } from '@ethersproject/abi' +import type { Listener, Provider } from '@ethersproject/abstract-provider' +import type { Signer } from '@ethersproject/abstract-signer' +import type { BigNumber } from '@ethersproject/bignumber' +import type { BytesLike } from '@ethersproject/bytes' +import type { + BaseContract, + CallOverrides, + PopulatedTransaction, +} from '@ethersproject/contracts' +import type { + OnEvent, + PromiseOrValue, + TypedEvent, + TypedEventFilter, + TypedListener, +} from './common' + +export interface RSASHA256AlgorithmInterface extends Interface { + functions: { + 'verify(bytes,bytes,bytes)': FunctionFragment + } + + getFunction(nameOrSignatureOrTopic: 'verify'): FunctionFragment + + encodeFunctionData( + functionFragment: 'verify', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + + decodeFunctionResult(functionFragment: 'verify', data: BytesLike): Result + + events: {} +} + +export interface RSASHA256Algorithm extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this + attach(addressOrName: string): this + deployed(): Promise + + interface: RSASHA256AlgorithmInterface + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise> + + listeners( + eventFilter?: TypedEventFilter, + ): Array> + listeners(eventName?: string): Array + removeAllListeners( + eventFilter: TypedEventFilter, + ): this + removeAllListeners(eventName?: string): this + off: OnEvent + on: OnEvent + once: OnEvent + removeListener: OnEvent + + functions: { + verify( + key: PromiseOrValue, + data: PromiseOrValue, + sig: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + } + + verify( + key: PromiseOrValue, + data: PromiseOrValue, + sig: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + callStatic: { + verify( + key: PromiseOrValue, + data: PromiseOrValue, + sig: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + filters: {} + + estimateGas: { + verify( + key: PromiseOrValue, + data: PromiseOrValue, + sig: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + populateTransaction: { + verify( + key: PromiseOrValue, + data: PromiseOrValue, + sig: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/ReverseRegistrar.ts b/.yalc/@ensdomains/ensjs/src/generated/ReverseRegistrar.ts new file mode 100644 index 000000000..09ed5f1a2 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/ReverseRegistrar.ts @@ -0,0 +1,622 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + EventFragment, + FunctionFragment, + Result, +} from '@ethersproject/abi' +import { Interface } from '@ethersproject/abi' +import type { Listener, Provider } from '@ethersproject/abstract-provider' +import type { Signer } from '@ethersproject/abstract-signer' +import type { BigNumber } from '@ethersproject/bignumber' +import type { BytesLike } from '@ethersproject/bytes' +import type { + BaseContract, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, +} from '@ethersproject/contracts' +import type { + OnEvent, + PromiseOrValue, + TypedEvent, + TypedEventFilter, + TypedListener, +} from './common' + +export interface ReverseRegistrarInterface extends Interface { + functions: { + 'claim(address)': FunctionFragment + 'claimForAddr(address,address,address)': FunctionFragment + 'claimWithResolver(address,address)': FunctionFragment + 'controllers(address)': FunctionFragment + 'defaultResolver()': FunctionFragment + 'ens()': FunctionFragment + 'node(address)': FunctionFragment + 'owner()': FunctionFragment + 'renounceOwnership()': FunctionFragment + 'setController(address,bool)': FunctionFragment + 'setDefaultResolver(address)': FunctionFragment + 'setName(string)': FunctionFragment + 'setNameForAddr(address,address,address,string)': FunctionFragment + 'transferOwnership(address)': FunctionFragment + } + + getFunction( + nameOrSignatureOrTopic: + | 'claim' + | 'claimForAddr' + | 'claimWithResolver' + | 'controllers' + | 'defaultResolver' + | 'ens' + | 'node' + | 'owner' + | 'renounceOwnership' + | 'setController' + | 'setDefaultResolver' + | 'setName' + | 'setNameForAddr' + | 'transferOwnership', + ): FunctionFragment + + encodeFunctionData( + functionFragment: 'claim', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'claimForAddr', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'claimWithResolver', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'controllers', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'defaultResolver', + values?: undefined, + ): string + encodeFunctionData(functionFragment: 'ens', values?: undefined): string + encodeFunctionData( + functionFragment: 'node', + values: [PromiseOrValue], + ): string + encodeFunctionData(functionFragment: 'owner', values?: undefined): string + encodeFunctionData( + functionFragment: 'renounceOwnership', + values?: undefined, + ): string + encodeFunctionData( + functionFragment: 'setController', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setDefaultResolver', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setName', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setNameForAddr', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'transferOwnership', + values: [PromiseOrValue], + ): string + + decodeFunctionResult(functionFragment: 'claim', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'claimForAddr', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'claimWithResolver', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'controllers', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'defaultResolver', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'ens', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'node', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'renounceOwnership', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'setController', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'setDefaultResolver', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'setName', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'setNameForAddr', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'transferOwnership', + data: BytesLike, + ): Result + + events: { + 'ControllerChanged(address,bool)': EventFragment + 'DefaultResolverChanged(address)': EventFragment + 'OwnershipTransferred(address,address)': EventFragment + 'ReverseClaimed(address,bytes32)': EventFragment + } + + getEvent(nameOrSignatureOrTopic: 'ControllerChanged'): EventFragment + getEvent(nameOrSignatureOrTopic: 'DefaultResolverChanged'): EventFragment + getEvent(nameOrSignatureOrTopic: 'OwnershipTransferred'): EventFragment + getEvent(nameOrSignatureOrTopic: 'ReverseClaimed'): EventFragment +} + +export interface ControllerChangedEventObject { + controller: string + enabled: boolean +} +export type ControllerChangedEvent = TypedEvent< + [string, boolean], + ControllerChangedEventObject +> + +export type ControllerChangedEventFilter = + TypedEventFilter + +export interface DefaultResolverChangedEventObject { + resolver: string +} +export type DefaultResolverChangedEvent = TypedEvent< + [string], + DefaultResolverChangedEventObject +> + +export type DefaultResolverChangedEventFilter = + TypedEventFilter + +export interface OwnershipTransferredEventObject { + previousOwner: string + newOwner: string +} +export type OwnershipTransferredEvent = TypedEvent< + [string, string], + OwnershipTransferredEventObject +> + +export type OwnershipTransferredEventFilter = + TypedEventFilter + +export interface ReverseClaimedEventObject { + addr: string + node: string +} +export type ReverseClaimedEvent = TypedEvent< + [string, string], + ReverseClaimedEventObject +> + +export type ReverseClaimedEventFilter = TypedEventFilter + +export interface ReverseRegistrar extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this + attach(addressOrName: string): this + deployed(): Promise + + interface: ReverseRegistrarInterface + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise> + + listeners( + eventFilter?: TypedEventFilter, + ): Array> + listeners(eventName?: string): Array + removeAllListeners( + eventFilter: TypedEventFilter, + ): this + removeAllListeners(eventName?: string): this + off: OnEvent + on: OnEvent + once: OnEvent + removeListener: OnEvent + + functions: { + claim( + owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + claimForAddr( + addr: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + claimWithResolver( + owner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + controllers( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + defaultResolver(overrides?: CallOverrides): Promise<[string]> + + ens(overrides?: CallOverrides): Promise<[string]> + + node( + addr: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string]> + + owner(overrides?: CallOverrides): Promise<[string]> + + renounceOwnership( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setController( + controller: PromiseOrValue, + enabled: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setDefaultResolver( + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setName( + name: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setNameForAddr( + addr: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + name: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + } + + claim( + owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + claimForAddr( + addr: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + claimWithResolver( + owner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + controllers( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + defaultResolver(overrides?: CallOverrides): Promise + + ens(overrides?: CallOverrides): Promise + + node(addr: PromiseOrValue, overrides?: CallOverrides): Promise + + owner(overrides?: CallOverrides): Promise + + renounceOwnership( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setController( + controller: PromiseOrValue, + enabled: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setDefaultResolver( + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setName( + name: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setNameForAddr( + addr: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + name: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + callStatic: { + claim( + owner: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + claimForAddr( + addr: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + claimWithResolver( + owner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + controllers( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + defaultResolver(overrides?: CallOverrides): Promise + + ens(overrides?: CallOverrides): Promise + + node( + addr: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + owner(overrides?: CallOverrides): Promise + + renounceOwnership(overrides?: CallOverrides): Promise + + setController( + controller: PromiseOrValue, + enabled: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setDefaultResolver( + resolver: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setName( + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setNameForAddr( + addr: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + filters: { + 'ControllerChanged(address,bool)'( + controller?: PromiseOrValue | null, + enabled?: null, + ): ControllerChangedEventFilter + ControllerChanged( + controller?: PromiseOrValue | null, + enabled?: null, + ): ControllerChangedEventFilter + + 'DefaultResolverChanged(address)'( + resolver?: PromiseOrValue | null, + ): DefaultResolverChangedEventFilter + DefaultResolverChanged( + resolver?: PromiseOrValue | null, + ): DefaultResolverChangedEventFilter + + 'OwnershipTransferred(address,address)'( + previousOwner?: PromiseOrValue | null, + newOwner?: PromiseOrValue | null, + ): OwnershipTransferredEventFilter + OwnershipTransferred( + previousOwner?: PromiseOrValue | null, + newOwner?: PromiseOrValue | null, + ): OwnershipTransferredEventFilter + + 'ReverseClaimed(address,bytes32)'( + addr?: PromiseOrValue | null, + node?: PromiseOrValue | null, + ): ReverseClaimedEventFilter + ReverseClaimed( + addr?: PromiseOrValue | null, + node?: PromiseOrValue | null, + ): ReverseClaimedEventFilter + } + + estimateGas: { + claim( + owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + claimForAddr( + addr: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + claimWithResolver( + owner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + controllers( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + defaultResolver(overrides?: CallOverrides): Promise + + ens(overrides?: CallOverrides): Promise + + node( + addr: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + owner(overrides?: CallOverrides): Promise + + renounceOwnership( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setController( + controller: PromiseOrValue, + enabled: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setDefaultResolver( + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setName( + name: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setNameForAddr( + addr: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + name: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + } + + populateTransaction: { + claim( + owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + claimForAddr( + addr: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + claimWithResolver( + owner: PromiseOrValue, + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + controllers( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + defaultResolver(overrides?: CallOverrides): Promise + + ens(overrides?: CallOverrides): Promise + + node( + addr: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + owner(overrides?: CallOverrides): Promise + + renounceOwnership( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setController( + controller: PromiseOrValue, + enabled: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setDefaultResolver( + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setName( + name: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setNameForAddr( + addr: PromiseOrValue, + owner: PromiseOrValue, + resolver: PromiseOrValue, + name: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/Root.ts b/.yalc/@ensdomains/ensjs/src/generated/Root.ts new file mode 100644 index 000000000..82b0b4822 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/Root.ts @@ -0,0 +1,431 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + EventFragment, + FunctionFragment, + Result, +} from '@ethersproject/abi' +import { Interface } from '@ethersproject/abi' +import type { Listener, Provider } from '@ethersproject/abstract-provider' +import type { Signer } from '@ethersproject/abstract-signer' +import type { BigNumber } from '@ethersproject/bignumber' +import type { BytesLike } from '@ethersproject/bytes' +import type { + BaseContract, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, +} from '@ethersproject/contracts' +import type { + OnEvent, + PromiseOrValue, + TypedEvent, + TypedEventFilter, + TypedListener, +} from './common' + +export interface RootInterface extends Interface { + functions: { + 'controllers(address)': FunctionFragment + 'ens()': FunctionFragment + 'isOwner(address)': FunctionFragment + 'lock(bytes32)': FunctionFragment + 'locked(bytes32)': FunctionFragment + 'owner()': FunctionFragment + 'setController(address,bool)': FunctionFragment + 'setResolver(address)': FunctionFragment + 'setSubnodeOwner(bytes32,address)': FunctionFragment + 'supportsInterface(bytes4)': FunctionFragment + 'transferOwnership(address)': FunctionFragment + } + + getFunction( + nameOrSignatureOrTopic: + | 'controllers' + | 'ens' + | 'isOwner' + | 'lock' + | 'locked' + | 'owner' + | 'setController' + | 'setResolver' + | 'setSubnodeOwner' + | 'supportsInterface' + | 'transferOwnership', + ): FunctionFragment + + encodeFunctionData( + functionFragment: 'controllers', + values: [PromiseOrValue], + ): string + encodeFunctionData(functionFragment: 'ens', values?: undefined): string + encodeFunctionData( + functionFragment: 'isOwner', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'lock', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'locked', + values: [PromiseOrValue], + ): string + encodeFunctionData(functionFragment: 'owner', values?: undefined): string + encodeFunctionData( + functionFragment: 'setController', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setResolver', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setSubnodeOwner', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'supportsInterface', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'transferOwnership', + values: [PromiseOrValue], + ): string + + decodeFunctionResult(functionFragment: 'controllers', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'ens', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'isOwner', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'lock', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'locked', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'setController', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'setResolver', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'setSubnodeOwner', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'supportsInterface', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'transferOwnership', + data: BytesLike, + ): Result + + events: { + 'TLDLocked(bytes32)': EventFragment + } + + getEvent(nameOrSignatureOrTopic: 'TLDLocked'): EventFragment +} + +export interface TLDLockedEventObject { + label: string +} +export type TLDLockedEvent = TypedEvent<[string], TLDLockedEventObject> + +export type TLDLockedEventFilter = TypedEventFilter + +export interface Root extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this + attach(addressOrName: string): this + deployed(): Promise + + interface: RootInterface + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise> + + listeners( + eventFilter?: TypedEventFilter, + ): Array> + listeners(eventName?: string): Array + removeAllListeners( + eventFilter: TypedEventFilter, + ): this + removeAllListeners(eventName?: string): this + off: OnEvent + on: OnEvent + once: OnEvent + removeListener: OnEvent + + functions: { + controllers( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + ens(overrides?: CallOverrides): Promise<[string]> + + isOwner( + addr: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + lock( + label: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + locked( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + owner(overrides?: CallOverrides): Promise<[string]> + + setController( + controller: PromiseOrValue, + enabled: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setResolver( + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setSubnodeOwner( + label: PromiseOrValue, + owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + } + + controllers( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + ens(overrides?: CallOverrides): Promise + + isOwner( + addr: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + lock( + label: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + locked( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + owner(overrides?: CallOverrides): Promise + + setController( + controller: PromiseOrValue, + enabled: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setResolver( + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setSubnodeOwner( + label: PromiseOrValue, + owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + callStatic: { + controllers( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + ens(overrides?: CallOverrides): Promise + + isOwner( + addr: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + lock( + label: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + locked( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + owner(overrides?: CallOverrides): Promise + + setController( + controller: PromiseOrValue, + enabled: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setResolver( + resolver: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setSubnodeOwner( + label: PromiseOrValue, + owner: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + filters: { + 'TLDLocked(bytes32)'( + label?: PromiseOrValue | null, + ): TLDLockedEventFilter + TLDLocked(label?: PromiseOrValue | null): TLDLockedEventFilter + } + + estimateGas: { + controllers( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + ens(overrides?: CallOverrides): Promise + + isOwner( + addr: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + lock( + label: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + locked( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + owner(overrides?: CallOverrides): Promise + + setController( + controller: PromiseOrValue, + enabled: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setResolver( + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setSubnodeOwner( + label: PromiseOrValue, + owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + } + + populateTransaction: { + controllers( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + ens(overrides?: CallOverrides): Promise + + isOwner( + addr: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + lock( + label: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + locked( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + owner(overrides?: CallOverrides): Promise + + setController( + controller: PromiseOrValue, + enabled: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setResolver( + resolver: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + setSubnodeOwner( + label: PromiseOrValue, + owner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + supportsInterface( + interfaceID: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/SHA1Digest.ts b/.yalc/@ensdomains/ensjs/src/generated/SHA1Digest.ts new file mode 100644 index 000000000..e3ef33fde --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/SHA1Digest.ts @@ -0,0 +1,130 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { FunctionFragment, Result } from '@ethersproject/abi' +import { Interface } from '@ethersproject/abi' +import type { Listener, Provider } from '@ethersproject/abstract-provider' +import type { Signer } from '@ethersproject/abstract-signer' +import type { BigNumber } from '@ethersproject/bignumber' +import type { BytesLike } from '@ethersproject/bytes' +import type { + BaseContract, + CallOverrides, + PopulatedTransaction, +} from '@ethersproject/contracts' +import type { + OnEvent, + PromiseOrValue, + TypedEvent, + TypedEventFilter, + TypedListener, +} from './common' + +export interface SHA1DigestInterface extends Interface { + functions: { + 'verify(bytes,bytes)': FunctionFragment + } + + getFunction(nameOrSignatureOrTopic: 'verify'): FunctionFragment + + encodeFunctionData( + functionFragment: 'verify', + values: [PromiseOrValue, PromiseOrValue], + ): string + + decodeFunctionResult(functionFragment: 'verify', data: BytesLike): Result + + events: {} +} + +export interface SHA1Digest extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this + attach(addressOrName: string): this + deployed(): Promise + + interface: SHA1DigestInterface + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise> + + listeners( + eventFilter?: TypedEventFilter, + ): Array> + listeners(eventName?: string): Array + removeAllListeners( + eventFilter: TypedEventFilter, + ): this + removeAllListeners(eventName?: string): this + off: OnEvent + on: OnEvent + once: OnEvent + removeListener: OnEvent + + functions: { + /** + * Verifies a cryptographic hash. + * @param data The data to hash. + * @param hash The hash to compare to. + */ + verify( + data: PromiseOrValue, + hash: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + } + + /** + * Verifies a cryptographic hash. + * @param data The data to hash. + * @param hash The hash to compare to. + */ + verify( + data: PromiseOrValue, + hash: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + callStatic: { + /** + * Verifies a cryptographic hash. + * @param data The data to hash. + * @param hash The hash to compare to. + */ + verify( + data: PromiseOrValue, + hash: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + filters: {} + + estimateGas: { + /** + * Verifies a cryptographic hash. + * @param data The data to hash. + * @param hash The hash to compare to. + */ + verify( + data: PromiseOrValue, + hash: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + populateTransaction: { + /** + * Verifies a cryptographic hash. + * @param data The data to hash. + * @param hash The hash to compare to. + */ + verify( + data: PromiseOrValue, + hash: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/SHA1NSEC3Digest.ts b/.yalc/@ensdomains/ensjs/src/generated/SHA1NSEC3Digest.ts new file mode 100644 index 000000000..8b0427ad0 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/SHA1NSEC3Digest.ts @@ -0,0 +1,144 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { FunctionFragment, Result } from '@ethersproject/abi' +import { Interface } from '@ethersproject/abi' +import type { Listener, Provider } from '@ethersproject/abstract-provider' +import type { Signer } from '@ethersproject/abstract-signer' +import type { BigNumber, BigNumberish } from '@ethersproject/bignumber' +import type { BytesLike } from '@ethersproject/bytes' +import type { + BaseContract, + CallOverrides, + PopulatedTransaction, +} from '@ethersproject/contracts' +import type { + OnEvent, + PromiseOrValue, + TypedEvent, + TypedEventFilter, + TypedListener, +} from './common' + +export interface SHA1NSEC3DigestInterface extends Interface { + functions: { + 'hash(bytes,bytes,uint256)': FunctionFragment + } + + getFunction(nameOrSignatureOrTopic: 'hash'): FunctionFragment + + encodeFunctionData( + functionFragment: 'hash', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue, + ], + ): string + + decodeFunctionResult(functionFragment: 'hash', data: BytesLike): Result + + events: {} +} + +export interface SHA1NSEC3Digest extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this + attach(addressOrName: string): this + deployed(): Promise + + interface: SHA1NSEC3DigestInterface + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise> + + listeners( + eventFilter?: TypedEventFilter, + ): Array> + listeners(eventName?: string): Array + removeAllListeners( + eventFilter: TypedEventFilter, + ): this + removeAllListeners(eventName?: string): this + off: OnEvent + on: OnEvent + once: OnEvent + removeListener: OnEvent + + functions: { + /** + * Performs an NSEC3 iterated hash. + * @param data The data to hash. + * @param iterations The number of iterations to perform. + * @param salt The salt value to use on each iteration. + */ + hash( + salt: PromiseOrValue, + data: PromiseOrValue, + iterations: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string]> + } + + /** + * Performs an NSEC3 iterated hash. + * @param data The data to hash. + * @param iterations The number of iterations to perform. + * @param salt The salt value to use on each iteration. + */ + hash( + salt: PromiseOrValue, + data: PromiseOrValue, + iterations: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + callStatic: { + /** + * Performs an NSEC3 iterated hash. + * @param data The data to hash. + * @param iterations The number of iterations to perform. + * @param salt The salt value to use on each iteration. + */ + hash( + salt: PromiseOrValue, + data: PromiseOrValue, + iterations: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + filters: {} + + estimateGas: { + /** + * Performs an NSEC3 iterated hash. + * @param data The data to hash. + * @param iterations The number of iterations to perform. + * @param salt The salt value to use on each iteration. + */ + hash( + salt: PromiseOrValue, + data: PromiseOrValue, + iterations: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + populateTransaction: { + /** + * Performs an NSEC3 iterated hash. + * @param data The data to hash. + * @param iterations The number of iterations to perform. + * @param salt The salt value to use on each iteration. + */ + hash( + salt: PromiseOrValue, + data: PromiseOrValue, + iterations: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/SHA256Digest.ts b/.yalc/@ensdomains/ensjs/src/generated/SHA256Digest.ts new file mode 100644 index 000000000..8a33c5a95 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/SHA256Digest.ts @@ -0,0 +1,130 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { FunctionFragment, Result } from '@ethersproject/abi' +import { Interface } from '@ethersproject/abi' +import type { Listener, Provider } from '@ethersproject/abstract-provider' +import type { Signer } from '@ethersproject/abstract-signer' +import type { BigNumber } from '@ethersproject/bignumber' +import type { BytesLike } from '@ethersproject/bytes' +import type { + BaseContract, + CallOverrides, + PopulatedTransaction, +} from '@ethersproject/contracts' +import type { + OnEvent, + PromiseOrValue, + TypedEvent, + TypedEventFilter, + TypedListener, +} from './common' + +export interface SHA256DigestInterface extends Interface { + functions: { + 'verify(bytes,bytes)': FunctionFragment + } + + getFunction(nameOrSignatureOrTopic: 'verify'): FunctionFragment + + encodeFunctionData( + functionFragment: 'verify', + values: [PromiseOrValue, PromiseOrValue], + ): string + + decodeFunctionResult(functionFragment: 'verify', data: BytesLike): Result + + events: {} +} + +export interface SHA256Digest extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this + attach(addressOrName: string): this + deployed(): Promise + + interface: SHA256DigestInterface + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise> + + listeners( + eventFilter?: TypedEventFilter, + ): Array> + listeners(eventName?: string): Array + removeAllListeners( + eventFilter: TypedEventFilter, + ): this + removeAllListeners(eventName?: string): this + off: OnEvent + on: OnEvent + once: OnEvent + removeListener: OnEvent + + functions: { + /** + * Verifies a cryptographic hash. + * @param data The data to hash. + * @param hash The hash to compare to. + */ + verify( + data: PromiseOrValue, + hash: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + } + + /** + * Verifies a cryptographic hash. + * @param data The data to hash. + * @param hash The hash to compare to. + */ + verify( + data: PromiseOrValue, + hash: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + callStatic: { + /** + * Verifies a cryptographic hash. + * @param data The data to hash. + * @param hash The hash to compare to. + */ + verify( + data: PromiseOrValue, + hash: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + filters: {} + + estimateGas: { + /** + * Verifies a cryptographic hash. + * @param data The data to hash. + * @param hash The hash to compare to. + */ + verify( + data: PromiseOrValue, + hash: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + populateTransaction: { + /** + * Verifies a cryptographic hash. + * @param data The data to hash. + * @param hash The hash to compare to. + */ + verify( + data: PromiseOrValue, + hash: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/StaticMetadataService.ts b/.yalc/@ensdomains/ensjs/src/generated/StaticMetadataService.ts new file mode 100644 index 000000000..0bb4eeddb --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/StaticMetadataService.ts @@ -0,0 +1,100 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { FunctionFragment, Result } from '@ethersproject/abi' +import { Interface } from '@ethersproject/abi' +import type { Listener, Provider } from '@ethersproject/abstract-provider' +import type { Signer } from '@ethersproject/abstract-signer' +import type { BigNumber, BigNumberish } from '@ethersproject/bignumber' +import type { BytesLike } from '@ethersproject/bytes' +import type { + BaseContract, + CallOverrides, + PopulatedTransaction, +} from '@ethersproject/contracts' +import type { + OnEvent, + PromiseOrValue, + TypedEvent, + TypedEventFilter, + TypedListener, +} from './common' + +export interface StaticMetadataServiceInterface extends Interface { + functions: { + 'uri(uint256)': FunctionFragment + } + + getFunction(nameOrSignatureOrTopic: 'uri'): FunctionFragment + + encodeFunctionData( + functionFragment: 'uri', + values: [PromiseOrValue], + ): string + + decodeFunctionResult(functionFragment: 'uri', data: BytesLike): Result + + events: {} +} + +export interface StaticMetadataService extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this + attach(addressOrName: string): this + deployed(): Promise + + interface: StaticMetadataServiceInterface + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise> + + listeners( + eventFilter?: TypedEventFilter, + ): Array> + listeners(eventName?: string): Array + removeAllListeners( + eventFilter: TypedEventFilter, + ): this + removeAllListeners(eventName?: string): this + off: OnEvent + on: OnEvent + once: OnEvent + removeListener: OnEvent + + functions: { + uri( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string]> + } + + uri( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + callStatic: { + uri( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + filters: {} + + estimateGas: { + uri( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + populateTransaction: { + uri( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/TLDPublicSuffixList.ts b/.yalc/@ensdomains/ensjs/src/generated/TLDPublicSuffixList.ts new file mode 100644 index 000000000..95ce4f1bf --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/TLDPublicSuffixList.ts @@ -0,0 +1,103 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { FunctionFragment, Result } from '@ethersproject/abi' +import { Interface } from '@ethersproject/abi' +import type { Listener, Provider } from '@ethersproject/abstract-provider' +import type { Signer } from '@ethersproject/abstract-signer' +import type { BigNumber } from '@ethersproject/bignumber' +import type { BytesLike } from '@ethersproject/bytes' +import type { + BaseContract, + CallOverrides, + PopulatedTransaction, +} from '@ethersproject/contracts' +import type { + OnEvent, + PromiseOrValue, + TypedEvent, + TypedEventFilter, + TypedListener, +} from './common' + +export interface TLDPublicSuffixListInterface extends Interface { + functions: { + 'isPublicSuffix(bytes)': FunctionFragment + } + + getFunction(nameOrSignatureOrTopic: 'isPublicSuffix'): FunctionFragment + + encodeFunctionData( + functionFragment: 'isPublicSuffix', + values: [PromiseOrValue], + ): string + + decodeFunctionResult( + functionFragment: 'isPublicSuffix', + data: BytesLike, + ): Result + + events: {} +} + +export interface TLDPublicSuffixList extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this + attach(addressOrName: string): this + deployed(): Promise + + interface: TLDPublicSuffixListInterface + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise> + + listeners( + eventFilter?: TypedEventFilter, + ): Array> + listeners(eventName?: string): Array + removeAllListeners( + eventFilter: TypedEventFilter, + ): this + removeAllListeners(eventName?: string): this + off: OnEvent + on: OnEvent + once: OnEvent + removeListener: OnEvent + + functions: { + isPublicSuffix( + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + } + + isPublicSuffix( + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + callStatic: { + isPublicSuffix( + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + filters: {} + + estimateGas: { + isPublicSuffix( + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + populateTransaction: { + isPublicSuffix( + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/UniversalResolver.ts b/.yalc/@ensdomains/ensjs/src/generated/UniversalResolver.ts new file mode 100644 index 000000000..2b3a45367 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/UniversalResolver.ts @@ -0,0 +1,767 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { + EventFragment, + FunctionFragment, + Result, +} from '@ethersproject/abi' +import { Interface } from '@ethersproject/abi' +import type { Listener, Provider } from '@ethersproject/abstract-provider' +import type { Signer } from '@ethersproject/abstract-signer' +import type { BigNumber, BigNumberish } from '@ethersproject/bignumber' +import type { BytesLike } from '@ethersproject/bytes' +import type { + BaseContract, + CallOverrides, + ContractTransaction, + Overrides, + PopulatedTransaction, +} from '@ethersproject/contracts' +import type { + OnEvent, + PromiseOrValue, + TypedEvent, + TypedEventFilter, + TypedListener, +} from './common' + +export interface UniversalResolverInterface extends Interface { + functions: { + '_resolveSingle(bytes,bytes,string[],bytes4,bytes)': FunctionFragment + 'batchGatewayURLs(uint256)': FunctionFragment + 'findResolver(bytes)': FunctionFragment + 'owner()': FunctionFragment + 'registry()': FunctionFragment + 'renounceOwnership()': FunctionFragment + 'resolve(bytes,bytes,string[])': FunctionFragment + 'resolve(bytes,bytes[])': FunctionFragment + 'resolve(bytes,bytes[],string[])': FunctionFragment + 'resolve(bytes,bytes)': FunctionFragment + 'resolveCallback(bytes,bytes)': FunctionFragment + 'resolveSingleCallback(bytes,bytes)': FunctionFragment + 'reverse(bytes,string[])': FunctionFragment + 'reverse(bytes)': FunctionFragment + 'reverseCallback(bytes,bytes)': FunctionFragment + 'setGatewayURLs(string[])': FunctionFragment + 'supportsInterface(bytes4)': FunctionFragment + 'transferOwnership(address)': FunctionFragment + } + + getFunction( + nameOrSignatureOrTopic: + | '_resolveSingle' + | 'batchGatewayURLs' + | 'findResolver' + | 'owner' + | 'registry' + | 'renounceOwnership' + | 'resolve(bytes,bytes,string[])' + | 'resolve(bytes,bytes[])' + | 'resolve(bytes,bytes[],string[])' + | 'resolve(bytes,bytes)' + | 'resolveCallback' + | 'resolveSingleCallback' + | 'reverse(bytes,string[])' + | 'reverse(bytes)' + | 'reverseCallback' + | 'setGatewayURLs' + | 'supportsInterface' + | 'transferOwnership', + ): FunctionFragment + + encodeFunctionData( + functionFragment: '_resolveSingle', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue[], + PromiseOrValue, + PromiseOrValue, + ], + ): string + encodeFunctionData( + functionFragment: 'batchGatewayURLs', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'findResolver', + values: [PromiseOrValue], + ): string + encodeFunctionData(functionFragment: 'owner', values?: undefined): string + encodeFunctionData(functionFragment: 'registry', values?: undefined): string + encodeFunctionData( + functionFragment: 'renounceOwnership', + values?: undefined, + ): string + encodeFunctionData( + functionFragment: 'resolve(bytes,bytes,string[])', + values: [ + PromiseOrValue, + PromiseOrValue, + PromiseOrValue[], + ], + ): string + encodeFunctionData( + functionFragment: 'resolve(bytes,bytes[])', + values: [PromiseOrValue, PromiseOrValue[]], + ): string + encodeFunctionData( + functionFragment: 'resolve(bytes,bytes[],string[])', + values: [ + PromiseOrValue, + PromiseOrValue[], + PromiseOrValue[], + ], + ): string + encodeFunctionData( + functionFragment: 'resolve(bytes,bytes)', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'resolveCallback', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'resolveSingleCallback', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'reverse(bytes,string[])', + values: [PromiseOrValue, PromiseOrValue[]], + ): string + encodeFunctionData( + functionFragment: 'reverse(bytes)', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'reverseCallback', + values: [PromiseOrValue, PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'setGatewayURLs', + values: [PromiseOrValue[]], + ): string + encodeFunctionData( + functionFragment: 'supportsInterface', + values: [PromiseOrValue], + ): string + encodeFunctionData( + functionFragment: 'transferOwnership', + values: [PromiseOrValue], + ): string + + decodeFunctionResult( + functionFragment: '_resolveSingle', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'batchGatewayURLs', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'findResolver', + data: BytesLike, + ): Result + decodeFunctionResult(functionFragment: 'owner', data: BytesLike): Result + decodeFunctionResult(functionFragment: 'registry', data: BytesLike): Result + decodeFunctionResult( + functionFragment: 'renounceOwnership', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'resolve(bytes,bytes,string[])', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'resolve(bytes,bytes[])', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'resolve(bytes,bytes[],string[])', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'resolve(bytes,bytes)', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'resolveCallback', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'resolveSingleCallback', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'reverse(bytes,string[])', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'reverse(bytes)', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'reverseCallback', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'setGatewayURLs', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'supportsInterface', + data: BytesLike, + ): Result + decodeFunctionResult( + functionFragment: 'transferOwnership', + data: BytesLike, + ): Result + + events: { + 'OwnershipTransferred(address,address)': EventFragment + } + + getEvent(nameOrSignatureOrTopic: 'OwnershipTransferred'): EventFragment +} + +export interface OwnershipTransferredEventObject { + previousOwner: string + newOwner: string +} +export type OwnershipTransferredEvent = TypedEvent< + [string, string], + OwnershipTransferredEventObject +> + +export type OwnershipTransferredEventFilter = + TypedEventFilter + +export interface UniversalResolver extends BaseContract { + connect(signerOrProvider: Signer | Provider | string): this + attach(addressOrName: string): this + deployed(): Promise + + interface: UniversalResolverInterface + + queryFilter( + event: TypedEventFilter, + fromBlockOrBlockhash?: string | number | undefined, + toBlock?: string | number | undefined, + ): Promise> + + listeners( + eventFilter?: TypedEventFilter, + ): Array> + listeners(eventName?: string): Array + removeAllListeners( + eventFilter: TypedEventFilter, + ): this + removeAllListeners(eventName?: string): this + off: OnEvent + on: OnEvent + once: OnEvent + removeListener: OnEvent + + functions: { + _resolveSingle( + name: PromiseOrValue, + data: PromiseOrValue, + gateways: PromiseOrValue[], + callbackFunction: PromiseOrValue, + metaData: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string, string]> + + batchGatewayURLs( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string]> + + findResolver( + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string, string]> + + owner(overrides?: CallOverrides): Promise<[string]> + + registry(overrides?: CallOverrides): Promise<[string]> + + renounceOwnership( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + 'resolve(bytes,bytes,string[])'( + name: PromiseOrValue, + data: PromiseOrValue, + gateways: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise<[string, string]> + + 'resolve(bytes,bytes[])'( + name: PromiseOrValue, + data: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise<[string[], string]> + + 'resolve(bytes,bytes[],string[])'( + name: PromiseOrValue, + data: PromiseOrValue[], + gateways: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise<[string[], string]> + + 'resolve(bytes,bytes)'( + name: PromiseOrValue, + data: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string, string]> + + resolveCallback( + response: PromiseOrValue, + extraData: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string[], string]> + + resolveSingleCallback( + response: PromiseOrValue, + extraData: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string, string]> + + 'reverse(bytes,string[])'( + reverseName: PromiseOrValue, + gateways: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise<[string, string, string, string]> + + 'reverse(bytes)'( + reverseName: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string, string, string, string]> + + reverseCallback( + response: PromiseOrValue, + extraData: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string, string, string, string]> + + setGatewayURLs( + _urls: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + supportsInterface( + interfaceId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[boolean]> + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + } + + _resolveSingle( + name: PromiseOrValue, + data: PromiseOrValue, + gateways: PromiseOrValue[], + callbackFunction: PromiseOrValue, + metaData: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string, string]> + + batchGatewayURLs( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + findResolver( + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string, string]> + + owner(overrides?: CallOverrides): Promise + + registry(overrides?: CallOverrides): Promise + + renounceOwnership( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + 'resolve(bytes,bytes,string[])'( + name: PromiseOrValue, + data: PromiseOrValue, + gateways: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise<[string, string]> + + 'resolve(bytes,bytes[])'( + name: PromiseOrValue, + data: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise<[string[], string]> + + 'resolve(bytes,bytes[],string[])'( + name: PromiseOrValue, + data: PromiseOrValue[], + gateways: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise<[string[], string]> + + 'resolve(bytes,bytes)'( + name: PromiseOrValue, + data: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string, string]> + + resolveCallback( + response: PromiseOrValue, + extraData: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string[], string]> + + resolveSingleCallback( + response: PromiseOrValue, + extraData: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string, string]> + + 'reverse(bytes,string[])'( + reverseName: PromiseOrValue, + gateways: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise<[string, string, string, string]> + + 'reverse(bytes)'( + reverseName: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string, string, string, string]> + + reverseCallback( + response: PromiseOrValue, + extraData: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string, string, string, string]> + + setGatewayURLs( + _urls: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + supportsInterface( + interfaceId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + callStatic: { + _resolveSingle( + name: PromiseOrValue, + data: PromiseOrValue, + gateways: PromiseOrValue[], + callbackFunction: PromiseOrValue, + metaData: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string, string]> + + batchGatewayURLs( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + findResolver( + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string, string]> + + owner(overrides?: CallOverrides): Promise + + registry(overrides?: CallOverrides): Promise + + renounceOwnership(overrides?: CallOverrides): Promise + + 'resolve(bytes,bytes,string[])'( + name: PromiseOrValue, + data: PromiseOrValue, + gateways: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise<[string, string]> + + 'resolve(bytes,bytes[])'( + name: PromiseOrValue, + data: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise<[string[], string]> + + 'resolve(bytes,bytes[],string[])'( + name: PromiseOrValue, + data: PromiseOrValue[], + gateways: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise<[string[], string]> + + 'resolve(bytes,bytes)'( + name: PromiseOrValue, + data: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string, string]> + + resolveCallback( + response: PromiseOrValue, + extraData: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string[], string]> + + resolveSingleCallback( + response: PromiseOrValue, + extraData: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string, string]> + + 'reverse(bytes,string[])'( + reverseName: PromiseOrValue, + gateways: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise<[string, string, string, string]> + + 'reverse(bytes)'( + reverseName: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string, string, string, string]> + + reverseCallback( + response: PromiseOrValue, + extraData: PromiseOrValue, + overrides?: CallOverrides, + ): Promise<[string, string, string, string]> + + setGatewayURLs( + _urls: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise + + supportsInterface( + interfaceId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + } + + filters: { + 'OwnershipTransferred(address,address)'( + previousOwner?: PromiseOrValue | null, + newOwner?: PromiseOrValue | null, + ): OwnershipTransferredEventFilter + OwnershipTransferred( + previousOwner?: PromiseOrValue | null, + newOwner?: PromiseOrValue | null, + ): OwnershipTransferredEventFilter + } + + estimateGas: { + _resolveSingle( + name: PromiseOrValue, + data: PromiseOrValue, + gateways: PromiseOrValue[], + callbackFunction: PromiseOrValue, + metaData: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + batchGatewayURLs( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + findResolver( + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + owner(overrides?: CallOverrides): Promise + + registry(overrides?: CallOverrides): Promise + + renounceOwnership( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + 'resolve(bytes,bytes,string[])'( + name: PromiseOrValue, + data: PromiseOrValue, + gateways: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise + + 'resolve(bytes,bytes[])'( + name: PromiseOrValue, + data: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise + + 'resolve(bytes,bytes[],string[])'( + name: PromiseOrValue, + data: PromiseOrValue[], + gateways: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise + + 'resolve(bytes,bytes)'( + name: PromiseOrValue, + data: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + resolveCallback( + response: PromiseOrValue, + extraData: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + resolveSingleCallback( + response: PromiseOrValue, + extraData: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + 'reverse(bytes,string[])'( + reverseName: PromiseOrValue, + gateways: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise + + 'reverse(bytes)'( + reverseName: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + reverseCallback( + response: PromiseOrValue, + extraData: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setGatewayURLs( + _urls: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + supportsInterface( + interfaceId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + } + + populateTransaction: { + _resolveSingle( + name: PromiseOrValue, + data: PromiseOrValue, + gateways: PromiseOrValue[], + callbackFunction: PromiseOrValue, + metaData: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + batchGatewayURLs( + arg0: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + findResolver( + name: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + owner(overrides?: CallOverrides): Promise + + registry(overrides?: CallOverrides): Promise + + renounceOwnership( + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + 'resolve(bytes,bytes,string[])'( + name: PromiseOrValue, + data: PromiseOrValue, + gateways: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise + + 'resolve(bytes,bytes[])'( + name: PromiseOrValue, + data: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise + + 'resolve(bytes,bytes[],string[])'( + name: PromiseOrValue, + data: PromiseOrValue[], + gateways: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise + + 'resolve(bytes,bytes)'( + name: PromiseOrValue, + data: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + resolveCallback( + response: PromiseOrValue, + extraData: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + resolveSingleCallback( + response: PromiseOrValue, + extraData: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + 'reverse(bytes,string[])'( + reverseName: PromiseOrValue, + gateways: PromiseOrValue[], + overrides?: CallOverrides, + ): Promise + + 'reverse(bytes)'( + reverseName: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + reverseCallback( + response: PromiseOrValue, + extraData: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + setGatewayURLs( + _urls: PromiseOrValue[], + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + + supportsInterface( + interfaceId: PromiseOrValue, + overrides?: CallOverrides, + ): Promise + + transferOwnership( + newOwner: PromiseOrValue, + overrides?: Overrides & { from?: PromiseOrValue }, + ): Promise + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/common.ts b/.yalc/@ensdomains/ensjs/src/generated/common.ts new file mode 100644 index 000000000..d47a7a6b5 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/common.ts @@ -0,0 +1,46 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +import type { Event, EventFilter } from '@ethersproject/contracts' +import type { Listener } from '@ethersproject/providers' + +export interface TypedEvent< + TArgsArray extends Array = any, + TArgsObject = any, +> extends Event { + args: TArgsArray & TArgsObject +} + +export interface TypedEventFilter<_TEvent extends TypedEvent> + extends EventFilter {} + +export interface TypedListener { + (...listenerArg: [...__TypechainArgsArray, TEvent]): void +} + +type __TypechainArgsArray = T extends TypedEvent ? U : never + +export interface OnEvent { + ( + eventFilter: TypedEventFilter, + listener: TypedListener, + ): TRes + (eventName: string, listener: Listener): TRes +} + +export type MinEthersFactory = { + deploy(...a: ARGS[]): Promise +} + +export type GetContractTypeFromFactory = F extends MinEthersFactory< + infer C, + any +> + ? C + : never + +export type GetARGsTypeFromFactory = F extends MinEthersFactory + ? Parameters + : never + +export type PromiseOrValue = T | Promise diff --git a/.yalc/@ensdomains/ensjs/src/generated/factories/BaseRegistrarImplementation__factory.ts b/.yalc/@ensdomains/ensjs/src/generated/factories/BaseRegistrarImplementation__factory.ts new file mode 100644 index 000000000..6f3418d87 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/factories/BaseRegistrarImplementation__factory.ts @@ -0,0 +1,783 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Interface } from '@ethersproject/abi/lib/interface' +import { Signer } from '@ethersproject/abstract-signer' +import { Contract } from '@ethersproject/contracts' +import type { Provider } from '@ethersproject/providers' +import type { + BaseRegistrarImplementation, + BaseRegistrarImplementationInterface, +} from '../BaseRegistrarImplementation' + +const _abi = [ + { + inputs: [ + { + internalType: 'contract ENS', + name: '_ens', + type: 'address', + }, + { + internalType: 'bytes32', + name: '_baseNode', + type: 'bytes32', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'approved', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Approval', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'ApprovalForAll', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'controller', + type: 'address', + }, + ], + name: 'ControllerAdded', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'controller', + type: 'address', + }, + ], + name: 'ControllerRemoved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'expires', + type: 'uint256', + }, + ], + name: 'NameMigrated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'expires', + type: 'uint256', + }, + ], + name: 'NameRegistered', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'expires', + type: 'uint256', + }, + ], + name: 'NameRenewed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: true, + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + constant: true, + inputs: [], + name: 'GRACE_PERIOD', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'controller', + type: 'address', + }, + ], + name: 'addController', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'approve', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + ], + name: 'available', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'baseNode', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'controllers', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'ens', + outputs: [ + { + internalType: 'contract ENS', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'getApproved', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + ], + name: 'isApprovedForAll', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'isOwner', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + ], + name: 'nameExpires', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'ownerOf', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'reclaim', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'uint256', + name: 'duration', + type: 'uint256', + }, + ], + name: 'register', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'uint256', + name: 'duration', + type: 'uint256', + }, + ], + name: 'registerOnly', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'controller', + type: 'address', + }, + ], + name: 'removeController', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'duration', + type: 'uint256', + }, + ], + name: 'renew', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [], + name: 'renounceOwnership', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'safeTransferFrom', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: '_data', + type: 'bytes', + }, + ], + name: 'safeTransferFrom', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'setApprovalForAll', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'resolver', + type: 'address', + }, + ], + name: 'setResolver', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceID', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'transferFrom', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, +] + +export class BaseRegistrarImplementation__factory { + static readonly abi = _abi + static createInterface(): BaseRegistrarImplementationInterface { + return new Interface(_abi) as BaseRegistrarImplementationInterface + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): BaseRegistrarImplementation { + return new Contract( + address, + _abi, + signerOrProvider, + ) as BaseRegistrarImplementation + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/factories/BulkRenewal__factory.ts b/.yalc/@ensdomains/ensjs/src/generated/factories/BulkRenewal__factory.ts new file mode 100644 index 000000000..a1f4959b3 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/factories/BulkRenewal__factory.ts @@ -0,0 +1,110 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Interface } from '@ethersproject/abi/lib/interface' +import { Signer } from '@ethersproject/abstract-signer' +import { Contract } from '@ethersproject/contracts' +import type { Provider } from '@ethersproject/providers' +import type { BulkRenewal, BulkRenewalInterface } from '../BulkRenewal' + +const _abi = [ + { + inputs: [ + { + internalType: 'contract ENS', + name: '_ens', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [], + name: 'ens', + outputs: [ + { + internalType: 'contract ENS', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'string[]', + name: 'names', + type: 'string[]', + }, + { + internalType: 'uint256', + name: 'duration', + type: 'uint256', + }, + ], + name: 'renewAll', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'string[]', + name: 'names', + type: 'string[]', + }, + { + internalType: 'uint256', + name: 'duration', + type: 'uint256', + }, + ], + name: 'rentPrice', + outputs: [ + { + internalType: 'uint256', + name: 'total', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceID', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'pure', + type: 'function', + }, +] + +export class BulkRenewal__factory { + static readonly abi = _abi + static createInterface(): BulkRenewalInterface { + return new Interface(_abi) as BulkRenewalInterface + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): BulkRenewal { + return new Contract(address, _abi, signerOrProvider) as BulkRenewal + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/factories/DNSRegistrar__factory.ts b/.yalc/@ensdomains/ensjs/src/generated/factories/DNSRegistrar__factory.ts new file mode 100644 index 000000000..0a764b048 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/factories/DNSRegistrar__factory.ts @@ -0,0 +1,279 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Interface } from '@ethersproject/abi/lib/interface' +import { Signer } from '@ethersproject/abstract-signer' +import { Contract } from '@ethersproject/contracts' +import type { Provider } from '@ethersproject/providers' +import type { DNSRegistrar, DNSRegistrarInterface } from '../DNSRegistrar' + +const _abi = [ + { + inputs: [ + { + internalType: 'contract DNSSEC', + name: '_dnssec', + type: 'address', + }, + { + internalType: 'contract PublicSuffixList', + name: '_suffixes', + type: 'address', + }, + { + internalType: 'contract ENS', + name: '_ens', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: false, + internalType: 'bytes', + name: 'dnsname', + type: 'bytes', + }, + ], + name: 'Claim', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'oracle', + type: 'address', + }, + ], + name: 'NewOracle', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'suffixes', + type: 'address', + }, + ], + name: 'NewPublicSuffixList', + type: 'event', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'name', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'proof', + type: 'bytes', + }, + ], + name: 'claim', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'ens', + outputs: [ + { + internalType: 'contract ENS', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'oracle', + outputs: [ + { + internalType: 'contract DNSSEC', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'name', + type: 'bytes', + }, + { + components: [ + { + internalType: 'bytes', + name: 'rrset', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'sig', + type: 'bytes', + }, + ], + internalType: 'struct DNSSEC.RRSetWithSignature[]', + name: 'input', + type: 'tuple[]', + }, + { + internalType: 'bytes', + name: 'proof', + type: 'bytes', + }, + ], + name: 'proveAndClaim', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'name', + type: 'bytes', + }, + { + components: [ + { + internalType: 'bytes', + name: 'rrset', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'sig', + type: 'bytes', + }, + ], + internalType: 'struct DNSSEC.RRSetWithSignature[]', + name: 'input', + type: 'tuple[]', + }, + { + internalType: 'bytes', + name: 'proof', + type: 'bytes', + }, + { + internalType: 'address', + name: 'resolver', + type: 'address', + }, + { + internalType: 'address', + name: 'addr', + type: 'address', + }, + ], + name: 'proveAndClaimWithResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract DNSSEC', + name: '_dnssec', + type: 'address', + }, + ], + name: 'setOracle', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract PublicSuffixList', + name: '_suffixes', + type: 'address', + }, + ], + name: 'setPublicSuffixList', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'suffixes', + outputs: [ + { + internalType: 'contract PublicSuffixList', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceID', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'pure', + type: 'function', + }, +] + +export class DNSRegistrar__factory { + static readonly abi = _abi + static createInterface(): DNSRegistrarInterface { + return new Interface(_abi) as DNSRegistrarInterface + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): DNSRegistrar { + return new Contract(address, _abi, signerOrProvider) as DNSRegistrar + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/factories/DNSSECImpl__factory.ts b/.yalc/@ensdomains/ensjs/src/generated/factories/DNSSECImpl__factory.ts new file mode 100644 index 000000000..41a580bb4 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/factories/DNSSECImpl__factory.ts @@ -0,0 +1,484 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Interface } from '@ethersproject/abi/lib/interface' +import { Signer } from '@ethersproject/abstract-signer' +import { Contract } from '@ethersproject/contracts' +import type { Provider } from '@ethersproject/providers' +import type { DNSSECImpl, DNSSECImplInterface } from '../DNSSECImpl' + +const _abi = [ + { + inputs: [ + { + internalType: 'bytes', + name: '_anchors', + type: 'bytes', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint8', + name: 'id', + type: 'uint8', + }, + { + indexed: false, + internalType: 'address', + name: 'addr', + type: 'address', + }, + ], + name: 'AlgorithmUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint8', + name: 'id', + type: 'uint8', + }, + { + indexed: false, + internalType: 'address', + name: 'addr', + type: 'address', + }, + ], + name: 'DigestUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [], + name: 'Marker', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint8', + name: 'id', + type: 'uint8', + }, + { + indexed: false, + internalType: 'address', + name: 'addr', + type: 'address', + }, + ], + name: 'NSEC3DigestUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'bytes', + name: 'name', + type: 'bytes', + }, + { + indexed: false, + internalType: 'bytes', + name: 'rrset', + type: 'bytes', + }, + ], + name: 'RRSetUpdated', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'uint256', + name: 't', + type: 'uint256', + }, + ], + name: 'Test', + type: 'event', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '', + type: 'uint8', + }, + ], + name: 'algorithms', + outputs: [ + { + internalType: 'contract Algorithm', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'anchors', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint16', + name: 'deleteType', + type: 'uint16', + }, + { + internalType: 'bytes', + name: 'deleteName', + type: 'bytes', + }, + { + components: [ + { + internalType: 'bytes', + name: 'rrset', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'sig', + type: 'bytes', + }, + ], + internalType: 'struct DNSSEC.RRSetWithSignature', + name: 'nsec', + type: 'tuple', + }, + { + internalType: 'bytes', + name: 'proof', + type: 'bytes', + }, + ], + name: 'deleteRRSet', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint16', + name: 'deleteType', + type: 'uint16', + }, + { + internalType: 'bytes', + name: 'deleteName', + type: 'bytes', + }, + { + components: [ + { + internalType: 'bytes', + name: 'rrset', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'sig', + type: 'bytes', + }, + ], + internalType: 'struct DNSSEC.RRSetWithSignature', + name: 'closestEncloser', + type: 'tuple', + }, + { + components: [ + { + internalType: 'bytes', + name: 'rrset', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'sig', + type: 'bytes', + }, + ], + internalType: 'struct DNSSEC.RRSetWithSignature', + name: 'nextClosest', + type: 'tuple', + }, + { + internalType: 'bytes', + name: 'dnskey', + type: 'bytes', + }, + ], + name: 'deleteRRSetNSEC3', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '', + type: 'uint8', + }, + ], + name: 'digests', + outputs: [ + { + internalType: 'contract Digest', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint8', + name: '', + type: 'uint8', + }, + ], + name: 'nsec3Digests', + outputs: [ + { + internalType: 'contract NSEC3Digest', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint16', + name: 'dnstype', + type: 'uint16', + }, + { + internalType: 'bytes', + name: 'name', + type: 'bytes', + }, + ], + name: 'rrdata', + outputs: [ + { + internalType: 'uint32', + name: '', + type: 'uint32', + }, + { + internalType: 'uint32', + name: '', + type: 'uint32', + }, + { + internalType: 'bytes20', + name: '', + type: 'bytes20', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint8', + name: 'id', + type: 'uint8', + }, + { + internalType: 'contract Algorithm', + name: 'algo', + type: 'address', + }, + ], + name: 'setAlgorithm', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint8', + name: 'id', + type: 'uint8', + }, + { + internalType: 'contract Digest', + name: 'digest', + type: 'address', + }, + ], + name: 'setDigest', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint8', + name: 'id', + type: 'uint8', + }, + { + internalType: 'contract NSEC3Digest', + name: 'digest', + type: 'address', + }, + ], + name: 'setNSEC3Digest', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'setOwner', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'bytes', + name: 'rrset', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'sig', + type: 'bytes', + }, + ], + internalType: 'struct DNSSEC.RRSetWithSignature', + name: 'input', + type: 'tuple', + }, + { + internalType: 'bytes', + name: 'proof', + type: 'bytes', + }, + ], + name: 'submitRRSet', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'bytes', + name: 'rrset', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'sig', + type: 'bytes', + }, + ], + internalType: 'struct DNSSEC.RRSetWithSignature[]', + name: 'input', + type: 'tuple[]', + }, + { + internalType: 'bytes', + name: '_proof', + type: 'bytes', + }, + ], + name: 'submitRRSets', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, +] + +export class DNSSECImpl__factory { + static readonly abi = _abi + static createInterface(): DNSSECImplInterface { + return new Interface(_abi) as DNSSECImplInterface + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): DNSSECImpl { + return new Contract(address, _abi, signerOrProvider) as DNSSECImpl + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/factories/DefaultReverseResolver__factory.ts b/.yalc/@ensdomains/ensjs/src/generated/factories/DefaultReverseResolver__factory.ts new file mode 100644 index 000000000..e02cfc01f --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/factories/DefaultReverseResolver__factory.ts @@ -0,0 +1,100 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Interface } from '@ethersproject/abi/lib/interface' +import { Signer } from '@ethersproject/abstract-signer' +import { Contract } from '@ethersproject/contracts' +import type { Provider } from '@ethersproject/providers' +import type { + DefaultReverseResolver, + DefaultReverseResolverInterface, +} from '../DefaultReverseResolver' + +const _abi = [ + { + inputs: [ + { + internalType: 'contract ENS', + name: 'ensAddr', + type: 'address', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + constant: true, + inputs: [], + name: 'ens', + outputs: [ + { + internalType: 'contract ENS', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'string', + name: '_name', + type: 'string', + }, + ], + name: 'setName', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, +] + +export class DefaultReverseResolver__factory { + static readonly abi = _abi + static createInterface(): DefaultReverseResolverInterface { + return new Interface(_abi) as DefaultReverseResolverInterface + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): DefaultReverseResolver { + return new Contract( + address, + _abi, + signerOrProvider, + ) as DefaultReverseResolver + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/factories/ENSRegistry__factory.ts b/.yalc/@ensdomains/ensjs/src/generated/factories/ENSRegistry__factory.ts new file mode 100644 index 000000000..096159e3e --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/factories/ENSRegistry__factory.ts @@ -0,0 +1,445 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Interface } from '@ethersproject/abi/lib/interface' +import { Signer } from '@ethersproject/abstract-signer' +import { Contract } from '@ethersproject/contracts' +import type { Provider } from '@ethersproject/providers' +import type { ENSRegistry, ENSRegistryInterface } from '../ENSRegistry' + +const _abi = [ + { + inputs: [ + { + internalType: 'contract ENS', + name: '_old', + type: 'address', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'ApprovalForAll', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'label', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'NewOwner', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'address', + name: 'resolver', + type: 'address', + }, + ], + name: 'NewResolver', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'uint64', + name: 'ttl', + type: 'uint64', + }, + ], + name: 'NewTTL', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'Transfer', + type: 'event', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + ], + name: 'isApprovedForAll', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'old', + outputs: [ + { + internalType: 'contract ENS', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + ], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + ], + name: 'recordExists', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + ], + name: 'resolver', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'setApprovalForAll', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'setOwner', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'resolver', + type: 'address', + }, + { + internalType: 'uint64', + name: 'ttl', + type: 'uint64', + }, + ], + name: 'setRecord', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'resolver', + type: 'address', + }, + ], + name: 'setResolver', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'label', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'setSubnodeOwner', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'label', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'resolver', + type: 'address', + }, + { + internalType: 'uint64', + name: 'ttl', + type: 'uint64', + }, + ], + name: 'setSubnodeRecord', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'uint64', + name: 'ttl', + type: 'uint64', + }, + ], + name: 'setTTL', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + ], + name: 'ttl', + outputs: [ + { + internalType: 'uint64', + name: '', + type: 'uint64', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, +] + +export class ENSRegistry__factory { + static readonly abi = _abi + static createInterface(): ENSRegistryInterface { + return new Interface(_abi) as ENSRegistryInterface + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): ENSRegistry { + return new Contract(address, _abi, signerOrProvider) as ENSRegistry + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/factories/ETHRegistrarController__factory.ts b/.yalc/@ensdomains/ensjs/src/generated/factories/ETHRegistrarController__factory.ts new file mode 100644 index 000000000..a66aa03ce --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/factories/ETHRegistrarController__factory.ts @@ -0,0 +1,622 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Interface } from '@ethersproject/abi/lib/interface' +import { Signer } from '@ethersproject/abstract-signer' +import { Contract } from '@ethersproject/contracts' +import type { Provider } from '@ethersproject/providers' +import type { + ETHRegistrarController, + ETHRegistrarControllerInterface, +} from '../ETHRegistrarController' + +const _abi = [ + { + inputs: [ + { + internalType: 'contract BaseRegistrarImplementation', + name: '_base', + type: 'address', + }, + { + internalType: 'contract IPriceOracle', + name: '_prices', + type: 'address', + }, + { + internalType: 'uint256', + name: '_minCommitmentAge', + type: 'uint256', + }, + { + internalType: 'uint256', + name: '_maxCommitmentAge', + type: 'uint256', + }, + { + internalType: 'contract ReverseRegistrar', + name: '_reverseRegistrar', + type: 'address', + }, + { + internalType: 'contract INameWrapper', + name: '_nameWrapper', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'commitment', + type: 'bytes32', + }, + ], + name: 'CommitmentTooNew', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'commitment', + type: 'bytes32', + }, + ], + name: 'CommitmentTooOld', + type: 'error', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'duration', + type: 'uint256', + }, + ], + name: 'DurationTooShort', + type: 'error', + }, + { + inputs: [], + name: 'InsufficientValue', + type: 'error', + }, + { + inputs: [], + name: 'MaxCommitmentAgeTooHigh', + type: 'error', + }, + { + inputs: [], + name: 'MaxCommitmentAgeTooLow', + type: 'error', + }, + { + inputs: [ + { + internalType: 'string', + name: 'name', + type: 'string', + }, + ], + name: 'NameNotAvailable', + type: 'error', + }, + { + inputs: [], + name: 'ResolverRequiredWhenDataSupplied', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'commitment', + type: 'bytes32', + }, + ], + name: 'UnexpiredCommitmentExists', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'string', + name: 'name', + type: 'string', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'label', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'baseCost', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'premium', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'expires', + type: 'uint256', + }, + ], + name: 'NameRegistered', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'string', + name: 'name', + type: 'string', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'label', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'uint256', + name: 'cost', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'expires', + type: 'uint256', + }, + ], + name: 'NameRenewed', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [], + name: 'MIN_REGISTRATION_DURATION', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'string', + name: 'name', + type: 'string', + }, + ], + name: 'available', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'commitment', + type: 'bytes32', + }, + ], + name: 'commit', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + name: 'commitments', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'uint256', + name: 'duration', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'secret', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'resolver', + type: 'address', + }, + { + internalType: 'bytes[]', + name: 'data', + type: 'bytes[]', + }, + { + internalType: 'bool', + name: 'reverseRecord', + type: 'bool', + }, + { + internalType: 'uint16', + name: 'ownerControlledFuses', + type: 'uint16', + }, + ], + name: 'makeCommitment', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [], + name: 'maxCommitmentAge', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'minCommitmentAge', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'nameWrapper', + outputs: [ + { + internalType: 'contract INameWrapper', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'prices', + outputs: [ + { + internalType: 'contract IPriceOracle', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_token', + type: 'address', + }, + { + internalType: 'address', + name: '_to', + type: 'address', + }, + { + internalType: 'uint256', + name: '_amount', + type: 'uint256', + }, + ], + name: 'recoverFunds', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'uint256', + name: 'duration', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'secret', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'resolver', + type: 'address', + }, + { + internalType: 'bytes[]', + name: 'data', + type: 'bytes[]', + }, + { + internalType: 'bool', + name: 'reverseRecord', + type: 'bool', + }, + { + internalType: 'uint16', + name: 'ownerControlledFuses', + type: 'uint16', + }, + ], + name: 'register', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'uint256', + name: 'duration', + type: 'uint256', + }, + ], + name: 'renew', + outputs: [], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'string', + name: 'name', + type: 'string', + }, + { + internalType: 'uint256', + name: 'duration', + type: 'uint256', + }, + ], + name: 'rentPrice', + outputs: [ + { + components: [ + { + internalType: 'uint256', + name: 'base', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'premium', + type: 'uint256', + }, + ], + internalType: 'struct IPriceOracle.Price', + name: 'price', + type: 'tuple', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'reverseRegistrar', + outputs: [ + { + internalType: 'contract ReverseRegistrar', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceID', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'string', + name: 'name', + type: 'string', + }, + ], + name: 'valid', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [], + name: 'withdraw', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, +] + +export class ETHRegistrarController__factory { + static readonly abi = _abi + static createInterface(): ETHRegistrarControllerInterface { + return new Interface(_abi) as ETHRegistrarControllerInterface + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): ETHRegistrarController { + return new Contract( + address, + _abi, + signerOrProvider, + ) as ETHRegistrarController + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/factories/Multicall__factory.ts b/.yalc/@ensdomains/ensjs/src/generated/factories/Multicall__factory.ts new file mode 100644 index 000000000..0c44bdc8c --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/factories/Multicall__factory.ts @@ -0,0 +1,463 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Interface } from '@ethersproject/abi/lib/interface' +import { Signer } from '@ethersproject/abstract-signer' +import { Contract } from '@ethersproject/contracts' +import type { Provider } from '@ethersproject/providers' +import type { Multicall, MulticallInterface } from '../Multicall' + +const _abi = [ + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'target', + type: 'address', + }, + { + internalType: 'bytes', + name: 'callData', + type: 'bytes', + }, + ], + internalType: 'struct Multicall3.Call[]', + name: 'calls', + type: 'tuple[]', + }, + ], + name: 'aggregate', + outputs: [ + { + internalType: 'uint256', + name: 'blockNumber', + type: 'uint256', + }, + { + internalType: 'bytes[]', + name: 'returnData', + type: 'bytes[]', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'target', + type: 'address', + }, + { + internalType: 'bool', + name: 'allowFailure', + type: 'bool', + }, + { + internalType: 'bytes', + name: 'callData', + type: 'bytes', + }, + ], + internalType: 'struct Multicall3.Call3[]', + name: 'calls', + type: 'tuple[]', + }, + ], + name: 'aggregate3', + outputs: [ + { + components: [ + { + internalType: 'bool', + name: 'success', + type: 'bool', + }, + { + internalType: 'bytes', + name: 'returnData', + type: 'bytes', + }, + ], + internalType: 'struct Multicall3.Result[]', + name: 'returnData', + type: 'tuple[]', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'target', + type: 'address', + }, + { + internalType: 'bool', + name: 'allowFailure', + type: 'bool', + }, + { + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'callData', + type: 'bytes', + }, + ], + internalType: 'struct Multicall3.Call3Value[]', + name: 'calls', + type: 'tuple[]', + }, + ], + name: 'aggregate3Value', + outputs: [ + { + components: [ + { + internalType: 'bool', + name: 'success', + type: 'bool', + }, + { + internalType: 'bytes', + name: 'returnData', + type: 'bytes', + }, + ], + internalType: 'struct Multicall3.Result[]', + name: 'returnData', + type: 'tuple[]', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + components: [ + { + internalType: 'address', + name: 'target', + type: 'address', + }, + { + internalType: 'bytes', + name: 'callData', + type: 'bytes', + }, + ], + internalType: 'struct Multicall3.Call[]', + name: 'calls', + type: 'tuple[]', + }, + ], + name: 'blockAndAggregate', + outputs: [ + { + internalType: 'uint256', + name: 'blockNumber', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'blockHash', + type: 'bytes32', + }, + { + components: [ + { + internalType: 'bool', + name: 'success', + type: 'bool', + }, + { + internalType: 'bytes', + name: 'returnData', + type: 'bytes', + }, + ], + internalType: 'struct Multicall3.Result[]', + name: 'returnData', + type: 'tuple[]', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [], + name: 'getBasefee', + outputs: [ + { + internalType: 'uint256', + name: 'basefee', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'blockNumber', + type: 'uint256', + }, + ], + name: 'getBlockHash', + outputs: [ + { + internalType: 'bytes32', + name: 'blockHash', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getBlockNumber', + outputs: [ + { + internalType: 'uint256', + name: 'blockNumber', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getChainId', + outputs: [ + { + internalType: 'uint256', + name: 'chainid', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getCurrentBlockCoinbase', + outputs: [ + { + internalType: 'address', + name: 'coinbase', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getCurrentBlockDifficulty', + outputs: [ + { + internalType: 'uint256', + name: 'difficulty', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getCurrentBlockGasLimit', + outputs: [ + { + internalType: 'uint256', + name: 'gaslimit', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getCurrentBlockTimestamp', + outputs: [ + { + internalType: 'uint256', + name: 'timestamp', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'addr', + type: 'address', + }, + ], + name: 'getEthBalance', + outputs: [ + { + internalType: 'uint256', + name: 'balance', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'getLastBlockHash', + outputs: [ + { + internalType: 'bytes32', + name: 'blockHash', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bool', + name: 'requireSuccess', + type: 'bool', + }, + { + components: [ + { + internalType: 'address', + name: 'target', + type: 'address', + }, + { + internalType: 'bytes', + name: 'callData', + type: 'bytes', + }, + ], + internalType: 'struct Multicall3.Call[]', + name: 'calls', + type: 'tuple[]', + }, + ], + name: 'tryAggregate', + outputs: [ + { + components: [ + { + internalType: 'bool', + name: 'success', + type: 'bool', + }, + { + internalType: 'bytes', + name: 'returnData', + type: 'bytes', + }, + ], + internalType: 'struct Multicall3.Result[]', + name: 'returnData', + type: 'tuple[]', + }, + ], + stateMutability: 'payable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bool', + name: 'requireSuccess', + type: 'bool', + }, + { + components: [ + { + internalType: 'address', + name: 'target', + type: 'address', + }, + { + internalType: 'bytes', + name: 'callData', + type: 'bytes', + }, + ], + internalType: 'struct Multicall3.Call[]', + name: 'calls', + type: 'tuple[]', + }, + ], + name: 'tryBlockAndAggregate', + outputs: [ + { + internalType: 'uint256', + name: 'blockNumber', + type: 'uint256', + }, + { + internalType: 'bytes32', + name: 'blockHash', + type: 'bytes32', + }, + { + components: [ + { + internalType: 'bool', + name: 'success', + type: 'bool', + }, + { + internalType: 'bytes', + name: 'returnData', + type: 'bytes', + }, + ], + internalType: 'struct Multicall3.Result[]', + name: 'returnData', + type: 'tuple[]', + }, + ], + stateMutability: 'payable', + type: 'function', + }, +] + +export class Multicall__factory { + static readonly abi = _abi + static createInterface(): MulticallInterface { + return new Interface(_abi) as MulticallInterface + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): Multicall { + return new Contract(address, _abi, signerOrProvider) as Multicall + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/factories/NameWrapper__factory.ts b/.yalc/@ensdomains/ensjs/src/generated/factories/NameWrapper__factory.ts new file mode 100644 index 000000000..b4b3d3dd1 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/factories/NameWrapper__factory.ts @@ -0,0 +1,1395 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Interface } from '@ethersproject/abi/lib/interface' +import { Signer } from '@ethersproject/abstract-signer' +import { Contract } from '@ethersproject/contracts' +import type { Provider } from '@ethersproject/providers' +import type { NameWrapper, NameWrapperInterface } from '../NameWrapper' + +const _abi = [ + { + inputs: [ + { + internalType: 'contract ENS', + name: '_ens', + type: 'address', + }, + { + internalType: 'contract IBaseRegistrar', + name: '_registrar', + type: 'address', + }, + { + internalType: 'contract IMetadataService', + name: '_metadataService', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [], + name: 'CannotUpgrade', + type: 'error', + }, + { + inputs: [], + name: 'IncompatibleParent', + type: 'error', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'IncorrectTargetOwner', + type: 'error', + }, + { + inputs: [], + name: 'IncorrectTokenType', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'labelHash', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'expectedLabelhash', + type: 'bytes32', + }, + ], + name: 'LabelMismatch', + type: 'error', + }, + { + inputs: [ + { + internalType: 'string', + name: 'label', + type: 'string', + }, + ], + name: 'LabelTooLong', + type: 'error', + }, + { + inputs: [], + name: 'LabelTooShort', + type: 'error', + }, + { + inputs: [], + name: 'NameIsNotWrapped', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + ], + name: 'OperationProhibited', + type: 'error', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'addr', + type: 'address', + }, + ], + name: 'Unauthorised', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'account', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'ApprovalForAll', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'controller', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'active', + type: 'bool', + }, + ], + name: 'ControllerChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'uint64', + name: 'expiry', + type: 'uint64', + }, + ], + name: 'ExpiryExtended', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'uint32', + name: 'fuses', + type: 'uint32', + }, + ], + name: 'FusesSet', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'NameUnwrapped', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'bytes', + name: 'name', + type: 'bytes', + }, + { + indexed: false, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: false, + internalType: 'uint32', + name: 'fuses', + type: 'uint32', + }, + { + indexed: false, + internalType: 'uint64', + name: 'expiry', + type: 'uint64', + }, + ], + name: 'NameWrapped', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'ids', + type: 'uint256[]', + }, + { + indexed: false, + internalType: 'uint256[]', + name: 'values', + type: 'uint256[]', + }, + ], + name: 'TransferBatch', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'from', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'to', + type: 'address', + }, + { + indexed: false, + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + indexed: false, + internalType: 'uint256', + name: 'value', + type: 'uint256', + }, + ], + name: 'TransferSingle', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'string', + name: 'value', + type: 'string', + }, + { + indexed: true, + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + ], + name: 'URI', + type: 'event', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: '_tokens', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'uint32', + name: 'fuseMask', + type: 'uint32', + }, + ], + name: 'allFusesBurned', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + ], + name: 'balanceOf', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address[]', + name: 'accounts', + type: 'address[]', + }, + { + internalType: 'uint256[]', + name: 'ids', + type: 'uint256[]', + }, + ], + name: 'balanceOfBatch', + outputs: [ + { + internalType: 'uint256[]', + name: '', + type: 'uint256[]', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'addr', + type: 'address', + }, + ], + name: 'canModifyName', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'controllers', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'ens', + outputs: [ + { + internalType: 'contract ENS', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'parentNode', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'labelhash', + type: 'bytes32', + }, + { + internalType: 'uint64', + name: 'expiry', + type: 'uint64', + }, + ], + name: 'extendExpiry', + outputs: [ + { + internalType: 'uint64', + name: '', + type: 'uint64', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + ], + name: 'getData', + outputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'uint32', + name: 'fuses', + type: 'uint32', + }, + { + internalType: 'uint64', + name: 'expiry', + type: 'uint64', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + ], + name: 'isApprovedForAll', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + ], + name: 'isWrapped', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'metadataService', + outputs: [ + { + internalType: 'contract IMetadataService', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + name: 'names', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'onERC721Received', + outputs: [ + { + internalType: 'bytes4', + name: '', + type: 'bytes4', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + ], + name: 'ownerOf', + outputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '_token', + type: 'address', + }, + { + internalType: 'address', + name: '_to', + type: 'address', + }, + { + internalType: 'uint256', + name: '_amount', + type: 'uint256', + }, + ], + name: 'recoverFunds', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'string', + name: 'label', + type: 'string', + }, + { + internalType: 'address', + name: 'wrappedOwner', + type: 'address', + }, + { + internalType: 'uint256', + name: 'duration', + type: 'uint256', + }, + { + internalType: 'address', + name: 'resolver', + type: 'address', + }, + { + internalType: 'uint16', + name: 'ownerControlledFuses', + type: 'uint16', + }, + ], + name: 'registerAndWrapETH2LD', + outputs: [ + { + internalType: 'uint256', + name: 'registrarExpiry', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'registrar', + outputs: [ + { + internalType: 'contract IBaseRegistrar', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'duration', + type: 'uint256', + }, + ], + name: 'renew', + outputs: [ + { + internalType: 'uint256', + name: 'expires', + type: 'uint256', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256[]', + name: 'ids', + type: 'uint256[]', + }, + { + internalType: 'uint256[]', + name: 'amounts', + type: 'uint256[]', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'safeBatchTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'from', + type: 'address', + }, + { + internalType: 'address', + name: 'to', + type: 'address', + }, + { + internalType: 'uint256', + name: 'id', + type: 'uint256', + }, + { + internalType: 'uint256', + name: 'amount', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'safeTransferFrom', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'setApprovalForAll', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'parentNode', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'labelhash', + type: 'bytes32', + }, + { + internalType: 'uint32', + name: 'fuses', + type: 'uint32', + }, + { + internalType: 'uint64', + name: 'expiry', + type: 'uint64', + }, + ], + name: 'setChildFuses', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'controller', + type: 'address', + }, + { + internalType: 'bool', + name: 'active', + type: 'bool', + }, + ], + name: 'setController', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'uint16', + name: 'ownerControlledFuses', + type: 'uint16', + }, + ], + name: 'setFuses', + outputs: [ + { + internalType: 'uint32', + name: '', + type: 'uint32', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract IMetadataService', + name: '_metadataService', + type: 'address', + }, + ], + name: 'setMetadataService', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'resolver', + type: 'address', + }, + { + internalType: 'uint64', + name: 'ttl', + type: 'uint64', + }, + ], + name: 'setRecord', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'resolver', + type: 'address', + }, + ], + name: 'setResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'parentNode', + type: 'bytes32', + }, + { + internalType: 'string', + name: 'label', + type: 'string', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'uint32', + name: 'fuses', + type: 'uint32', + }, + { + internalType: 'uint64', + name: 'expiry', + type: 'uint64', + }, + ], + name: 'setSubnodeOwner', + outputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'parentNode', + type: 'bytes32', + }, + { + internalType: 'string', + name: 'label', + type: 'string', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'resolver', + type: 'address', + }, + { + internalType: 'uint64', + name: 'ttl', + type: 'uint64', + }, + { + internalType: 'uint32', + name: 'fuses', + type: 'uint32', + }, + { + internalType: 'uint64', + name: 'expiry', + type: 'uint64', + }, + ], + name: 'setSubnodeRecord', + outputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'uint64', + name: 'ttl', + type: 'uint64', + }, + ], + name: 'setTTL', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'contract INameWrapperUpgrade', + name: '_upgradeAddress', + type: 'address', + }, + ], + name: 'setUpgradeContract', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'parentNode', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'labelhash', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'controller', + type: 'address', + }, + ], + name: 'unwrap', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'labelhash', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'registrant', + type: 'address', + }, + { + internalType: 'address', + name: 'controller', + type: 'address', + }, + ], + name: 'unwrapETH2LD', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'parentNode', + type: 'bytes32', + }, + { + internalType: 'string', + name: 'label', + type: 'string', + }, + { + internalType: 'address', + name: 'wrappedOwner', + type: 'address', + }, + { + internalType: 'address', + name: 'resolver', + type: 'address', + }, + ], + name: 'upgrade', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [], + name: 'upgradeContract', + outputs: [ + { + internalType: 'contract INameWrapperUpgrade', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'string', + name: 'label', + type: 'string', + }, + { + internalType: 'address', + name: 'wrappedOwner', + type: 'address', + }, + { + internalType: 'address', + name: 'resolver', + type: 'address', + }, + ], + name: 'upgradeETH2LD', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: 'tokenId', + type: 'uint256', + }, + ], + name: 'uri', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'name', + type: 'bytes', + }, + { + internalType: 'address', + name: 'wrappedOwner', + type: 'address', + }, + { + internalType: 'address', + name: 'resolver', + type: 'address', + }, + ], + name: 'wrap', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'string', + name: 'label', + type: 'string', + }, + { + internalType: 'address', + name: 'wrappedOwner', + type: 'address', + }, + { + internalType: 'uint16', + name: 'ownerControlledFuses', + type: 'uint16', + }, + { + internalType: 'address', + name: 'resolver', + type: 'address', + }, + ], + name: 'wrapETH2LD', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, +] + +export class NameWrapper__factory { + static readonly abi = _abi + static createInterface(): NameWrapperInterface { + return new Interface(_abi) as NameWrapperInterface + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): NameWrapper { + return new Contract(address, _abi, signerOrProvider) as NameWrapper + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/factories/P256SHA256Algorithm__factory.ts b/.yalc/@ensdomains/ensjs/src/generated/factories/P256SHA256Algorithm__factory.ts new file mode 100644 index 000000000..902185fdd --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/factories/P256SHA256Algorithm__factory.ts @@ -0,0 +1,57 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Interface } from '@ethersproject/abi/lib/interface' +import { Signer } from '@ethersproject/abstract-signer' +import { Contract } from '@ethersproject/contracts' +import type { Provider } from '@ethersproject/providers' +import type { + P256SHA256Algorithm, + P256SHA256AlgorithmInterface, +} from '../P256SHA256Algorithm' + +const _abi = [ + { + inputs: [ + { + internalType: 'bytes', + name: 'key', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'signature', + type: 'bytes', + }, + ], + name: 'verify', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, +] + +export class P256SHA256Algorithm__factory { + static readonly abi = _abi + static createInterface(): P256SHA256AlgorithmInterface { + return new Interface(_abi) as P256SHA256AlgorithmInterface + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): P256SHA256Algorithm { + return new Contract(address, _abi, signerOrProvider) as P256SHA256Algorithm + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/factories/PublicResolver__factory.ts b/.yalc/@ensdomains/ensjs/src/generated/factories/PublicResolver__factory.ts new file mode 100644 index 000000000..56a47cb98 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/factories/PublicResolver__factory.ts @@ -0,0 +1,1036 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Interface } from '@ethersproject/abi/lib/interface' +import { Signer } from '@ethersproject/abstract-signer' +import { Contract } from '@ethersproject/contracts' +import type { Provider } from '@ethersproject/providers' +import type { PublicResolver, PublicResolverInterface } from '../PublicResolver' + +const _abi = [ + { + inputs: [ + { + internalType: 'contract ENS', + name: '_ens', + type: 'address', + }, + { + internalType: 'contract INameWrapper', + name: 'wrapperAddress', + type: 'address', + }, + { + internalType: 'address', + name: '_trustedETHController', + type: 'address', + }, + { + internalType: 'address', + name: '_trustedReverseRegistrar', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'uint256', + name: 'contentType', + type: 'uint256', + }, + ], + name: 'ABIChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'address', + name: 'a', + type: 'address', + }, + ], + name: 'AddrChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'uint256', + name: 'coinType', + type: 'uint256', + }, + { + indexed: false, + internalType: 'bytes', + name: 'newAddress', + type: 'bytes', + }, + ], + name: 'AddressChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'ApprovalForAll', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'address', + name: 'delegate', + type: 'address', + }, + { + indexed: true, + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'Approved', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'bytes', + name: 'hash', + type: 'bytes', + }, + ], + name: 'ContenthashChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'bytes', + name: 'name', + type: 'bytes', + }, + { + indexed: false, + internalType: 'uint16', + name: 'resource', + type: 'uint16', + }, + { + indexed: false, + internalType: 'bytes', + name: 'record', + type: 'bytes', + }, + ], + name: 'DNSRecordChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'bytes', + name: 'name', + type: 'bytes', + }, + { + indexed: false, + internalType: 'uint16', + name: 'resource', + type: 'uint16', + }, + ], + name: 'DNSRecordDeleted', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'bytes', + name: 'lastzonehash', + type: 'bytes', + }, + { + indexed: false, + internalType: 'bytes', + name: 'zonehash', + type: 'bytes', + }, + ], + name: 'DNSZonehashChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'bytes4', + name: 'interfaceID', + type: 'bytes4', + }, + { + indexed: false, + internalType: 'address', + name: 'implementer', + type: 'address', + }, + ], + name: 'InterfaceChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'string', + name: 'name', + type: 'string', + }, + ], + name: 'NameChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'bytes32', + name: 'x', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'bytes32', + name: 'y', + type: 'bytes32', + }, + ], + name: 'PubkeyChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + indexed: true, + internalType: 'string', + name: 'indexedKey', + type: 'string', + }, + { + indexed: false, + internalType: 'string', + name: 'key', + type: 'string', + }, + { + indexed: false, + internalType: 'string', + name: 'value', + type: 'string', + }, + ], + name: 'TextChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + indexed: false, + internalType: 'uint64', + name: 'newVersion', + type: 'uint64', + }, + ], + name: 'VersionChanged', + type: 'event', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'uint256', + name: 'contentTypes', + type: 'uint256', + }, + ], + name: 'ABI', + outputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + ], + name: 'addr', + outputs: [ + { + internalType: 'address payable', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'uint256', + name: 'coinType', + type: 'uint256', + }, + ], + name: 'addr', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'delegate', + type: 'address', + }, + { + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'approve', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + ], + name: 'clearRecords', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + ], + name: 'contenthash', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'name', + type: 'bytes32', + }, + { + internalType: 'uint16', + name: 'resource', + type: 'uint16', + }, + ], + name: 'dnsRecord', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'name', + type: 'bytes32', + }, + ], + name: 'hasDNSRecords', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'bytes4', + name: 'interfaceID', + type: 'bytes4', + }, + ], + name: 'interfaceImplementer', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'delegate', + type: 'address', + }, + ], + name: 'isApprovedFor', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'account', + type: 'address', + }, + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + ], + name: 'isApprovedForAll', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes[]', + name: 'data', + type: 'bytes[]', + }, + ], + name: 'multicall', + outputs: [ + { + internalType: 'bytes[]', + name: 'results', + type: 'bytes[]', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'nodehash', + type: 'bytes32', + }, + { + internalType: 'bytes[]', + name: 'data', + type: 'bytes[]', + }, + ], + name: 'multicallWithNodeCheck', + outputs: [ + { + internalType: 'bytes[]', + name: 'results', + type: 'bytes[]', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + ], + name: 'name', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + ], + name: 'pubkey', + outputs: [ + { + internalType: 'bytes32', + name: 'x', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'y', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + name: 'recordVersions', + outputs: [ + { + internalType: 'uint64', + name: '', + type: 'uint64', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'uint256', + name: 'contentType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'setABI', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'uint256', + name: 'coinType', + type: 'uint256', + }, + { + internalType: 'bytes', + name: 'a', + type: 'bytes', + }, + ], + name: 'setAddr', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'a', + type: 'address', + }, + ], + name: 'setAddr', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'operator', + type: 'address', + }, + { + internalType: 'bool', + name: 'approved', + type: 'bool', + }, + ], + name: 'setApprovalForAll', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'bytes', + name: 'hash', + type: 'bytes', + }, + ], + name: 'setContenthash', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'setDNSRecords', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'bytes4', + name: 'interfaceID', + type: 'bytes4', + }, + { + internalType: 'address', + name: 'implementer', + type: 'address', + }, + ], + name: 'setInterface', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'string', + name: 'newName', + type: 'string', + }, + ], + name: 'setName', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'x', + type: 'bytes32', + }, + { + internalType: 'bytes32', + name: 'y', + type: 'bytes32', + }, + ], + name: 'setPubkey', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'string', + name: 'key', + type: 'string', + }, + { + internalType: 'string', + name: 'value', + type: 'string', + }, + ], + name: 'setText', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'bytes', + name: 'hash', + type: 'bytes', + }, + ], + name: 'setZonehash', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceID', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + { + internalType: 'string', + name: 'key', + type: 'string', + }, + ], + name: 'text', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + ], + name: 'zonehash', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + ], + stateMutability: 'view', + type: 'function', + }, +] + +export class PublicResolver__factory { + static readonly abi = _abi + static createInterface(): PublicResolverInterface { + return new Interface(_abi) as PublicResolverInterface + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): PublicResolver { + return new Contract(address, _abi, signerOrProvider) as PublicResolver + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/factories/RSASHA1Algorithm__factory.ts b/.yalc/@ensdomains/ensjs/src/generated/factories/RSASHA1Algorithm__factory.ts new file mode 100644 index 000000000..7d89dc123 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/factories/RSASHA1Algorithm__factory.ts @@ -0,0 +1,57 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Interface } from '@ethersproject/abi/lib/interface' +import { Signer } from '@ethersproject/abstract-signer' +import { Contract } from '@ethersproject/contracts' +import type { Provider } from '@ethersproject/providers' +import type { + RSASHA1Algorithm, + RSASHA1AlgorithmInterface, +} from '../RSASHA1Algorithm' + +const _abi = [ + { + inputs: [ + { + internalType: 'bytes', + name: 'key', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'sig', + type: 'bytes', + }, + ], + name: 'verify', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, +] + +export class RSASHA1Algorithm__factory { + static readonly abi = _abi + static createInterface(): RSASHA1AlgorithmInterface { + return new Interface(_abi) as RSASHA1AlgorithmInterface + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): RSASHA1Algorithm { + return new Contract(address, _abi, signerOrProvider) as RSASHA1Algorithm + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/factories/RSASHA256Algorithm__factory.ts b/.yalc/@ensdomains/ensjs/src/generated/factories/RSASHA256Algorithm__factory.ts new file mode 100644 index 000000000..480238635 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/factories/RSASHA256Algorithm__factory.ts @@ -0,0 +1,57 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Interface } from '@ethersproject/abi/lib/interface' +import { Signer } from '@ethersproject/abstract-signer' +import { Contract } from '@ethersproject/contracts' +import type { Provider } from '@ethersproject/providers' +import type { + RSASHA256Algorithm, + RSASHA256AlgorithmInterface, +} from '../RSASHA256Algorithm' + +const _abi = [ + { + inputs: [ + { + internalType: 'bytes', + name: 'key', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'sig', + type: 'bytes', + }, + ], + name: 'verify', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, +] + +export class RSASHA256Algorithm__factory { + static readonly abi = _abi + static createInterface(): RSASHA256AlgorithmInterface { + return new Interface(_abi) as RSASHA256AlgorithmInterface + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): RSASHA256Algorithm { + return new Contract(address, _abi, signerOrProvider) as RSASHA256Algorithm + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/factories/ReverseRegistrar__factory.ts b/.yalc/@ensdomains/ensjs/src/generated/factories/ReverseRegistrar__factory.ts new file mode 100644 index 000000000..2cbfc221e --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/factories/ReverseRegistrar__factory.ts @@ -0,0 +1,362 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Interface } from '@ethersproject/abi/lib/interface' +import { Signer } from '@ethersproject/abstract-signer' +import { Contract } from '@ethersproject/contracts' +import type { Provider } from '@ethersproject/providers' +import type { + ReverseRegistrar, + ReverseRegistrarInterface, +} from '../ReverseRegistrar' + +const _abi = [ + { + inputs: [ + { + internalType: 'contract ENS', + name: 'ensAddr', + type: 'address', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'controller', + type: 'address', + }, + { + indexed: false, + internalType: 'bool', + name: 'enabled', + type: 'bool', + }, + ], + name: 'ControllerChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'contract NameResolver', + name: 'resolver', + type: 'address', + }, + ], + name: 'DefaultResolverChanged', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'addr', + type: 'address', + }, + { + indexed: true, + internalType: 'bytes32', + name: 'node', + type: 'bytes32', + }, + ], + name: 'ReverseClaimed', + type: 'event', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'claim', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'addr', + type: 'address', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'resolver', + type: 'address', + }, + ], + name: 'claimForAddr', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'resolver', + type: 'address', + }, + ], + name: 'claimWithResolver', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'controllers', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'defaultResolver', + outputs: [ + { + internalType: 'contract NameResolver', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'ens', + outputs: [ + { + internalType: 'contract ENS', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'addr', + type: 'address', + }, + ], + name: 'node', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'pure', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'controller', + type: 'address', + }, + { + internalType: 'bool', + name: 'enabled', + type: 'bool', + }, + ], + name: 'setController', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'resolver', + type: 'address', + }, + ], + name: 'setDefaultResolver', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'string', + name: 'name', + type: 'string', + }, + ], + name: 'setName', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'addr', + type: 'address', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + { + internalType: 'address', + name: 'resolver', + type: 'address', + }, + { + internalType: 'string', + name: 'name', + type: 'string', + }, + ], + name: 'setNameForAddr', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, +] + +export class ReverseRegistrar__factory { + static readonly abi = _abi + static createInterface(): ReverseRegistrarInterface { + return new Interface(_abi) as ReverseRegistrarInterface + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): ReverseRegistrar { + return new Contract(address, _abi, signerOrProvider) as ReverseRegistrar + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/factories/Root__factory.ts b/.yalc/@ensdomains/ensjs/src/generated/factories/Root__factory.ts new file mode 100644 index 000000000..c22e610d0 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/factories/Root__factory.ts @@ -0,0 +1,246 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Interface } from '@ethersproject/abi/lib/interface' +import { Signer } from '@ethersproject/abstract-signer' +import { Contract } from '@ethersproject/contracts' +import type { Provider } from '@ethersproject/providers' +import type { Root, RootInterface } from '../Root' + +const _abi = [ + { + inputs: [ + { + internalType: 'contract ENS', + name: '_ens', + type: 'address', + }, + ], + payable: false, + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'bytes32', + name: 'label', + type: 'bytes32', + }, + ], + name: 'TLDLocked', + type: 'event', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + name: 'controllers', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'ens', + outputs: [ + { + internalType: 'contract ENS', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'address', + name: 'addr', + type: 'address', + }, + ], + name: 'isOwner', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'bytes32', + name: 'label', + type: 'bytes32', + }, + ], + name: 'lock', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + name: 'locked', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: true, + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + payable: false, + stateMutability: 'view', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'controller', + type: 'address', + }, + { + internalType: 'bool', + name: 'enabled', + type: 'bool', + }, + ], + name: 'setController', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'resolver', + type: 'address', + }, + ], + name: 'setResolver', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'bytes32', + name: 'label', + type: 'bytes32', + }, + { + internalType: 'address', + name: 'owner', + type: 'address', + }, + ], + name: 'setSubnodeOwner', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, + { + constant: true, + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceID', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + payable: false, + stateMutability: 'pure', + type: 'function', + }, + { + constant: false, + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + payable: false, + stateMutability: 'nonpayable', + type: 'function', + }, +] + +export class Root__factory { + static readonly abi = _abi + static createInterface(): RootInterface { + return new Interface(_abi) as RootInterface + } + static connect(address: string, signerOrProvider: Signer | Provider): Root { + return new Contract(address, _abi, signerOrProvider) as Root + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/factories/SHA1Digest__factory.ts b/.yalc/@ensdomains/ensjs/src/generated/factories/SHA1Digest__factory.ts new file mode 100644 index 000000000..fc099f3dd --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/factories/SHA1Digest__factory.ts @@ -0,0 +1,49 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Interface } from '@ethersproject/abi/lib/interface' +import { Signer } from '@ethersproject/abstract-signer' +import { Contract } from '@ethersproject/contracts' +import type { Provider } from '@ethersproject/providers' +import type { SHA1Digest, SHA1DigestInterface } from '../SHA1Digest' + +const _abi = [ + { + inputs: [ + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'hash', + type: 'bytes', + }, + ], + name: 'verify', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'pure', + type: 'function', + }, +] + +export class SHA1Digest__factory { + static readonly abi = _abi + static createInterface(): SHA1DigestInterface { + return new Interface(_abi) as SHA1DigestInterface + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): SHA1Digest { + return new Contract(address, _abi, signerOrProvider) as SHA1Digest + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/factories/SHA1NSEC3Digest__factory.ts b/.yalc/@ensdomains/ensjs/src/generated/factories/SHA1NSEC3Digest__factory.ts new file mode 100644 index 000000000..56b9cddf6 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/factories/SHA1NSEC3Digest__factory.ts @@ -0,0 +1,57 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Interface } from '@ethersproject/abi/lib/interface' +import { Signer } from '@ethersproject/abstract-signer' +import { Contract } from '@ethersproject/contracts' +import type { Provider } from '@ethersproject/providers' +import type { + SHA1NSEC3Digest, + SHA1NSEC3DigestInterface, +} from '../SHA1NSEC3Digest' + +const _abi = [ + { + inputs: [ + { + internalType: 'bytes', + name: 'salt', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + { + internalType: 'uint256', + name: 'iterations', + type: 'uint256', + }, + ], + name: 'hash', + outputs: [ + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'pure', + type: 'function', + }, +] + +export class SHA1NSEC3Digest__factory { + static readonly abi = _abi + static createInterface(): SHA1NSEC3DigestInterface { + return new Interface(_abi) as SHA1NSEC3DigestInterface + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): SHA1NSEC3Digest { + return new Contract(address, _abi, signerOrProvider) as SHA1NSEC3Digest + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/factories/SHA256Digest__factory.ts b/.yalc/@ensdomains/ensjs/src/generated/factories/SHA256Digest__factory.ts new file mode 100644 index 000000000..0f1518937 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/factories/SHA256Digest__factory.ts @@ -0,0 +1,49 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Interface } from '@ethersproject/abi/lib/interface' +import { Signer } from '@ethersproject/abstract-signer' +import { Contract } from '@ethersproject/contracts' +import type { Provider } from '@ethersproject/providers' +import type { SHA256Digest, SHA256DigestInterface } from '../SHA256Digest' + +const _abi = [ + { + inputs: [ + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'hash', + type: 'bytes', + }, + ], + name: 'verify', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'pure', + type: 'function', + }, +] + +export class SHA256Digest__factory { + static readonly abi = _abi + static createInterface(): SHA256DigestInterface { + return new Interface(_abi) as SHA256DigestInterface + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): SHA256Digest { + return new Contract(address, _abi, signerOrProvider) as SHA256Digest + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/factories/StaticMetadataService__factory.ts b/.yalc/@ensdomains/ensjs/src/generated/factories/StaticMetadataService__factory.ts new file mode 100644 index 000000000..162c649fa --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/factories/StaticMetadataService__factory.ts @@ -0,0 +1,62 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Interface } from '@ethersproject/abi/lib/interface' +import { Signer } from '@ethersproject/abstract-signer' +import { Contract } from '@ethersproject/contracts' +import type { Provider } from '@ethersproject/providers' +import type { + StaticMetadataService, + StaticMetadataServiceInterface, +} from '../StaticMetadataService' + +const _abi = [ + { + inputs: [ + { + internalType: 'string', + name: '_metaDataUri', + type: 'string', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'uri', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, +] + +export class StaticMetadataService__factory { + static readonly abi = _abi + static createInterface(): StaticMetadataServiceInterface { + return new Interface(_abi) as StaticMetadataServiceInterface + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): StaticMetadataService { + return new Contract( + address, + _abi, + signerOrProvider, + ) as StaticMetadataService + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/factories/TLDPublicSuffixList__factory.ts b/.yalc/@ensdomains/ensjs/src/generated/factories/TLDPublicSuffixList__factory.ts new file mode 100644 index 000000000..7fee015f5 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/factories/TLDPublicSuffixList__factory.ts @@ -0,0 +1,47 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Interface } from '@ethersproject/abi/lib/interface' +import { Signer } from '@ethersproject/abstract-signer' +import { Contract } from '@ethersproject/contracts' +import type { Provider } from '@ethersproject/providers' +import type { + TLDPublicSuffixList, + TLDPublicSuffixListInterface, +} from '../TLDPublicSuffixList' + +const _abi = [ + { + inputs: [ + { + internalType: 'bytes', + name: 'name', + type: 'bytes', + }, + ], + name: 'isPublicSuffix', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, +] + +export class TLDPublicSuffixList__factory { + static readonly abi = _abi + static createInterface(): TLDPublicSuffixListInterface { + return new Interface(_abi) as TLDPublicSuffixListInterface + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): TLDPublicSuffixList { + return new Contract(address, _abi, signerOrProvider) as TLDPublicSuffixList + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/factories/UniversalResolver__factory.ts b/.yalc/@ensdomains/ensjs/src/generated/factories/UniversalResolver__factory.ts new file mode 100644 index 000000000..213a59234 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/factories/UniversalResolver__factory.ts @@ -0,0 +1,555 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ + +import { Interface } from '@ethersproject/abi/lib/interface' +import { Signer } from '@ethersproject/abstract-signer' +import { Contract } from '@ethersproject/contracts' +import type { Provider } from '@ethersproject/providers' +import type { + UniversalResolver, + UniversalResolverInterface, +} from '../UniversalResolver' + +const _abi = [ + { + inputs: [ + { + internalType: 'address', + name: '_registry', + type: 'address', + }, + { + internalType: 'string[]', + name: '_urls', + type: 'string[]', + }, + ], + stateMutability: 'nonpayable', + type: 'constructor', + }, + { + inputs: [ + { + internalType: 'address', + name: 'sender', + type: 'address', + }, + { + internalType: 'string[]', + name: 'urls', + type: 'string[]', + }, + { + internalType: 'bytes', + name: 'callData', + type: 'bytes', + }, + { + internalType: 'bytes4', + name: 'callbackFunction', + type: 'bytes4', + }, + { + internalType: 'bytes', + name: 'extraData', + type: 'bytes', + }, + ], + name: 'OffchainLookup', + type: 'error', + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: 'address', + name: 'previousOwner', + type: 'address', + }, + { + indexed: true, + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'OwnershipTransferred', + type: 'event', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'name', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + { + internalType: 'string[]', + name: 'gateways', + type: 'string[]', + }, + { + internalType: 'bytes4', + name: 'callbackFunction', + type: 'bytes4', + }, + { + internalType: 'bytes', + name: 'metaData', + type: 'bytes', + }, + ], + name: '_resolveSingle', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'uint256', + name: '', + type: 'uint256', + }, + ], + name: 'batchGatewayURLs', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'name', + type: 'bytes', + }, + ], + name: 'findResolver', + outputs: [ + { + internalType: 'contract Resolver', + name: '', + type: 'address', + }, + { + internalType: 'bytes32', + name: '', + type: 'bytes32', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'owner', + outputs: [ + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'registry', + outputs: [ + { + internalType: 'contract ENS', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [], + name: 'renounceOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'name', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + { + internalType: 'string[]', + name: 'gateways', + type: 'string[]', + }, + ], + name: 'resolve', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'name', + type: 'bytes', + }, + { + internalType: 'bytes[]', + name: 'data', + type: 'bytes[]', + }, + ], + name: 'resolve', + outputs: [ + { + internalType: 'bytes[]', + name: '', + type: 'bytes[]', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'name', + type: 'bytes', + }, + { + internalType: 'bytes[]', + name: 'data', + type: 'bytes[]', + }, + { + internalType: 'string[]', + name: 'gateways', + type: 'string[]', + }, + ], + name: 'resolve', + outputs: [ + { + internalType: 'bytes[]', + name: '', + type: 'bytes[]', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'name', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'data', + type: 'bytes', + }, + ], + name: 'resolve', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'response', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'extraData', + type: 'bytes', + }, + ], + name: 'resolveCallback', + outputs: [ + { + internalType: 'bytes[]', + name: '', + type: 'bytes[]', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'response', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'extraData', + type: 'bytes', + }, + ], + name: 'resolveSingleCallback', + outputs: [ + { + internalType: 'bytes', + name: '', + type: 'bytes', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'reverseName', + type: 'bytes', + }, + { + internalType: 'string[]', + name: 'gateways', + type: 'string[]', + }, + ], + name: 'reverse', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'reverseName', + type: 'bytes', + }, + ], + name: 'reverse', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes', + name: 'response', + type: 'bytes', + }, + { + internalType: 'bytes', + name: 'extraData', + type: 'bytes', + }, + ], + name: 'reverseCallback', + outputs: [ + { + internalType: 'string', + name: '', + type: 'string', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + { + internalType: 'address', + name: '', + type: 'address', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'string[]', + name: '_urls', + type: 'string[]', + }, + ], + name: 'setGatewayURLs', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, + { + inputs: [ + { + internalType: 'bytes4', + name: 'interfaceId', + type: 'bytes4', + }, + ], + name: 'supportsInterface', + outputs: [ + { + internalType: 'bool', + name: '', + type: 'bool', + }, + ], + stateMutability: 'view', + type: 'function', + }, + { + inputs: [ + { + internalType: 'address', + name: 'newOwner', + type: 'address', + }, + ], + name: 'transferOwnership', + outputs: [], + stateMutability: 'nonpayable', + type: 'function', + }, +] + +export class UniversalResolver__factory { + static readonly abi = _abi + static createInterface(): UniversalResolverInterface { + return new Interface(_abi) as UniversalResolverInterface + } + static connect( + address: string, + signerOrProvider: Signer | Provider, + ): UniversalResolver { + return new Contract(address, _abi, signerOrProvider) as UniversalResolver + } +} diff --git a/.yalc/@ensdomains/ensjs/src/generated/factories/index.ts b/.yalc/@ensdomains/ensjs/src/generated/factories/index.ts new file mode 100644 index 000000000..5aaef9509 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/factories/index.ts @@ -0,0 +1,24 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export { BaseRegistrarImplementation__factory } from "./BaseRegistrarImplementation__factory"; +export { BulkRenewal__factory } from "./BulkRenewal__factory"; +export { DNSRegistrar__factory } from "./DNSRegistrar__factory"; +export { DNSSECImpl__factory } from "./DNSSECImpl__factory"; +export { DefaultReverseResolver__factory } from "./DefaultReverseResolver__factory"; +export { ENSRegistry__factory } from "./ENSRegistry__factory"; +export { ETHRegistrarController__factory } from "./ETHRegistrarController__factory"; +export { Multicall__factory } from "./Multicall__factory"; +export { NameWrapper__factory } from "./NameWrapper__factory"; +export { P256SHA256Algorithm__factory } from "./P256SHA256Algorithm__factory"; +export { PublicResolver__factory } from "./PublicResolver__factory"; +export { RSASHA1Algorithm__factory } from "./RSASHA1Algorithm__factory"; +export { RSASHA256Algorithm__factory } from "./RSASHA256Algorithm__factory"; +export { ReverseRegistrar__factory } from "./ReverseRegistrar__factory"; +export { Root__factory } from "./Root__factory"; +export { SHA1Digest__factory } from "./SHA1Digest__factory"; +export { SHA1NSEC3Digest__factory } from "./SHA1NSEC3Digest__factory"; +export { SHA256Digest__factory } from "./SHA256Digest__factory"; +export { StaticMetadataService__factory } from "./StaticMetadataService__factory"; +export { TLDPublicSuffixList__factory } from "./TLDPublicSuffixList__factory"; +export { UniversalResolver__factory } from "./UniversalResolver__factory"; diff --git a/.yalc/@ensdomains/ensjs/src/generated/index.ts b/.yalc/@ensdomains/ensjs/src/generated/index.ts new file mode 100644 index 000000000..8d35197b8 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/generated/index.ts @@ -0,0 +1,46 @@ +/* Autogenerated file. Do not edit manually. */ +/* tslint:disable */ +/* eslint-disable */ +export type { BaseRegistrarImplementation } from "./BaseRegistrarImplementation"; +export type { BulkRenewal } from "./BulkRenewal"; +export type { DNSRegistrar } from "./DNSRegistrar"; +export type { DNSSECImpl } from "./DNSSECImpl"; +export type { DefaultReverseResolver } from "./DefaultReverseResolver"; +export type { ENSRegistry } from "./ENSRegistry"; +export type { ETHRegistrarController } from "./ETHRegistrarController"; +export type { Multicall } from "./Multicall"; +export type { NameWrapper } from "./NameWrapper"; +export type { P256SHA256Algorithm } from "./P256SHA256Algorithm"; +export type { PublicResolver } from "./PublicResolver"; +export type { RSASHA1Algorithm } from "./RSASHA1Algorithm"; +export type { RSASHA256Algorithm } from "./RSASHA256Algorithm"; +export type { ReverseRegistrar } from "./ReverseRegistrar"; +export type { Root } from "./Root"; +export type { SHA1Digest } from "./SHA1Digest"; +export type { SHA1NSEC3Digest } from "./SHA1NSEC3Digest"; +export type { SHA256Digest } from "./SHA256Digest"; +export type { StaticMetadataService } from "./StaticMetadataService"; +export type { TLDPublicSuffixList } from "./TLDPublicSuffixList"; +export type { UniversalResolver } from "./UniversalResolver"; +export * as factories from "./factories"; +export { BaseRegistrarImplementation__factory } from "./factories/BaseRegistrarImplementation__factory"; +export { DefaultReverseResolver__factory } from "./factories/DefaultReverseResolver__factory"; +export { DNSRegistrar__factory } from "./factories/DNSRegistrar__factory"; +export { DNSSECImpl__factory } from "./factories/DNSSECImpl__factory"; +export { ENSRegistry__factory } from "./factories/ENSRegistry__factory"; +export { ETHRegistrarController__factory } from "./factories/ETHRegistrarController__factory"; +export { P256SHA256Algorithm__factory } from "./factories/P256SHA256Algorithm__factory"; +export { PublicResolver__factory } from "./factories/PublicResolver__factory"; +export { ReverseRegistrar__factory } from "./factories/ReverseRegistrar__factory"; +export { Root__factory } from "./factories/Root__factory"; +export { RSASHA1Algorithm__factory } from "./factories/RSASHA1Algorithm__factory"; +export { RSASHA256Algorithm__factory } from "./factories/RSASHA256Algorithm__factory"; +export { SHA1Digest__factory } from "./factories/SHA1Digest__factory"; +export { SHA1NSEC3Digest__factory } from "./factories/SHA1NSEC3Digest__factory"; +export { SHA256Digest__factory } from "./factories/SHA256Digest__factory"; +export { TLDPublicSuffixList__factory } from "./factories/TLDPublicSuffixList__factory"; +export { Multicall__factory } from "./factories/Multicall__factory"; +export { NameWrapper__factory } from "./factories/NameWrapper__factory"; +export { StaticMetadataService__factory } from "./factories/StaticMetadataService__factory"; +export { UniversalResolver__factory } from "./factories/UniversalResolver__factory"; +export { BulkRenewal__factory } from "./factories/BulkRenewal__factory"; diff --git a/.yalc/@ensdomains/ensjs/src/index.ts b/.yalc/@ensdomains/ensjs/src/index.ts new file mode 100644 index 000000000..44cc43570 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/index.ts @@ -0,0 +1,643 @@ +import { + ContractTransaction, + PopulatedTransaction, +} from '@ethersproject/contracts' +import type { + JsonRpcProvider, + JsonRpcSigner, + Provider, +} from '@ethersproject/providers' +import { getContractAddress as _getContractAddress } from './contracts/getContractAddress' +import ContractManager from './contracts/index' +import { SupportedNetworkId } from './contracts/types' +import type FunctionTypes from './functions/types' +import GqlManager from './GqlManager' +import singleCall from './utils/singleCall' +import writeTx from './utils/writeTx' + +export type { ChildFuses, ParentFuses } from './utils/fuses' + +type ENSOptions = { + graphURI?: string | null + getContractAddress?: typeof _getContractAddress +} + +export type InternalENS = { + options?: ENSOptions + provider?: Provider + signer: JsonRpcSigner + graphURI?: string | null +} & ENS + +export type ENSArgs = { + [P in K]: InternalENS[P] +} + +type OmitFirstArg = F extends (x: any, ...args: infer P) => infer R + ? (...args: P) => R + : never + +type OmitFirstTwoArgs = F extends ( + x: any, + y: any, + ...args: infer P +) => infer R + ? (...args: P) => R + : never + +type FirstArg = F extends (x: infer A, ...args: any[]) => any ? A : never + +type FunctionDeps = Extract, string>[] + +type WriteOptions = { + addressOrIndex?: string | number + signer?: JsonRpcSigner +} + +type OptionalWriteOptions = F extends ( + x: any, + arg_0: infer Z, + options?: infer P, +) => infer R + ? (name: Z, options?: P & WriteOptions) => R + : F extends (x: any, arg_0: infer Z, options: infer P) => infer R + ? (name: Z, options: P & WriteOptions) => R + : never + +interface WriteFunction any> extends Function { + (...args: Parameters>): Promise< + ContractTransaction & { + customData?: Record + } + > + populateTransaction: ( + ...args: Parameters> + ) => Promise +} + +/* eslint-disable @typescript-eslint/naming-convention */ +export const graphURIEndpoints: Record = { + 1: 'https://api.thegraph.com/subgraphs/name/ensdomains/ens', + 3: 'https://api.thegraph.com/subgraphs/name/ensdomains/ensropsten', + 4: 'https://api.thegraph.com/subgraphs/name/ensdomains/ensrinkeby', + 5: 'https://api.thegraph.com/subgraphs/name/ensdomains/ensgoerli', +} +/* eslint-enable @typescript-eslint/naming-convention */ + +export type RawFunction = { + raw: (...args: any[]) => Promise<{ to: string; data: string }> + decode: (...args: any[]) => Promise +} + +export type BatchFunctionResult = { + args: Parameters> + raw: F['raw'] + decode: F['decode'] +} + +type BatchFunction = ( + ...args: Parameters> +) => BatchFunctionResult + +export type RawFunctionWithBatch = { + batch: BatchFunction +} & RawFunction + +interface GeneratedRawFunction + extends Function, + RawFunction { + (...args: Parameters>): ReturnType< + OmitFirstTwoArgs + > + batch: BatchFunction +} + +type CombineFunctionDeps = F extends RawFunction + ? FunctionDeps | FunctionDeps + : never + +export interface GenericGeneratedRawFunction + extends Function, + RawFunctionWithBatch {} + +interface GeneratedBatchFunction + extends Function, + RawFunction { + []>(...args: I): Promise< + | { + [N in keyof I]: I[N] extends BatchFunctionResult + ? Awaited> + : never + } + | undefined + > + batch: BatchFunction +} + +export type FunctionSubtype = + | 'raw' + | 'decode' + | 'combine' + | 'batch' + | 'write' + | 'populateTransaction' + +export class ENS { + [x: string]: any + + protected options?: ENSOptions + + protected provider?: JsonRpcProvider + + protected graphURI?: string | null + + protected initialProvider?: JsonRpcProvider + + contracts?: ContractManager + + getContractAddress = _getContractAddress + + gqlInstance = new GqlManager() + + constructor(options?: ENSOptions) { + this.options = options + this.getContractAddress = options?.getContractAddress || _getContractAddress + } + + /** + * Checks for an initial provider and if it exists, sets it as the provider + * @returns {Promise} - A promise that resolves when the provider is checked, and set if needed + */ + private checkInitialProvider = async (): Promise => { + if (!this.initialProvider) { + return + } + await this.setProvider(this.initialProvider) + } + + /** + * Creates an object of ENS properties from an array + * @param {FunctionDeps} dependencies - An array of ENS properties + * @returns {Object} - An object of ENS properties + */ + protected forwardDependenciesFromArray = ( + dependencies: FunctionDeps, + ): object => + // Creates an object from entries of the array + Object.fromEntries( + // Maps over dependencies and create arrays for each, e.g. ['contracts', contractObj] + dependencies.map((dep) => [dep, this[dep as keyof InternalENS]]), + ) + + // eslint-disable-next-line class-methods-use-this + protected getModule = async (path: string, exportName: string) => { + let mod = await import( + /* webpackMode: "lazy", webpackChunkName: "[request]", webpackPreload: true, webpackExclude: /.*\.ts$/ */ + `./functions/${path}` + ) + + // if export is nested in default, use default + if (mod.default?.[exportName]) { + mod = mod.default + } + return mod + } + + // eslint-disable-next-line class-methods-use-this + protected getFunction = ( + subFunc: FunctionSubtype | undefined, + writeable: boolean | undefined, + exportName: string, + mod: any, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + _path: string, + ) => (subFunc && !writeable ? mod[exportName][subFunc] : mod[exportName]) + + /** + * Creates a wrapper for a function to be dynamically imported, with the correct dependencies passed in + * @param {string} path - The path of the exported function + * @param {FunctionDeps} dependencies - An array of ENS properties + * @param {string} exportName - The export name of the target function + * @param {string} subFunc - The type of function being imported + * @returns {Function} - The generated wrapped function + */ + private importGenerator = ( + path: string, + dependencies: FunctionDeps, + exportName: string = 'default', + subFunc?: FunctionSubtype, + passthrough?: RawFunction, + ): Function => { + // if batch is specified, create batch func + if (subFunc === 'batch') { + return (...args: any[]) => ({ args, ...passthrough }) + } + + const thisRef = this + const mainFunc = async function (...args: any[]) { + // check the initial provider and set if it exists + await thisRef.checkInitialProvider() + // import the module dynamically + const mod = await thisRef.getModule(path, exportName) + + // if combine isn't specified, run normally + // otherwise, create a function from the raw and decode functions + if (subFunc !== 'combine') { + const writeable = + subFunc === 'write' || subFunc === 'populateTransaction' + // get the function to call + const func = thisRef.getFunction( + subFunc, + writeable, + exportName, + mod, + path, + ) + // get the dependencies to forward to the function as the first arg + let dependenciesToForward = + thisRef.forwardDependenciesFromArray(dependencies) + + // if func is write func, inject signer into dependencies + if (writeable) { + const options = (args[1] || {}) as WriteOptions + const signer = + options.signer || + thisRef.provider?.getSigner(options.addressOrIndex) + const populate = subFunc === 'populateTransaction' + if (!signer) { + throw new Error('No signer specified') + } + delete options.addressOrIndex + delete options.signer + dependenciesToForward = { ...dependenciesToForward, signer } + return func(dependenciesToForward, args[0], options).then( + writeTx(signer, populate), + ) + } + + // return the function with the dependencies forwarded + return func(dependenciesToForward, ...args) + } + // get the dependencies to forward from raw and decode functions + const dependenciesToForward = thisRef.forwardDependenciesFromArray< + CombineFunctionDeps + >(dependencies as any) + + // return singleCall function with dependencies forwarded + return singleCall( + thisRef.provider!, + dependenciesToForward, + thisRef.getFunction(undefined, undefined, exportName, mod, path), + ...args, + ) + } + + // if subfunc is combine, add raw and decode property methods to the function + if (subFunc === 'combine') { + mainFunc.raw = this.importGenerator( + path, + dependencies, + exportName, + 'raw', + ) + mainFunc.decode = this.importGenerator( + path, + dependencies, + exportName, + 'decode', + ) as (data: any, ...args: any[]) => Promise + mainFunc.batch = this.importGenerator( + path, + dependencies, + exportName, + 'batch', + { raw: mainFunc.raw as any, decode: mainFunc.decode as any }, + ) + } else if (subFunc === 'write') { + mainFunc.populateTransaction = this.importGenerator( + path, + dependencies, + exportName, + 'populateTransaction', + ) + } + + return mainFunc as Function + } + + /** + * Generates a normal wrapped function + * @param {string} path - The path of the exported function + * @param {FunctionDeps} dependencies - An array of ENS properties + * @param {string} exportName - The export name of the target function + * @returns {OmitFirstArg} - The generated wrapped function + */ + private generateFunction = ( + path: string, + dependencies: FunctionDeps, + exportName: string = 'default', + ): OmitFirstArg => + this.importGenerator(path, dependencies, exportName) as OmitFirstArg + + /** + * Generates a write wrapped function + * @param {string} path - The path of the exported function + * @param {FunctionDeps} dependencies - An array of ENS properties + * @param {string} exportName - The export name of the target function + * @returns {OmitFirstArg} - The generated wrapped function + */ + private generateWriteFunction = any>( + path: string, + dependencies: FunctionDeps, + exportName: string = 'default', + ): WriteFunction => + this.importGenerator( + path, + dependencies, + exportName, + 'write', + ) as WriteFunction + + /** + * Generates a wrapped function from raw and decode exports + * @param {string} path - The path of the exported function + * @param {FunctionDeps} dependencies - An array of ENS properties + * @param {string} exportName - The export name of the target function + * @returns {GeneratedRawFunction} - The generated wrapped function + */ + private generateRawFunction = ( + path: string, + dependencies: FunctionDeps | FunctionDeps, + exportName: string = 'default', + ): GeneratedRawFunction => + this.importGenerator( + path, + dependencies as any, + exportName, + 'combine', + ) as GeneratedRawFunction + + /** + * Sets the provider for the ENS class + * @param {JsonRpcProvider} provider - The provider to set + * @returns {Promise} - A promise that resolves when the provider is set + */ + public setProvider = async (provider: JsonRpcProvider): Promise => { + this.provider = provider + const network = this.staticNetwork + ? this.provider._network.chainId + : (await this.provider.getNetwork()).chainId + if (this.options && this.options.graphURI) { + this.graphURI = this.options.graphURI + } else { + this.graphURI = graphURIEndpoints[network] + } + await this.gqlInstance.setUrl(this.graphURI) + this.contracts = new ContractManager( + this.provider, + this.getContractAddress(String(network) as SupportedNetworkId), + ) + } + + /** + * Creates a new ENS instance with a different provider, ideally should be used individually with any given function + * @param {JsonRpcProvider} provider - The provider to use + * @returns {ENS} - A new ENS instance with the given provider + */ + public withProvider = (provider: JsonRpcProvider): ENS => { + const newENS = new ENS(this.options) + newENS.initialProvider = provider + return newENS + } + + public batch = this.generateRawFunction( + 'initialGetters', + ['multicallWrapper'], + 'batch', + ) as GeneratedBatchFunction + + public getProfile = this.generateFunction( + 'initialGetters', + [ + 'contracts', + 'gqlInstance', + 'getName', + 'resolverMulticallWrapper', + 'multicallWrapper', + '_getAddr', + '_getContentHash', + '_getText', + ], + 'getProfile', + ) + + public getRecords = this.generateFunction( + 'initialGetters', + ['getProfile'], + 'getRecords', + ) + + public getName = this.generateRawFunction( + 'initialGetters', + ['contracts'], + 'getName', + ) + + public getResolver = this.generateRawFunction( + 'getResolver', + ['contracts'], + ) + + public getWrapperData = this.generateRawFunction< + FunctionTypes['getWrapperData'] + >('getWrapperData', ['contracts']) + + public getHistory = this.generateFunction( + 'getHistory', + ['gqlInstance'], + 'getHistory', + ) + + public getContentHash = this.generateRawFunction< + FunctionTypes['getContentHash'] + >('initialGetters', ['contracts', 'universalWrapper'], 'getContentHash') + + public _getContentHash = this.generateRawFunction< + FunctionTypes['_getContentHash'] + >('initialGetters', ['contracts'], '_getContentHash') + + public getAddr = this.generateRawFunction( + 'initialGetters', + ['contracts', 'universalWrapper'], + 'getAddr', + ) + + public _getAddr = this.generateRawFunction( + 'initialGetters', + ['contracts'], + '_getAddr', + ) + + public getText = this.generateRawFunction( + 'initialGetters', + ['contracts', 'universalWrapper'], + 'getText', + ) + + public _getText = this.generateRawFunction( + 'initialGetters', + ['contracts'], + '_getText', + ) + + public getABI = this.generateRawFunction( + 'initialGetters', + ['contracts', 'universalWrapper'], + 'getABI', + ) + + public _getABI = this.generateRawFunction( + 'initialGetters', + ['contracts'], + '_getABI', + ) + + public getOwner = this.generateRawFunction( + 'initialGetters', + ['contracts', 'multicallWrapper', 'gqlInstance'], + 'getOwner', + ) + + public getExpiry = this.generateRawFunction( + 'initialGetters', + ['contracts', 'multicallWrapper'], + 'getExpiry', + ) + + public getSubnames = this.generateFunction( + 'initialGetters', + ['gqlInstance'], + 'getSubnames', + ) + + public getNames = this.generateFunction( + 'initialGetters', + ['gqlInstance'], + 'getNames', + ) + + public getPrice = this.generateRawFunction( + 'initialGetters', + ['contracts', 'multicallWrapper'], + 'getPrice', + ) + + public getDNSOwner = this.generateFunction( + 'getDNSOwner', + [], + ) + + public supportsTLD = this.generateFunction( + 'initialGetters', + ['getOwner', 'provider'], + 'supportsTLD', + ) + + public getAvailable = this.generateRawFunction( + 'getAvailable', + ['contracts'], + ) + + public universalWrapper = this.generateRawFunction< + FunctionTypes['universalWrapper'] + >('initialGetters', ['contracts'], 'universalWrapper') + + public resolverMulticallWrapper = this.generateRawFunction< + FunctionTypes['resolverMulticallWrapper'] + >('initialGetters', ['contracts'], 'resolverMulticallWrapper') + + public multicallWrapper = this.generateRawFunction< + FunctionTypes['multicallWrapper'] + >('initialGetters', ['contracts'], 'multicallWrapper') + + public setName = this.generateWriteFunction( + 'setName', + ['contracts'], + ) + + public setRecords = this.generateWriteFunction( + 'setRecords', + ['contracts', 'provider', 'getResolver'], + ) + + public setRecord = this.generateWriteFunction( + 'setRecord', + ['contracts', 'provider', 'getResolver'], + ) + + public setResolver = this.generateWriteFunction( + 'setResolver', + ['contracts'], + ) + + public transferName = this.generateWriteFunction< + FunctionTypes['transferName'] + >('transferName', ['contracts']) + + public transferController = this.generateWriteFunction< + FunctionTypes['transferController'] + >('transferController', ['contracts']) + + public wrapName = this.generateWriteFunction( + 'wrapName', + ['contracts'], + ) + + public unwrapName = this.generateWriteFunction( + 'unwrapName', + ['contracts'], + ) + + public setFuses = this.generateWriteFunction( + 'setFuses', + ['contracts'], + ) + + public setChildFuses = this.generateWriteFunction< + FunctionTypes['setChildFuses'] + >('setFuses', ['contracts'], 'setChildFuses') + + public importDNSSECName = this.generateWriteFunction< + FunctionTypes['importDNSSECName'] + >('importDNSSECName', ['contracts', 'provider', 'signer']) + + public createSubname = this.generateWriteFunction< + FunctionTypes['createSubname'] + >('createSubname', ['contracts', 'getExpiry']) + + public deleteSubname = this.generateWriteFunction< + FunctionTypes['deleteSubname'] + >('deleteSubname', ['contracts']) + + public transferSubname = this.generateWriteFunction< + FunctionTypes['transferSubname'] + >('transferSubname', ['contracts', 'getExpiry']) + + public commitName = this.generateWriteFunction( + 'commitName', + ['contracts'], + ) + + public registerName = this.generateWriteFunction< + FunctionTypes['registerName'] + >('registerName', ['contracts']) + + public renewNames = this.generateWriteFunction( + 'renewNames', + ['contracts'], + ) + + public extendWrappedName = this.generateWriteFunction< + FunctionTypes['extendWrappedName'] + >('renewNames', ['contracts'], 'extendWrappedName') +} diff --git a/.yalc/@ensdomains/ensjs/src/static.ts b/.yalc/@ensdomains/ensjs/src/static.ts new file mode 100644 index 000000000..7044890ab --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/static.ts @@ -0,0 +1,94 @@ +import type { StaticJsonRpcProvider } from '@ethersproject/providers/lib/url-json-rpc-provider' +import { gql, GraphQLClient } from 'graphql-request' +import { parse, print, visit } from 'graphql/language' +import traverse from 'traverse' +import ContractManager from './contracts/index' +import { SupportedNetworkId } from './contracts/types' +import { ENS, FunctionSubtype, graphURIEndpoints } from './index' + +import type Factories from './contracts/factories' +import type FunctionTypes from './functions/types' +import { requestMiddleware, responseMiddleware } from './GqlManager' + +type Options = ConstructorParameters[0] & { + functions: Partial + contracts: Partial +} + +class StaticENS extends ENS { + private functions: Partial + + private contractsObject: Partial + + gqlInstance: { + client: GraphQLClient | { request: () => Promise } + setUrl: () => Promise + gql: typeof gql | ((query: TemplateStringsArray) => string) + } = { + client: { request: () => Promise.resolve(null) }, + setUrl: () => Promise.resolve(), + gql: (query: TemplateStringsArray) => query.join(), + } + + constructor( + provider: StaticJsonRpcProvider, + { functions, contracts, ...options }: Options, + ) { + super(options) + this.functions = functions + this.contractsObject = contracts + this.setStaticProvider(provider) + } + + public setStaticProvider = (provider: StaticJsonRpcProvider) => { + this.provider = provider + const network = provider.network.chainId + if (this.options && this.options.graphURI) { + this.graphURI = this.options.graphURI + } else { + this.graphURI = graphURIEndpoints[network] + } + if (this.graphURI) { + const client = new GraphQLClient(this.graphURI, { + requestMiddleware: requestMiddleware(visit, parse, print), + responseMiddleware: responseMiddleware(traverse), + }) + this.gqlInstance = { + client, + setUrl: () => Promise.resolve(), + gql, + } + } + this.contracts = new ContractManager( + provider, + this.getContractAddress(String(network) as SupportedNetworkId), + (name) => + Promise.resolve(this.contractsObject[name as keyof Factories] as any), + ) + } + + public override setProvider = async ( + provider: StaticJsonRpcProvider, + ): Promise => { + this.setStaticProvider(provider) + } + + protected override getModule = async () => this.functions + + // eslint-disable-next-line class-methods-use-this + protected override getFunction = ( + subFunc: FunctionSubtype | undefined, + _writeable: boolean | undefined, + exportName: string, + mod: any, + path: string, + ) => { + const base = mod[exportName === 'default' ? path : exportName] + if (subFunc === 'raw' || subFunc === 'decode') { + return base[subFunc] + } + return base + } +} + +export default StaticENS diff --git a/.yalc/@ensdomains/ensjs/src/utils/ccip.ts b/.yalc/@ensdomains/ensjs/src/utils/ccip.ts new file mode 100644 index 000000000..882b407a3 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/utils/ccip.ts @@ -0,0 +1,149 @@ +import { BigNumber } from '@ethersproject/bignumber/lib/bignumber' +import { + arrayify, + BytesLike, + hexConcat, + hexDataSlice, +} from '@ethersproject/bytes' +import type { BaseProvider, TransactionRequest } from '@ethersproject/providers' +import { toUtf8String } from '@ethersproject/strings/lib/utf8' +import type { Transaction } from '@ethersproject/transactions' + +function bytesPad(value: Uint8Array): Uint8Array { + if (value.length % 32 === 0) { + return value + } + + const result = new Uint8Array(Math.ceil(value.length / 32) * 32) + result.set(value) + return result +} + +function numPad(value: number): Uint8Array { + const result = arrayify(value) + if (result.length > 32) { + throw new Error('internal; should not happen') + } + + const padded = new Uint8Array(32) + padded.set(result, 32 - result.length) + return padded +} + +// ABI Encodes a series of (bytes, bytes, ...) +function encodeBytes(datas: Array) { + const result: Array = [] + + let byteCount = 0 + + // Add place-holders for pointers as we add items + for (let i = 0; i < datas.length; i += 1) { + result.push(new Uint8Array(0)) + byteCount += 32 + } + + for (let i = 0; i < datas.length; i += 1) { + const data = arrayify(datas[i]) + + // Update the bytes offset + result[i] = numPad(byteCount) + + // The length and padded value of data + result.push(numPad(data.length)) + result.push(bytesPad(data)) + byteCount += 32 + Math.ceil(data.length / 32) * 32 + } + + return hexConcat(result) +} + +function _parseBytes(result: string, start: number): null | string { + if (result === '0x') { + return null + } + + const offset = BigNumber.from( + hexDataSlice(result, start, start + 32), + ).toNumber() + const length = BigNumber.from( + hexDataSlice(result, offset, offset + 32), + ).toNumber() + + return hexDataSlice(result, offset + 32, offset + 32 + length) +} + +function _parseString(result: string, start: number): null | string { + try { + const bytes = _parseBytes(result, start) + if (bytes == null) return null + return toUtf8String(bytes) + } catch (error) {} + return null +} + +const ccipLookup = async ( + provider: BaseProvider, + transaction: TransactionRequest, + result: string, +) => { + const txSender = transaction.to! + try { + const data = hexDataSlice(result, 4) + + // Check the sender of the OffchainLookup matches the transaction + const sender = hexDataSlice(data, 0, 32) + if (!BigNumber.from(sender).eq(txSender)) { + throw new Error('CCIP Read sender did not match') + } + + // Read the URLs from the response + const urls: Array = [] + const urlsOffset = BigNumber.from(hexDataSlice(data, 32, 64)).toNumber() + const urlsLength = BigNumber.from( + hexDataSlice(data, urlsOffset, urlsOffset + 32), + ).toNumber() + const urlsData = hexDataSlice(data, urlsOffset + 32) + for (let u = 0; u < urlsLength; u += 1) { + const url = _parseString(urlsData, u * 32) + if (url == null) { + throw new Error('CCIP Read contained corrupt URL string') + } + urls.push(url) + } + + // Get the CCIP calldata to forward + const calldata = _parseBytes(data, 64) + + // Get the callbackSelector (bytes4) + if (!BigNumber.from(hexDataSlice(data, 100, 128)).isZero()) { + throw new Error('CCIP Read callback selected included junk') + } + const callbackSelector = hexDataSlice(data, 96, 100) + + // Get the extra data to send back to the contract as context + const extraData = _parseBytes(data, 128) + + const ccipResult = await provider.ccipReadFetch( + transaction, + calldata!, + urls, + ) + if (ccipResult == null) { + throw new Error('CCIP Read disabled or provided no URLs') + } + + const tx = { + to: sender, + data: hexConcat([ + callbackSelector, + encodeBytes([ccipResult, extraData!]), + ]), + } + + return await provider._call(tx, 'latest', 1) + } catch (error) { + console.error(error) + } +} + +export default ccipLookup diff --git a/.yalc/@ensdomains/ensjs/src/utils/consts.ts b/.yalc/@ensdomains/ensjs/src/utils/consts.ts new file mode 100644 index 000000000..ddebe3e25 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/utils/consts.ts @@ -0,0 +1,2 @@ +export const EMPTY_ADDRESS = '0x0000000000000000000000000000000000000000' +export const MAX_INT_64 = 2n ** 64n - 1n diff --git a/.yalc/@ensdomains/ensjs/src/utils/contentHash.ts b/.yalc/@ensdomains/ensjs/src/utils/contentHash.ts new file mode 100644 index 000000000..b0698bbe9 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/utils/contentHash.ts @@ -0,0 +1,153 @@ +import contentHash from '@ensdomains/content-hash' +import { isHexString } from '@ethersproject/bytes' + +export type DecodedContentHash = { + protocolType?: any + decoded?: any + error?: any +} + +const supportedCodecs = [ + 'ipns-ns', + 'ipfs-ns', + 'swarm-ns', + 'onion', + 'onion3', + 'skynet-ns', + 'arweave-ns', +] + +function matchProtocol(text: string) { + return ( + text.match(/^(ipfs|sia|ipns|bzz|onion|onion3|arweave|ar):\/\/(.*)/) || + text.match(/\/(ipfs)\/(.*)/) || + text.match(/\/(ipns)\/(.*)/) + ) +} + +export function decodeContenthash(encoded: any) { + let decoded + let protocolType + let error + if (!encoded || encoded === '0x') { + return {} + } + if (encoded.error) { + return { protocolType: null, decoded: encoded.error } + } + if (encoded === false) { + return { protocolType: null, decoded: 'invalid value' } + } + if (encoded) { + try { + decoded = contentHash.decode(encoded) + const codec = contentHash.getCodec(encoded) + if (codec === 'ipfs-ns') { + protocolType = 'ipfs' + } else if (codec === 'ipns-ns') { + protocolType = 'ipns' + } else if (codec === 'swarm-ns') { + protocolType = 'bzz' + } else if (codec === 'onion') { + protocolType = 'onion' + } else if (codec === 'onion3') { + protocolType = 'onion3' + } else if (codec === 'skynet-ns') { + protocolType = 'sia' + } else if (codec === 'arweave-ns') { + protocolType = 'ar' + } else { + decoded = encoded + } + } catch (e: any) { + error = e.message + } + } + return { protocolType, decoded, error } +} + +export function validateContent(encoded: any) { + return ( + contentHash.isHashOfType(encoded, contentHash.Types.ipfs) || + contentHash.isHashOfType(encoded, contentHash.Types.swarm) + ) +} + +export function isValidContenthash(encoded: any) { + try { + const codec = contentHash.getCodec(encoded) + return isHexString(encoded) && supportedCodecs.includes(codec) + } catch (e) { + console.log(e) + } +} + +export function getProtocolType(encoded: any) { + let protocolType + let decoded + try { + const matched = matchProtocol(encoded) + if (matched) { + ;[, protocolType, decoded] = matched + } + return { + protocolType, + decoded, + } + } catch (e) { + console.log(e) + } +} + +export function encodeContenthash(text: string) { + let content = text + let contentType + let encoded: string | boolean = false + let error + if (text) { + const matched = matchProtocol(text) + if (matched) { + ;[, contentType, content] = matched + } + try { + if (contentType === 'ipfs') { + if (content.length >= 4) { + encoded = `0x${contentHash.encode('ipfs-ns', content)}` + } + } else if (contentType === 'ipns') { + encoded = `0x${contentHash.encode('ipns-ns', content)}` + } else if (contentType === 'bzz') { + if (content.length >= 4) { + encoded = `0x${contentHash.fromSwarm(content)}` + } + } else if (contentType === 'onion') { + if (content.length === 16) { + encoded = `0x${contentHash.encode('onion', content)}` + } + } else if (contentType === 'onion3') { + if (content.length === 56) { + encoded = `0x${contentHash.encode('onion3', content)}` + } + } else if (contentType === 'sia') { + if (content.length === 46) { + encoded = `0x${contentHash.encode('skynet-ns', content)}` + } + } else if (contentType === 'arweave' || contentType === 'ar') { + if (content.length === 43) { + encoded = `0x${contentHash.encode('arweave-ns', content)}` + } + } else { + console.warn('Unsupported protocol or invalid value', { + contentType, + text, + }) + } + } catch (err) { + const errorMessage = 'Error encoding content hash' + console.warn(errorMessage, { text, encoded }) + error = errorMessage + // throw 'Error encoding content hash' + } + } + return { encoded, error } +} diff --git a/.yalc/@ensdomains/ensjs/src/utils/createReverseNode.ts b/.yalc/@ensdomains/ensjs/src/utils/createReverseNode.ts new file mode 100644 index 000000000..14f44667d --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/utils/createReverseNode.ts @@ -0,0 +1,2 @@ +export default (address: string) => + `${address.toLowerCase().substring(2)}.addr.reverse` diff --git a/.yalc/@ensdomains/ensjs/src/utils/format.ts b/.yalc/@ensdomains/ensjs/src/utils/format.ts new file mode 100644 index 000000000..4c28648e0 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/utils/format.ts @@ -0,0 +1,8 @@ +export const formatHashed = (name: string): string => + name.replace(/(\[)(.{64})(\])/g, '0x$2') + +export const truncateFormat = (name: string): string => + name.replace(/(\[.{3})(.{58})(.{3}\])/g, '$1...$3') + +export const bracketFormat = (name: string): string => + name.replace(/(0x)(.{64})(?=\.)/g, '[$2]') diff --git a/.yalc/@ensdomains/ensjs/src/utils/fuses.ts b/.yalc/@ensdomains/ensjs/src/utils/fuses.ts new file mode 100644 index 000000000..b7a350409 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/utils/fuses.ts @@ -0,0 +1,325 @@ +// child named fuses +const CANNOT_UNWRAP = 1 +const CANNOT_BURN_FUSES = 2 +const CANNOT_TRANSFER = 4 +const CANNOT_SET_RESOLVER = 8 +const CANNOT_SET_TTL = 16 +const CANNOT_CREATE_SUBDOMAIN = 32 + +// parent named fuses +const PARENT_CANNOT_CONTROL = 0x10000 +const IS_DOT_ETH = 0x20000 +const CAN_EXTEND_EXPIRY = 0x40000 + +// fuse ranges +export const CHILD_CONTROLLED_FUSES = 0x0000ffff +export const PARENT_CONTROLLED_FUSES = 0xffff0000 +export const USER_SETTABLE_FUSES = 0xfffdffff + +// empty fuse +const CAN_DO_EVERYTHING = 0 + +export const childFuseEnum = { + CANNOT_UNWRAP, + CANNOT_BURN_FUSES, + CANNOT_TRANSFER, + CANNOT_SET_RESOLVER, + CANNOT_SET_TTL, + CANNOT_CREATE_SUBDOMAIN, +} as const + +export const parentFuseEnum = { + PARENT_CANNOT_CONTROL, + CAN_EXTEND_EXPIRY, +} + +export const fullParentFuseEnum = { + ...parentFuseEnum, + IS_DOT_ETH, +} as const + +export const userSettableFuseEnum = { + ...childFuseEnum, + ...parentFuseEnum, +} as const + +export const fullFuseEnum = { + ...userSettableFuseEnum, + CAN_DO_EVERYTHING, +} + +export const unnamedChildFuses = [ + 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, +] as const + +export const unnamedParentFuses = [ + 0x80000, 0x100000, 0x200000, 0x400000, 0x800000, 0x1000000, 0x2000000, + 0x4000000, 0x8000000, 0x10000000, 0x20000000, 0x40000000, 0x80000000, +] as const + +export const unnamedUserSettableFuses = [ + ...unnamedChildFuses, + ...unnamedParentFuses, +] as const + +export const childFuseKeys = Object.keys( + childFuseEnum, +) as (keyof typeof childFuseEnum)[] +export const parentFuseKeys = Object.keys( + parentFuseEnum, +) as (keyof typeof parentFuseEnum)[] +export const fullParentFuseKeys = Object.keys( + fullParentFuseEnum, +) as (keyof typeof fullParentFuseEnum)[] +export const userSettableFuseKeys = Object.keys( + userSettableFuseEnum, +) as (keyof typeof userSettableFuseEnum)[] + +type FuseType< + Enum extends Record, + UnnamedTuple extends readonly number[], + CustomFuses extends string = never, +> = { + fuse: keyof Enum + options: { -readonly [K in keyof Enum]?: boolean } + current: { [K in keyof Enum]: boolean } & { + readonly [K in CustomFuses]: boolean + } + unnamed: UnnamedTuple + unnamedValues: UnnamedTuple[number] + unnamedObject: { [K in UnnamedTuple[number]]: boolean } +} + +export type ChildFuses = FuseType< + typeof childFuseEnum, + typeof unnamedChildFuses, + 'CAN_DO_EVERYTHING' +> +export type ParentFuses = FuseType< + typeof parentFuseEnum, + typeof unnamedParentFuses +> +export type FullParentFuses = FuseType< + typeof fullParentFuseEnum, + typeof unnamedParentFuses +> +export type UserSettableFuses = FuseType< + typeof userSettableFuseEnum, + typeof unnamedUserSettableFuses +> + +type InputFuses = + | { + named: readonly NamedFuse[] + } + | { + unnamed: readonly UnnamedFuse[] + } + | { + named: readonly NamedFuse[] + unnamed: readonly UnnamedFuse[] + } + | { + number: number + } + +export type CombinedFuseInput = { + child: InputFuses + parent: InputFuses +} + +type FuseRestriction = 'parent' | 'child' + +const checkNumber = (fuses: number) => { + if (fuses > 2 ** 32 || fuses < 1) { + throw new Error( + `Fuse number must be limited to uint32, ${fuses} was too ${ + fuses < 1 ? 'low' : 'high' + }.`, + ) + } else if (fuses % 1 !== 0) { + throw new Error(`Fuse number must be an integer, ${fuses} was not.`) + } else if ((fuses & USER_SETTABLE_FUSES) !== fuses) { + throw new Error( + `Fuse number must be limited to user settable fuses, ${fuses} was not.`, + ) + } +} + +export function encodeFuses(fuses: Partial | number): number +export function encodeFuses( + fuses: CombinedFuseInput['child'], + restrictTo: 'child', +): number +export function encodeFuses( + fuses: CombinedFuseInput['parent'], + restrictTo: 'parent', +): number +export function encodeFuses( + fuses: CombinedFuseInput[T], + restrictTo?: T, +) { + let encodedFuses: number = 0 + + if (typeof fuses === 'number') { + if (restrictTo) { + throw new Error('Cannot specify an exact fuse value when restricted.') + } + checkNumber(fuses) + + encodedFuses = fuses + } else { + let fusesRef = fuses as unknown as CombinedFuseInput + let allowedNamed: readonly UserSettableFuses['fuse'][] = [] + let allowedUnnamed: readonly UserSettableFuses['unnamedValues'][] = [] + + let namedArray: readonly UserSettableFuses['fuse'][] = [] + let unnamedArray: readonly UserSettableFuses['unnamedValues'][] = [] + + if (restrictTo) { + if ('parent' in fuses || 'child' in fuses) { + throw new Error("Can't specify fuse category when restricted.") + } + allowedNamed = restrictTo === 'child' ? childFuseKeys : parentFuseKeys + allowedUnnamed = + restrictTo === 'child' ? unnamedChildFuses : unnamedParentFuses + + fusesRef = { [restrictTo]: fuses } as unknown as CombinedFuseInput + } else { + allowedNamed = userSettableFuseKeys + allowedUnnamed = unnamedUserSettableFuses + } + if ('parent' in fusesRef) { + if ('named' in fusesRef.parent) namedArray = fusesRef.parent.named + if ('unnamed' in fusesRef.parent) unnamedArray = fusesRef.parent.unnamed + if ('number' in fusesRef.parent) { + if ('named' in fusesRef.parent || 'unnamed' in fusesRef.parent) { + throw new Error( + 'Cannot specify both a fuse number and named/unnamed fuses.', + ) + } + checkNumber(fusesRef.parent.number) + + if ( + (fusesRef.parent.number & PARENT_CONTROLLED_FUSES) !== + fusesRef.parent.number + ) { + throw new Error( + "Cannot specify a fuse value to set that is outside of the parent's control.", + ) + } + + encodedFuses |= fusesRef.parent.number + } + } + if ('child' in fusesRef) { + if ('named' in fusesRef.child) + namedArray = [...namedArray, ...fusesRef.child.named] + if ('unnamed' in fusesRef.child) + unnamedArray = [...unnamedArray, ...fusesRef.child.unnamed] + if ('number' in fusesRef.child) { + if ('named' in fusesRef.child || 'unnamed' in fusesRef.child) { + throw new Error( + 'Cannot specify both a fuse number and named/unnamed fuses.', + ) + } + checkNumber(fusesRef.child.number) + + if ( + (fusesRef.child.number & CHILD_CONTROLLED_FUSES) !== + fusesRef.child.number + ) { + throw new Error( + "Cannot specify a fuse value to set that is outside of the owner's control.", + ) + } + + encodedFuses |= fusesRef.child.number + } + } + + if (!namedArray.length && !unnamedArray.length && !encodedFuses) { + throw new Error('Must specify at least one fuse.') + } + + for (const fuse of namedArray) { + if (!allowedNamed.includes(fuse)) { + if (!userSettableFuseKeys.includes(fuse)) { + throw new Error(`${fuse} is not a valid named fuse.`) + } + throw new Error(`Fuse ${fuse} is not allowed for this operation.`) + } + encodedFuses |= userSettableFuseEnum[fuse] + } + for (const fuse of unnamedArray) { + if (!allowedUnnamed.includes(fuse)) { + if (!unnamedUserSettableFuses.includes(fuse)) { + throw new Error( + `${fuse} is not a valid unnamed fuse. If you are trying to set a named fuse, use the named property.`, + ) + } + throw new Error(`Fuse ${fuse} is not allowed for this operation.`) + } + encodedFuses |= fuse + } + } + + return encodedFuses +} + +const decodeNamedFuses = (fuses: number, arr: readonly string[]) => { + const fuseObj = Object.fromEntries( + arr.map((fuse) => [ + fuse, + (fuses & + userSettableFuseEnum[fuse as keyof typeof userSettableFuseEnum]) > + 0, + ]), + ) + + return fuseObj +} + +const decodeUnnamedFuses = (fuses: number, arr: readonly number[]) => { + const fuseObj = Object.fromEntries( + arr.map((fuse) => [fuse, (fuses & fuse) > 0]), + ) + + return fuseObj +} + +export const decodeFuses = (fuses: number) => { + const parentNamedFuses = decodeNamedFuses( + fuses, + fullParentFuseKeys, + ) as FullParentFuses['current'] + const parentUnnamedFuses = decodeUnnamedFuses( + fuses, + unnamedParentFuses, + ) as ParentFuses['unnamedObject'] + + const childNamedFuses = decodeNamedFuses( + fuses, + childFuseKeys, + ) as ChildFuses['current'] + const childUnnamedFuses = decodeUnnamedFuses( + fuses, + unnamedChildFuses, + ) as ChildFuses['unnamedObject'] + + return { + parent: { + ...parentNamedFuses, + unnamed: parentUnnamedFuses, + }, + child: { + ...childNamedFuses, + CAN_DO_EVERYTHING: (fuses & CHILD_CONTROLLED_FUSES) === 0, + unnamed: childUnnamedFuses, + }, + } +} + +export type AllCurrentFuses = ReturnType + +export default fullFuseEnum diff --git a/.yalc/@ensdomains/ensjs/src/utils/hexEncodedName.ts b/.yalc/@ensdomains/ensjs/src/utils/hexEncodedName.ts new file mode 100644 index 000000000..668003c2f --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/utils/hexEncodedName.ts @@ -0,0 +1,4 @@ +import packet from 'dns-packet' + +export const hexEncodeName = (name: string) => + `0x${packet.name.encode(name).toString('hex')}` diff --git a/.yalc/@ensdomains/ensjs/src/utils/labels.ts b/.yalc/@ensdomains/ensjs/src/utils/labels.ts new file mode 100644 index 000000000..5b220fb68 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/utils/labels.ts @@ -0,0 +1,121 @@ +import { keccak256 as solidityKeccak256 } from '@ethersproject/solidity' +import { truncateFormat } from './format' + +const hasLocalStorage = typeof localStorage !== 'undefined' + +export const labelhash = (input: string) => + solidityKeccak256(['string'], [input]) + +export const keccakFromString = (input: string) => labelhash(input) + +export function decodeLabelhash(hash: string) { + if (!(hash.startsWith('[') && hash.endsWith(']'))) { + throw Error( + 'Expected encoded labelhash to start and end with square brackets', + ) + } + + if (hash.length !== 66) { + throw Error('Expected encoded labelhash to have a length of 66') + } + + return `0x${hash.slice(1, -1)}` +} + +export function encodeLabelhash(hash: string) { + if (!hash.startsWith('0x')) { + throw new Error('Expected label hash to start with 0x') + } + + if (hash.length !== 66) { + throw new Error('Expected label hash to have a length of 66') + } + + return `[${hash.slice(2)}]` +} + +export function isEncodedLabelhash(hash: string) { + return hash.startsWith('[') && hash.endsWith(']') && hash.length === 66 +} + +function getLabels() { + return hasLocalStorage + ? JSON.parse(localStorage.getItem('ensjs:labels') as string) || {} + : {} +} + +function _saveLabel(hash: string, label: any) { + if (!hasLocalStorage) return hash + const labels = getLabels() + localStorage.setItem( + 'ensjs:labels', + JSON.stringify({ + ...labels, + [hash]: label, + }), + ) + return hash +} + +export function saveLabel(label: string) { + const hash = `${labelhash(label.toLowerCase())}` + return _saveLabel(hash, label) +} + +export function saveName(name: string) { + const nameArray = name.split('.') + nameArray.forEach((label: any) => { + saveLabel(label) + }) +} + +// eslint-disable-next-line consistent-return +export function checkLabel(hash: string): string | undefined { + const labels = getLabels() + if (isEncodedLabelhash(hash)) { + return labels[decodeLabelhash(hash)] + } + + if (hash.startsWith('0x')) { + return labels[`${hash.slice(2)}`] + } +} + +export function encodeLabel(label: any) { + try { + return encodeLabelhash(label) + } catch { + return label + } +} + +export function parseName(name: string) { + const nameArray = name.split('.') + return nameArray.map((label: any) => encodeLabel(label)).join('.') +} + +export function checkIsDecrypted(string: string | string[]) { + return !string?.includes('[') +} + +export function decryptName(name: string) { + return name + .split('.') + .map((label: any) => checkLabel(label) || label) + .join('.') +} + +export const truncateUndecryptedName = (name: string) => truncateFormat(name) + +export function checkLocalStorageSize() { + if (!hasLocalStorage) return 'Empty (0 KB)' + let allStrings = '' + for (const key in window.localStorage) { + if (Object.prototype.hasOwnProperty.call(window.localStorage, key)) { + allStrings += window.localStorage[key] + } + } + return allStrings + ? `${3 + (allStrings.length * 16) / (8 * 1024)} KB` + : 'Empty (0 KB)' +} diff --git a/.yalc/@ensdomains/ensjs/src/utils/makeHashIndexes.ts b/.yalc/@ensdomains/ensjs/src/utils/makeHashIndexes.ts new file mode 100644 index 000000000..6959259d1 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/utils/makeHashIndexes.ts @@ -0,0 +1,9 @@ +import { namehash } from './normalise' + +export const makeOtherIndexes = (data: string, findStr: string) => + Array.from(data.matchAll(findStr as any)).map((x: any) => x.index / 2 - 1) + +export const makeNamehashIndexes = (data: string, name: string) => + Array.from(data.matchAll(namehash(name).substring(2) as any)).map( + (x: any) => x.index / 2 - 1, + ) diff --git a/.yalc/@ensdomains/ensjs/src/utils/normalise.ts b/.yalc/@ensdomains/ensjs/src/utils/normalise.ts new file mode 100644 index 000000000..8d512670c --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/utils/normalise.ts @@ -0,0 +1,35 @@ +import { concat, hexlify } from '@ethersproject/bytes' +import { keccak256 } from '@ethersproject/keccak256' +import { toUtf8Bytes } from '@ethersproject/strings/lib/utf8' +import uts46 from 'idna-uts46-hx/uts46bundle.js' +import { decodeLabelhash, isEncodedLabelhash } from './labels' + +const zeros = new Uint8Array(32) +zeros.fill(0) + +export const normalise = (name: string) => + name ? uts46.toUnicode(name, { useStd3ASCII: true }) : name + +export const namehash = (name: string): string => { + let result: string | Uint8Array = zeros + + if (name) { + const labels = name.split('.') + + for (let i = labels.length - 1; i >= 0; i -= 1) { + let labelSha: string + if (isEncodedLabelhash(labels[i])) { + labelSha = decodeLabelhash(labels[i]) + } else { + const normalised = normalise(labels[i]) + labelSha = keccak256(toUtf8Bytes(normalised)) + } + + result = keccak256(concat([result, labelSha])) + } + } else { + result = hexlify(zeros) + } + + return result as string +} diff --git a/.yalc/@ensdomains/ensjs/src/utils/recordHelpers.ts b/.yalc/@ensdomains/ensjs/src/utils/recordHelpers.ts new file mode 100644 index 000000000..ac9351314 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/utils/recordHelpers.ts @@ -0,0 +1,173 @@ +import { formatsByCoinType, formatsByName } from '@ensdomains/address-encoder' +import type { BigNumberish } from 'ethers' +import { isBytesLike, toUtf8Bytes } from 'ethers/lib/utils' +import type { PublicResolver } from '../generated' +import { encodeContenthash } from './contentHash' + +type RecordItem = { + key: string + value: string +} + +type ABIEncodeAs = 'json' | 'zlib' | 'cbor' | 'uri' + +type ABIItem = { + contentType?: BigNumberish + data: object | string +} + +export type RecordOptions = { + clearRecords?: boolean + contentHash?: string + texts?: RecordItem[] + coinTypes?: RecordItem[] + abi?: ABIItem +} + +export const generateSetAddr = ( + namehash: string, + coinType: string, + address: string, + resolver: PublicResolver, +) => { + let coinTypeInstance + if (!Number.isNaN(parseInt(coinType))) { + coinTypeInstance = formatsByCoinType[parseInt(coinType)] + } else { + coinTypeInstance = formatsByName[coinType.toUpperCase()] + } + const inputCoinType = coinTypeInstance.coinType + const encodedAddress = coinTypeInstance.decoder(address) + return resolver?.interface.encodeFunctionData( + 'setAddr(bytes32,uint256,bytes)', + [namehash, inputCoinType, encodedAddress], + ) +} + +export const generateABIInput = async ( + encodeAs: ABIEncodeAs, + data: object | string, +) => { + let contentType: number + let encodedData: string | Buffer | Uint8Array + switch (encodeAs) { + case 'json': + contentType = 1 + encodedData = JSON.stringify(data) + break + case 'zlib': { + contentType = 2 + const { deflate } = await import('pako/dist/pako_deflate.min.js') + encodedData = deflate(JSON.stringify(data)) + break + } + case 'cbor': { + contentType = 4 + const { encode } = await import('cbor') + encodedData = encode(data) + break + } + default: { + contentType = 8 + encodedData = data as string + break + } + } + return { contentType, data: encodedData } +} + +export type RecordTypes = 'contentHash' | 'text' | 'addr' | 'abi' + +export type RecordInput = T extends 'contentHash' + ? string + : T extends 'abi' + ? ABIItem + : RecordItem + +export function generateSingleRecordCall( + namehash: string, + resolver: PublicResolver, + type: T, +): (record: RecordInput) => string { + if (type === 'contentHash') { + return (_r: RecordInput) => { + const record = _r as string + let _contentHash = '' + if (record !== _contentHash) { + const encoded = encodeContenthash(record) + if (encoded.error) throw new Error(encoded.error) + _contentHash = encoded.encoded as string + } + return resolver.interface.encodeFunctionData('setContenthash', [ + namehash, + _contentHash, + ]) + } + } + if (type === 'abi') { + return (_r: RecordInput) => { + const record = _r as ABIItem + const { contentType = 1, data } = record + let encodedData = data as string | Uint8Array | Buffer + if (!isBytesLike(encodedData)) { + if (typeof encodedData === 'object') { + encodedData = JSON.stringify(encodedData) + } + encodedData = toUtf8Bytes(encodedData) + } + return resolver.interface.encodeFunctionData('setABI', [ + namehash, + contentType, + encodedData, + ]) + } + } + return (_r: RecordInput) => { + const record = _r as RecordItem + if (type === 'text') { + return resolver.interface.encodeFunctionData('setText', [ + namehash, + record.key, + record.value, + ]) + } + return generateSetAddr(namehash, record.key, record.value, resolver) + } +} + +export const generateRecordCallArray = ( + namehash: string, + records: RecordOptions, + resolver: PublicResolver, +) => { + const calls: string[] = [] + + if (records.clearRecords) { + calls.push( + resolver.interface.encodeFunctionData('clearRecords', [namehash]), + ) + } + + if (records.contentHash) { + const data = generateSingleRecordCall( + namehash, + resolver, + 'contentHash', + )(records.contentHash) + if (data) calls.push(data) + } + + if (records.texts && records.texts.length > 0) { + records.texts + .map(generateSingleRecordCall(namehash, resolver, 'text')) + .forEach((call) => calls.push(call)) + } + + if (records.coinTypes && records.coinTypes.length > 0) { + records.coinTypes + .map(generateSingleRecordCall(namehash, resolver, 'addr')) + .forEach((call) => calls.push(call)) + } + + return calls +} diff --git a/.yalc/@ensdomains/ensjs/src/utils/registerHelpers.ts b/.yalc/@ensdomains/ensjs/src/utils/registerHelpers.ts new file mode 100644 index 000000000..253652bd6 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/utils/registerHelpers.ts @@ -0,0 +1,129 @@ +import { defaultAbiCoder } from '@ethersproject/abi/lib/abi-coder' +import { keccak256 } from '@ethersproject/keccak256' +import type { PublicResolver } from '../generated' +import { CombinedFuseInput, encodeFuses } from './fuses' +import { labelhash } from './labels' +import { namehash } from './normalise' +import { generateRecordCallArray, RecordOptions } from './recordHelpers' + +export type BaseRegistrationParams = { + owner: string + duration: number + secret: string + resolverAddress?: string + records?: RecordOptions + reverseRecord?: boolean + fuses?: CombinedFuseInput['child'] +} + +export type RegistrationParams = Omit< + BaseRegistrationParams, + 'resolverAddress' +> & { + name: string + resolver: PublicResolver +} + +export type CommitmentParams = Omit & { + secret?: string +} + +export type RegistrationTuple = [ + name: string, + owner: string, + duration: number, + secret: string, + resolver: string, + data: string[], + reverseRecord: boolean, + ownerControlledFuses: number, +] + +export const randomSecret = () => { + const bytes = Buffer.allocUnsafe(32) + return `0x${crypto.getRandomValues(bytes).toString('hex')}` +} + +export const makeCommitmentData = ({ + name, + owner, + duration, + resolver, + records, + reverseRecord, + fuses, + secret, +}: CommitmentParams & { + secret: string +}): RegistrationTuple => { + const labelHash = labelhash(name.split('.')[0]) + const hash = namehash(name) + const resolverAddress = resolver.address + const fuseData = fuses ? encodeFuses(fuses, 'child') : 0 + + if (reverseRecord) { + if (!records) { + records = { coinTypes: [{ key: 'ETH', value: owner }] } + } else if (!records.coinTypes?.find((c) => c.key === 'ETH')) { + if (!records.coinTypes) records.coinTypes = [] + records.coinTypes.push({ key: 'ETH', value: owner }) + } + } + + const data = records ? generateRecordCallArray(hash, records, resolver) : [] + + return [ + labelHash, + owner, + duration, + secret, + resolverAddress, + data, + !!reverseRecord, + fuseData, + ] +} + +export const makeRegistrationData = ( + params: RegistrationParams, +): RegistrationTuple => { + const commitmentData = makeCommitmentData(params) + const label = params.name.split('.')[0] + commitmentData[0] = label + return commitmentData +} + +export const _makeCommitment = (params: RegistrationTuple) => { + return keccak256( + defaultAbiCoder.encode( + [ + 'bytes32', + 'address', + 'uint256', + 'bytes32', + 'address', + 'bytes[]', + 'bool', + 'uint16', + ], + params, + ), + ) +} + +export const makeCommitment = ({ + secret = randomSecret(), + ...inputParams +}: CommitmentParams) => { + const generatedParams = makeCommitmentData({ + ...inputParams, + secret, + }) + + const commitment = _makeCommitment(generatedParams) + + return { + secret, + commitment, + } +} diff --git a/.yalc/@ensdomains/ensjs/src/utils/singleCall.ts b/.yalc/@ensdomains/ensjs/src/utils/singleCall.ts new file mode 100644 index 000000000..02706c68c --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/utils/singleCall.ts @@ -0,0 +1,16 @@ +import type { Provider } from '@ethersproject/providers' + +export default async ( + provider: Provider, + ensData: any, + func: { + raw: (...args: any[]) => Promise<{ to: string; data: string }> + decode: (...args: any[]) => Promise + }, + ...data: any[] +) => + func + .raw(ensData, ...data) + .then((rawData) => provider.call({ ...rawData, ccipReadEnabled: true })) + .catch(() => null) + .then((ret) => func.decode(ensData, ret, ...data)) diff --git a/.yalc/@ensdomains/ensjs/src/utils/subgraph-types.ts b/.yalc/@ensdomains/ensjs/src/utils/subgraph-types.ts new file mode 100644 index 000000000..b875cc55f --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/utils/subgraph-types.ts @@ -0,0 +1,312 @@ +export type Maybe = T | null +export type Exact = { + [K in keyof T]: T[K] +} +export type MakeOptional = Omit & { + [SubKey in K]?: Maybe +} +export type MakeMaybe = Omit & { + [SubKey in K]: Maybe +} +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: string + String: string + Boolean: boolean + Int: number + Float: number + Bytes: string + BigInt: string +} + +export type Domain = { + __typename?: 'Domain' + id: Scalars['ID'] + name?: Maybe + labelName?: Maybe + labelhash?: Maybe + parent?: Maybe + subdomains: Array + subdomainCount: Scalars['Int'] + resolvedAddress?: Maybe + owner: Account + resolver?: Maybe + ttl?: Maybe + isMigrated: Scalars['Boolean'] + createdAt: Scalars['BigInt'] + events: Array + registration?: Maybe + wrappedDomain?: Maybe +} + +export type DomainEvent = { + id: Scalars['ID'] + domain: Domain + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] +} + +export type Transfer = DomainEvent & { + __typename?: 'Transfer' + id: Scalars['ID'] + domain: Domain + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] + owner: Account +} + +export type NewOwner = DomainEvent & { + __typename?: 'NewOwner' + id: Scalars['ID'] + parentDomain: Domain + domain: Domain + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] + owner: Account +} + +export type NewResolver = DomainEvent & { + __typename?: 'NewResolver' + id: Scalars['ID'] + domain: Domain + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] + resolver: Resolver +} + +export type NewTtl = DomainEvent & { + __typename?: 'NewTTL' + id: Scalars['ID'] + domain: Domain + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] + ttl: Scalars['BigInt'] +} + +export type WrappedTransfer = DomainEvent & { + __typename?: 'WrappedTransfer' + id: Scalars['ID'] + domain: Domain + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] + owner: Account +} + +export type NameWrapped = DomainEvent & { + __typename?: 'NameWrapped' + id: Scalars['ID'] + domain: Domain + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] + name: Scalars['String'] + fuses: Scalars['Int'] + owner: Account + expiryDate: Scalars['BigInt'] +} + +export type NameUnwrapped = DomainEvent & { + __typename?: 'NameUnwrapped' + id: Scalars['ID'] + domain: Domain + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] + owner: Account +} + +export type FusesSet = DomainEvent & { + __typename?: 'FusesSet' + id: Scalars['ID'] + domain: Domain + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] + fuses: Scalars['Int'] +} + +export type ExpiryExtended = DomainEvent & { + __typename?: 'ExpiryExtended' + id: Scalars['ID'] + domain: Domain + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] + expiryDate: Scalars['BigInt'] +} + +export type Registration = { + __typename?: 'Registration' + id: Scalars['ID'] + domain: Domain + registrationDate: Scalars['BigInt'] + expiryDate: Scalars['BigInt'] + cost?: Maybe + registrant: Account + labelName?: Maybe + events: Array +} + +export type RegistrationEvent = { + id: Scalars['ID'] + registration: Registration + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] +} + +export type NameRegistered = RegistrationEvent & { + __typename?: 'NameRegistered' + id: Scalars['ID'] + registration: Registration + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] + registrant: Account + expiryDate: Scalars['BigInt'] +} + +export type NameRenewed = RegistrationEvent & { + __typename?: 'NameRenewed' + id: Scalars['ID'] + registration: Registration + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] + expiryDate: Scalars['BigInt'] +} + +export type NameTransferred = RegistrationEvent & { + __typename?: 'NameTransferred' + id: Scalars['ID'] + registration: Registration + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] + newOwner: Account +} + +export type WrappedDomain = { + __typename?: 'WrappedDomain' + id: Scalars['ID'] + domain: Domain + expiryDate: Scalars['BigInt'] + fuses: Scalars['Int'] + owner: Account + name?: Maybe +} + +export type Account = { + __typename?: 'Account' + id: Scalars['ID'] + domains: Array + wrappedDomains?: Maybe> + registrations?: Maybe> +} + +export type Resolver = { + __typename?: 'Resolver' + id: Scalars['ID'] + domain?: Maybe + address: Scalars['Bytes'] + addr?: Maybe + contentHash?: Maybe + texts?: Maybe> + coinTypes?: Maybe> + events: Array +} + +export type ResolverEvent = { + id: Scalars['ID'] + resolver: Resolver + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] +} + +export type AddrChanged = ResolverEvent & { + __typename?: 'AddrChanged' + id: Scalars['ID'] + resolver: Resolver + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] + addr: Account +} + +export type MulticoinAddrChanged = ResolverEvent & { + __typename?: 'MulticoinAddrChanged' + id: Scalars['ID'] + resolver: Resolver + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] + coinType: Scalars['BigInt'] + addr: Scalars['Bytes'] +} + +export type NameChanged = ResolverEvent & { + __typename?: 'NameChanged' + id: Scalars['ID'] + resolver: Resolver + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] + name: Scalars['String'] +} + +export type AbiChanged = ResolverEvent & { + __typename?: 'AbiChanged' + id: Scalars['ID'] + resolver: Resolver + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] + contentType: Scalars['BigInt'] +} + +export type PubkeyChanged = ResolverEvent & { + __typename?: 'PubkeyChanged' + id: Scalars['ID'] + resolver: Resolver + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] + x: Scalars['Bytes'] + y: Scalars['Bytes'] +} + +export type TextChanged = ResolverEvent & { + __typename?: 'TextChanged' + id: Scalars['ID'] + resolver: Resolver + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] + key: Scalars['String'] + value?: Maybe +} + +export type ContenthashChanged = ResolverEvent & { + __typename?: 'ContenthashChanged' + id: Scalars['ID'] + resolver: Resolver + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] + hash: Scalars['Bytes'] +} + +export type InterfaceChanged = ResolverEvent & { + __typename?: 'InterfaceChanged' + id: Scalars['ID'] + resolver: Resolver + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] + interfaceID: Scalars['Bytes'] + implementer: Scalars['Bytes'] +} + +export type AuthorisationChanged = ResolverEvent & { + __typename?: 'AuthorisationChanged' + id: Scalars['ID'] + resolver: Resolver + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] + owner: Scalars['Bytes'] + target: Scalars['Bytes'] + isAuthorized: Scalars['Boolean'] +} + +export type VersionChanged = ResolverEvent & { + __typename?: 'VersionChanged' + id: Scalars['ID'] + resolver: Resolver + blockNumber: Scalars['Int'] + transactionID: Scalars['Bytes'] + version: Scalars['BigInt'] +} diff --git a/.yalc/@ensdomains/ensjs/src/utils/validation.ts b/.yalc/@ensdomains/ensjs/src/utils/validation.ts new file mode 100644 index 000000000..74dd6413d --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/utils/validation.ts @@ -0,0 +1,72 @@ +import { isAddress } from '@ethersproject/address' +import { isEncodedLabelhash, saveName } from './labels' +import { normalise } from './normalise' + +export const validateName = (name: string) => { + const nameArray = name.split('.') + const hasEmptyLabels = nameArray.some((label) => label.length === 0) + if (hasEmptyLabels) throw new Error('Name cannot have empty labels') + const normalizedArray = nameArray.map((label) => { + if (label === '[root]') { + return label + } + return isEncodedLabelhash(label) ? label : normalise(label) + }) + const normalizedName = normalizedArray.join('.') + saveName(normalizedName) + return normalizedName +} + +export const validateTLD = (name: string) => { + const labels = name.split('.') + return validateName(labels[labels.length - 1]) +} + +type InputType = { + type: 'name' | 'label' | 'address' | 'unknown' + info?: 'short' | 'supported' | 'unsupported' +} + +export const parseInputType = (input: string): InputType => { + const validTLD = validateTLD(input) + const regex = /[^.]+$/ + + try { + validateName(input) + } catch (e) { + return { + type: 'unknown', + } + } + + if (input.indexOf('.') !== -1) { + const termArray = input.split('.') + const tld = input.match(regex) ? input.match(regex)![0] : '' + if (validTLD) { + if (tld === 'eth' && [...termArray[termArray.length - 2]].length < 3) { + // code-point length + return { + type: 'name', + info: 'short', + } + } + return { + type: 'name', + info: 'supported', + } + } + + return { + type: 'name', + info: 'unsupported', + } + } + if (isAddress(input)) { + return { + type: 'address', + } + } + return { + type: 'label', + } +} diff --git a/.yalc/@ensdomains/ensjs/src/utils/wrapper.ts b/.yalc/@ensdomains/ensjs/src/utils/wrapper.ts new file mode 100644 index 000000000..cb0e9b59a --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/utils/wrapper.ts @@ -0,0 +1,36 @@ +import { BigNumber } from '@ethersproject/bignumber/lib/bignumber' +import { toUtf8Bytes } from '@ethersproject/strings/lib/utf8' +import { ENSArgs } from '../index' + +export type Expiry = string | number | Date | BigNumber + +export const MAX_EXPIRY = BigNumber.from(2).pow(64).sub(1) + +export const makeExpiry = async ( + { getExpiry }: ENSArgs<'getExpiry'>, + name: string, + expiry?: Expiry, +) => { + if (expiry) { + if (expiry instanceof Date) { + return BigNumber.from(expiry.getTime() / 1000) + } + if (expiry instanceof BigNumber) { + return expiry + } + return BigNumber.from(expiry) + } + if (name.endsWith('.eth')) { + const expResponse = await getExpiry(name) + if (!expResponse?.expiry) + throw new Error("Couldn't get expiry for name, please provide one.") + return BigNumber.from(expResponse.expiry.getTime() / 1000) + } + return MAX_EXPIRY +} + +export const wrappedLabelLengthCheck = (label: string) => { + const bytes = toUtf8Bytes(label) + if (bytes.byteLength > 255) + throw new Error("Label can't be longer than 255 bytes") +} diff --git a/.yalc/@ensdomains/ensjs/src/utils/writeTx.ts b/.yalc/@ensdomains/ensjs/src/utils/writeTx.ts new file mode 100644 index 000000000..da60992c5 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/src/utils/writeTx.ts @@ -0,0 +1,16 @@ +import type { PopulatedTransaction } from '@ethersproject/contracts' +import type { JsonRpcSigner } from '@ethersproject/providers' + +type CustomData = Record + +const withCustomData = ( + tx: T, + customData: CustomData | undefined, +): (T & { customData: CustomData }) | T => + customData ? { ...tx, customData } : tx + +export default (signer: JsonRpcSigner, populate: boolean) => + ({ customData, ...tx }: PopulatedTransaction) => + populate + ? withCustomData(tx, customData) + : signer.sendTransaction(tx).then((r) => withCustomData(r, customData)) diff --git a/.yalc/@ensdomains/ensjs/yalc.sig b/.yalc/@ensdomains/ensjs/yalc.sig new file mode 100644 index 000000000..5e2e11e17 --- /dev/null +++ b/.yalc/@ensdomains/ensjs/yalc.sig @@ -0,0 +1 @@ +a48202939e398afd18e432ee23beb45d \ No newline at end of file diff --git a/package.json b/package.json index a9d2c5325..09dcea38c 100644 --- a/package.json +++ b/package.json @@ -51,9 +51,9 @@ "@ensdomains/content-hash": "^2.5.7", "@ensdomains/dnsprovejs": "0.4.1", "@ensdomains/dnssecoraclejs": "^0.2.7", - "@ensdomains/ens-contracts": "0.0.15", + "@ensdomains/ens-contracts": "0.0.16", "@ensdomains/ens-validation": "^0.1.0", - "@ensdomains/ensjs": "3.0.0-alpha.37", + "@ensdomains/ensjs": "file:.yalc/@ensdomains/ensjs", "@ensdomains/eth-ens-namehash": "^2.0.15", "@ensdomains/thorin": "^0.6.23-alpha-4", "@rainbow-me/rainbowkit": "0.4.8", @@ -198,4 +198,4 @@ "@synthetixio/synpress@3.0.5": "patches/@synthetixio__synpress@3.0.5.patch" } } -} \ No newline at end of file +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2000ff74a..7e2a49229 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -35,10 +35,10 @@ importers: '@ensdomains/content-hash': ^2.5.7 '@ensdomains/dnsprovejs': 0.4.1 '@ensdomains/dnssecoraclejs': ^0.2.7 - '@ensdomains/ens-contracts': 0.0.15 + '@ensdomains/ens-contracts': 0.0.16 '@ensdomains/ens-test-env': ^0.3.6 '@ensdomains/ens-validation': ^0.1.0 - '@ensdomains/ensjs': 3.0.0-alpha.37 + '@ensdomains/ensjs': file:.yalc/@ensdomains/ensjs '@ensdomains/eth-ens-namehash': ^2.0.15 '@ensdomains/thorin': ^0.6.23-alpha-4 '@ethersproject/providers': ^5.7.0 @@ -155,9 +155,9 @@ importers: '@ensdomains/content-hash': 2.5.7 '@ensdomains/dnsprovejs': 0.4.1 '@ensdomains/dnssecoraclejs': 0.2.7_kdpqpin542yrq2nndtznhtz4cm - '@ensdomains/ens-contracts': 0.0.15_hardhat@2.11.2 + '@ensdomains/ens-contracts': 0.0.16_hardhat@2.11.2 '@ensdomains/ens-validation': 0.1.0 - '@ensdomains/ensjs': 3.0.0-alpha.37_kdpqpin542yrq2nndtznhtz4cm + '@ensdomains/ensjs': file:.yalc/@ensdomains/ensjs_ieqas7m66pmgjq3ruwnquy4qyq '@ensdomains/eth-ens-namehash': 2.0.15 '@ensdomains/thorin': 0.6.23-alpha-4_6haozuff5ofofiwuoke6ixqiri '@rainbow-me/rainbowkit': 0.4.8_zczigdeajjlj6h32kv7vfprn2y_wiydppdk2wtsgvuygzl3yf3yma @@ -276,6 +276,32 @@ importers: wrangler: 2.1.10 yalc: 1.0.0-pre.53 + .yalc/@ensdomains/ensjs: + specifiers: + '@ensdomains/address-encoder': ^0.2.18 + '@ensdomains/content-hash': ^2.5.7 + '@ensdomains/dnsprovejs': ^0.4.1 + '@ensdomains/dnssecoraclejs': ^0.2.7 + cbor: ^8.1.0 + dns-packet: ^5.3.1 + graphql: ^16.3.0 + graphql-request: next + idna-uts46-hx: 3.4.0 + pako: ^2.1.0 + traverse: ^0.6.6 + dependencies: + '@ensdomains/address-encoder': 0.2.20 + '@ensdomains/content-hash': 2.5.7 + '@ensdomains/dnsprovejs': 0.4.1 + '@ensdomains/dnssecoraclejs': 0.2.7 + cbor: 8.1.0 + dns-packet: 5.4.0 + graphql: 16.6.0 + graphql-request: 5.1.1-next.1_graphql@16.6.0 + idna-uts46-hx: 3.4.0 + pako: 2.1.0 + traverse: 0.6.7 + packages: /@adobe/css-tools/4.0.1: @@ -2092,6 +2118,24 @@ packages: resolution: {integrity: sha512-EOFqiWnN36EyyBAgHFTsabFcFICUALt41SiDm/4pAw4V36R4lD4wHcnZcqCYki9m1fMaeWGHrdqxmrMa8iiSTQ==} dev: false + /@ensdomains/buffer/0.0.13: + resolution: {integrity: sha512-8aA+U/e4S54ebPwcge1HHvvpgXLKxPd6EOSegMlrTvBnKB8RwB3OpNyflaikD6KqzIwDaBaH8bvnTrMcfpV7oQ==} + dependencies: + '@nomiclabs/hardhat-truffle5': 2.0.7 + transitivePeerDependencies: + - '@nomiclabs/hardhat-web3' + - bufferutil + - encoding + - hardhat + - supports-color + - utf-8-validate + - web3 + - web3-core-helpers + - web3-core-promievent + - web3-eth-abi + - web3-utils + dev: false + /@ensdomains/buffer/0.0.13_hardhat@2.11.2: resolution: {integrity: sha512-8aA+U/e4S54ebPwcge1HHvvpgXLKxPd6EOSegMlrTvBnKB8RwB3OpNyflaikD6KqzIwDaBaH8bvnTrMcfpV7oQ==} dependencies: @@ -2145,6 +2189,31 @@ packages: typescript-logging: 1.0.1 dev: false + /@ensdomains/dnssecoraclejs/0.2.7: + resolution: {integrity: sha512-k2DDXAwAI/gjEBTu4vsIvjeL+TcfJ6JkVgC0X7KHlccBCNT/vQMiwvExtFWwGtt3aHPXjLTVehzvM4VZcu1Xow==} + dependencies: + '@ensdomains/dnsprovejs': 0.4.1 + '@ensdomains/ens-contracts': 0.0.7 + dns-packet: 5.4.0 + dotenv: 8.6.0 + ethers: 5.7.2 + typescript-logging: 1.0.1 + transitivePeerDependencies: + - '@nomiclabs/hardhat-web3' + - bufferutil + - encoding + - hardhat + - supports-color + - ts-node + - typescript + - utf-8-validate + - web3 + - web3-core-helpers + - web3-core-promievent + - web3-eth-abi + - web3-utils + dev: false + /@ensdomains/dnssecoraclejs/0.2.7_kdpqpin542yrq2nndtznhtz4cm: resolution: {integrity: sha512-k2DDXAwAI/gjEBTu4vsIvjeL+TcfJ6JkVgC0X7KHlccBCNT/vQMiwvExtFWwGtt3aHPXjLTVehzvM4VZcu1Xow==} dependencies: @@ -2170,8 +2239,8 @@ packages: - web3-utils dev: false - /@ensdomains/ens-contracts/0.0.15_hardhat@2.11.2: - resolution: {integrity: sha512-fOmGylPbsHWjhD3iXz1pyi5VuyW25ahbjjUIjaKwC5MBULJYJDFb2sHlK8P4bxVep2pTGfV3XUhdFVMiEE4LLQ==} + /@ensdomains/ens-contracts/0.0.16_hardhat@2.11.2: + resolution: {integrity: sha512-pssd2nrzHoFJOvzANoBVNMdb9H9tpyMPSyb9JaTFmS6HDo7RRcsyWL8FYCGkUmsnAqzz8dz3OwxiH03s8cLG2A==} dependencies: '@ensdomains/buffer': 0.0.13_hardhat@2.11.2 '@ensdomains/solsha1': 0.0.3 @@ -2198,6 +2267,30 @@ packages: '@openzeppelin/contracts': 4.7.3 dev: false + /@ensdomains/ens-contracts/0.0.7: + resolution: {integrity: sha512-adlWSrtBh85CNM1hsrsNxWrSx6g37DOCkWP5vBT/HtXnpNtvL49Z1Ueum55lN8YifTWo2Kqb1mgPojjLY99f5w==} + dependencies: + '@ensdomains/buffer': 0.0.13 + '@ensdomains/solsha1': 0.0.3 + '@openzeppelin/contracts': 4.7.3 + dns-packet: 5.4.0 + name-wrapper: 1.0.0 + transitivePeerDependencies: + - '@nomiclabs/hardhat-web3' + - bufferutil + - encoding + - hardhat + - supports-color + - ts-node + - typescript + - utf-8-validate + - web3 + - web3-core-helpers + - web3-core-promievent + - web3-eth-abi + - web3-utils + dev: false + /@ensdomains/ens-contracts/0.0.7_kdpqpin542yrq2nndtznhtz4cm: resolution: {integrity: sha512-adlWSrtBh85CNM1hsrsNxWrSx6g37DOCkWP5vBT/HtXnpNtvL49Z1Ueum55lN8YifTWo2Kqb1mgPojjLY99f5w==} dependencies: @@ -2275,35 +2368,6 @@ packages: - bufferutil - utf-8-validate - /@ensdomains/ensjs/3.0.0-alpha.37_kdpqpin542yrq2nndtznhtz4cm: - resolution: {integrity: sha512-qO/1lSDCT3QB4p2+phagpovYoGR8oRDRjKVDmaik0IdqFtC6HabXGVRIUIKUbiyk+/2tmG8VXIxFdLIvi18LAA==} - dependencies: - '@ensdomains/address-encoder': 0.2.20 - '@ensdomains/content-hash': 2.5.7 - '@ensdomains/dnsprovejs': 0.4.1 - '@ensdomains/dnssecoraclejs': 0.2.7_kdpqpin542yrq2nndtznhtz4cm - dns-packet: 5.4.0 - ethers: 5.7.2 - graphql: 16.6.0 - graphql-request: 5.1.1-next.1_graphql@16.6.0 - idna-uts46-hx: 3.4.0 - traverse: 0.6.7 - transitivePeerDependencies: - - '@nomiclabs/hardhat-web3' - - bufferutil - - encoding - - hardhat - - supports-color - - ts-node - - typescript - - utf-8-validate - - web3 - - web3-core-helpers - - web3-core-promievent - - web3-eth-abi - - web3-utils - dev: false - /@ensdomains/eth-ens-namehash/2.0.15: resolution: {integrity: sha512-JRDFP6+Hczb1E0/HhIg0PONgBYasfGfDheujmfxaZaAv/NAH4jE6Kf48WbqfRZdxt4IZI3jl3Ri7sZ1nP09lgw==} dev: false @@ -2401,13 +2465,36 @@ packages: - utf-8-validate dev: false + /@ethereum-waffle/compiler/3.4.4: + resolution: {integrity: sha512-RUK3axJ8IkD5xpWjWoJgyHclOeEzDLQFga6gKpeGxiS/zBu+HB0W2FvsrrLalTFIaPw/CGYACRBSIxqiCqwqTQ==} + engines: {node: '>=10.0'} + dependencies: + '@resolver-engine/imports': 0.3.3 + '@resolver-engine/imports-fs': 0.3.3 + '@typechain/ethers-v5': 2.0.0_qm5qgbtbzj2awa7q5l4ce4se5a + '@types/mkdirp': 0.5.2 + '@types/node-fetch': 2.6.2 + ethers: 5.7.2 + mkdirp: 0.5.6 + node-fetch: 2.6.7 + solc: 0.6.12 + ts-generator: 0.1.1 + typechain: 3.0.0 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - typescript + - utf-8-validate + dev: false + /@ethereum-waffle/compiler/3.4.4_typescript@4.8.4: resolution: {integrity: sha512-RUK3axJ8IkD5xpWjWoJgyHclOeEzDLQFga6gKpeGxiS/zBu+HB0W2FvsrrLalTFIaPw/CGYACRBSIxqiCqwqTQ==} engines: {node: '>=10.0'} dependencies: '@resolver-engine/imports': 0.3.3 '@resolver-engine/imports-fs': 0.3.3 - '@typechain/ethers-v5': 2.0.0_typechain@3.0.0 + '@typechain/ethers-v5': 2.0.0_qm5qgbtbzj2awa7q5l4ce4se5a '@types/mkdirp': 0.5.2 '@types/node-fetch': 2.6.2 ethers: 5.7.2 @@ -3784,6 +3871,29 @@ packages: '@nomicfoundation/solidity-analyzer-win32-ia32-msvc': 0.0.3 '@nomicfoundation/solidity-analyzer-win32-x64-msvc': 0.0.3 + /@nomiclabs/hardhat-truffle5/2.0.7: + resolution: {integrity: sha512-Pw8451IUZp1bTp0QqCHCYfCHs66sCnyxPcaorapu9mfOV9xnZsVaFdtutnhNEiXdiZwbed7LFKpRsde4BjFwig==} + peerDependencies: + '@nomiclabs/hardhat-web3': ^2.0.0 + hardhat: ^2.6.4 + web3: ^1.0.0-beta.36 + dependencies: + '@nomiclabs/truffle-contract': 4.5.10 + '@types/chai': 4.3.3 + chai: 4.3.6 + ethereumjs-util: 7.1.5 + fs-extra: 7.0.1 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - utf-8-validate + - web3-core-helpers + - web3-core-promievent + - web3-eth-abi + - web3-utils + dev: false + /@nomiclabs/hardhat-truffle5/2.0.7_hardhat@2.11.2: resolution: {integrity: sha512-Pw8451IUZp1bTp0QqCHCYfCHs66sCnyxPcaorapu9mfOV9xnZsVaFdtutnhNEiXdiZwbed7LFKpRsde4BjFwig==} peerDependencies: @@ -3818,9 +3928,9 @@ packages: '@nomiclabs/hardhat-ethers': /hardhat-deploy-ethers/0.3.0-beta.13_vf54o5zygcw7cr76twqof3t24a '@types/sinon-chai': 3.2.8 '@types/web3': 1.0.19 - ethereum-waffle: 3.4.4_typescript@4.8.4 + ethereum-waffle: 3.4.4 ethers: 5.7.2 - hardhat: 2.11.2_mwhvu7sfp6vq5ryuwb6hlbjfka + hardhat: 2.11.2 dev: false /@nomiclabs/truffle-contract/4.5.10: @@ -4997,16 +5107,14 @@ packages: /@tsconfig/node16/1.0.3: resolution: {integrity: sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==} - /@typechain/ethers-v5/2.0.0_typechain@3.0.0: + /@typechain/ethers-v5/2.0.0_qm5qgbtbzj2awa7q5l4ce4se5a: resolution: {integrity: sha512-0xdCkyGOzdqh4h5JSf+zoWx85IusEjDcPIwNEHP8mrWSnCae4rvrqB+/gtpdNfX7zjlFlZiMeePn2r63EI3Lrw==} peerDependencies: + ethers: ^5.0.0 typechain: ^3.0.0 dependencies: ethers: 5.7.2 - typechain: 3.0.0_typescript@4.8.4 - transitivePeerDependencies: - - bufferutil - - utf-8-validate + typechain: 3.0.0 dev: false /@types/aria-query/4.2.2: @@ -8055,6 +8163,13 @@ packages: bignumber.js: 9.1.0 nofilter: 1.0.4 + /cbor/8.1.0: + resolution: {integrity: sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg==} + engines: {node: '>=12.19'} + dependencies: + nofilter: 3.1.0 + dev: false + /chai-bn/0.2.2_chai@4.3.6: resolution: {integrity: sha512-MzjelH0p8vWn65QKmEq/DLBG1Hle4WeyqT79ANhXZhn/UxRWO0OogkAxi5oGGtfzwU9bZR8mvbvYdoqNVWQwFg==} peerDependencies: @@ -11095,6 +11210,24 @@ packages: - supports-color - utf-8-validate + /ethereum-waffle/3.4.4: + resolution: {integrity: sha512-PA9+jCjw4WC3Oc5ocSMBj5sXvueWQeAbvCA+hUlb6oFgwwKyq5ka3bWQ7QZcjzIX+TdFkxP4IbFmoY2D8Dkj9Q==} + engines: {node: '>=10.0'} + hasBin: true + dependencies: + '@ethereum-waffle/chai': 3.4.4 + '@ethereum-waffle/compiler': 3.4.4 + '@ethereum-waffle/mock-contract': 3.4.4 + '@ethereum-waffle/provider': 3.4.4 + ethers: 5.7.2 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - typescript + - utf-8-validate + dev: false + /ethereum-waffle/3.4.4_typescript@4.8.4: resolution: {integrity: sha512-PA9+jCjw4WC3Oc5ocSMBj5sXvueWQeAbvCA+hUlb6oFgwwKyq5ka3bWQ7QZcjzIX+TdFkxP4IbFmoY2D8Dkj9Q==} engines: {node: '>=10.0'} @@ -12974,7 +13107,7 @@ packages: hardhat: ^2.0.0 dependencies: ethers: 5.7.2 - hardhat: 2.11.2_mwhvu7sfp6vq5ryuwb6hlbjfka + hardhat: 2.11.2 dev: false /hardhat-deploy/0.11.16: @@ -12999,6 +13132,75 @@ packages: - utf-8-validate dev: true + /hardhat/2.11.2: + resolution: {integrity: sha512-BdsXC1CFJQDJKmAgCwpmGhFuVU6dcqlgMgT0Kg/xmFAFVugkpYu6NRmh4AaJ3Fah0/BR9DOR4XgQGIbg4eon/Q==} + engines: {node: ^14.0.0 || ^16.0.0 || ^18.0.0} + hasBin: true + peerDependencies: + ts-node: '*' + typescript: '*' + peerDependenciesMeta: + ts-node: + optional: true + typescript: + optional: true + dependencies: + '@ethersproject/abi': 5.7.0 + '@metamask/eth-sig-util': 4.0.1 + '@nomicfoundation/ethereumjs-block': 4.0.0 + '@nomicfoundation/ethereumjs-blockchain': 6.0.0 + '@nomicfoundation/ethereumjs-common': 3.0.0 + '@nomicfoundation/ethereumjs-evm': 1.0.0 + '@nomicfoundation/ethereumjs-rlp': 4.0.0 + '@nomicfoundation/ethereumjs-statemanager': 1.0.0 + '@nomicfoundation/ethereumjs-trie': 5.0.0 + '@nomicfoundation/ethereumjs-tx': 4.0.0 + '@nomicfoundation/ethereumjs-util': 8.0.0 + '@nomicfoundation/ethereumjs-vm': 6.0.0 + '@nomicfoundation/solidity-analyzer': 0.0.3 + '@sentry/node': 5.30.0 + '@types/bn.js': 5.1.1 + '@types/lru-cache': 5.1.1 + abort-controller: 3.0.0 + adm-zip: 0.4.16 + aggregate-error: 3.1.0 + ansi-escapes: 4.3.2 + chalk: 2.4.2 + chokidar: 3.5.3 + ci-info: 2.0.0 + debug: 4.3.4 + enquirer: 2.3.6 + env-paths: 2.2.1 + ethereum-cryptography: 1.1.2 + ethereumjs-abi: 0.6.8 + find-up: 2.1.0 + fp-ts: 1.19.3 + fs-extra: 7.0.1 + glob: 7.2.0 + immutable: 4.1.0 + io-ts: 1.10.4 + keccak: 3.0.2 + lodash: 4.17.21 + mnemonist: 0.38.5 + mocha: 10.0.0 + p-map: 4.0.0 + qs: 6.11.0 + raw-body: 2.5.1 + resolve: 1.17.0 + semver: 6.3.0 + solc: 0.7.3_debug@4.3.4 + source-map-support: 0.5.21 + stacktrace-parser: 0.1.10 + tsort: 0.0.1 + undici: 5.11.0 + uuid: 8.3.2 + ws: 7.5.9 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: false + /hardhat/2.11.2_mwhvu7sfp6vq5ryuwb6hlbjfka: resolution: {integrity: sha512-BdsXC1CFJQDJKmAgCwpmGhFuVU6dcqlgMgT0Kg/xmFAFVugkpYu6NRmh4AaJ3Fah0/BR9DOR4XgQGIbg4eon/Q==} engines: {node: ^14.0.0 || ^16.0.0 || ^18.0.0} @@ -14292,13 +14494,13 @@ packages: '@types/connect': 3.4.35 '@types/node': 12.20.55 '@types/ws': 7.4.7 + JSONStream: 1.3.5 commander: 2.20.3 delay: 5.0.0 es6-promisify: 5.0.0 eyes: 0.1.8 isomorphic-ws: 4.0.1_ws@7.5.9 json-stringify-safe: 5.0.1 - JSONStream: 1.3.5 lodash: 4.17.21 uuid: 8.3.2 ws: 7.5.9 @@ -16353,6 +16555,30 @@ packages: thenify-all: 1.6.0 dev: false + /name-wrapper/1.0.0: + resolution: {integrity: sha512-7wTdz1ees+Q3GXFu/Mp76owXzWqYp+k2bB/W0yRnfFtnzU5Y8ga6VKbgl+UWYuCfndy0ylRSQpHPom/mEsDVqg==} + dependencies: + '@ensdomains/ens-contracts': 0.0.3 + '@nomiclabs/hardhat-ethers': /hardhat-deploy-ethers/0.3.0-beta.13_vf54o5zygcw7cr76twqof3t24a + '@nomiclabs/hardhat-waffle': 2.0.3_mwd6y5kujlrcpyrle7ipsbfmk4 + '@openzeppelin/contracts': 4.7.3 + chalk: 4.1.2 + ethereum-waffle: 3.4.4 + ethers: 5.7.2 + hardhat: 2.11.2 + node-watch: 0.7.3 + qrcode-terminal: 0.12.0 + ramda: 0.27.2 + solium: 1.2.5 + transitivePeerDependencies: + - bufferutil + - encoding + - supports-color + - ts-node + - typescript + - utf-8-validate + dev: false + /name-wrapper/1.0.0_mwhvu7sfp6vq5ryuwb6hlbjfka: resolution: {integrity: sha512-7wTdz1ees+Q3GXFu/Mp76owXzWqYp+k2bB/W0yRnfFtnzU5Y8ga6VKbgl+UWYuCfndy0ylRSQpHPom/mEsDVqg==} dependencies: @@ -16592,6 +16818,11 @@ packages: resolution: {integrity: sha512-N8lidFp+fCz+TD51+haYdbDGrcBWwuHX40F5+z0qkUjMJ5Tp+rdSuAkMJ9N9eoolDlEVTf6u5icM+cNKkKW2mA==} engines: {node: '>=8'} + /nofilter/3.1.0: + resolution: {integrity: sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==} + engines: {node: '>=12.19'} + dev: false + /nopt/5.0.0: resolution: {integrity: sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==} engines: {node: '>=6'} @@ -17183,6 +17414,10 @@ packages: /pako/1.0.11: resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==} + /pako/2.1.0: + resolution: {integrity: sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==} + dev: false + /param-case/2.1.1: resolution: {integrity: sha512-eQE845L6ot89sk2N8liD8HAuH4ca6Vvr7VWAWwt7+kvvG5aBcPmmphQ68JsEG2qa9n1TykS2DLeMt363AAH8/w==} dependencies: @@ -20536,6 +20771,12 @@ packages: resolution: {integrity: sha512-q3N1xS4vZpRouhYHDPwO0bDW3EZ6SK9CrrDHxi/D6BPReSjpVgWIOpLS2o0gSBZm+7q/wyKp6RVM1AeeW7uyfQ==} dev: false + /ts-essentials/6.0.7: + resolution: {integrity: sha512-2E4HIIj4tQJlIHuATRHayv0EfMGK3ris/GRk1E3CFnsZzeNV+hUmelbaTZHLtXaZppM5oLhHRtO04gINC4Jusw==} + peerDependencies: + typescript: '>=3.7.0' + dev: false + /ts-essentials/6.0.7_typescript@4.8.4: resolution: {integrity: sha512-2E4HIIj4tQJlIHuATRHayv0EfMGK3ris/GRk1E3CFnsZzeNV+hUmelbaTZHLtXaZppM5oLhHRtO04gINC4Jusw==} peerDependencies: @@ -20711,6 +20952,22 @@ packages: /type/2.7.2: resolution: {integrity: sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==} + /typechain/3.0.0: + resolution: {integrity: sha512-ft4KVmiN3zH4JUFu2WJBrwfHeDf772Tt2d8bssDTo/YcckKW2D+OwFrHXRC6hJvO3mHjFQTihoMV6fJOi0Hngg==} + hasBin: true + dependencies: + command-line-args: 4.0.7 + debug: 4.3.4 + fs-extra: 7.0.1 + js-sha3: 0.8.0 + lodash: 4.17.21 + ts-essentials: 6.0.7 + ts-generator: 0.1.1 + transitivePeerDependencies: + - supports-color + - typescript + dev: false + /typechain/3.0.0_typescript@4.8.4: resolution: {integrity: sha512-ft4KVmiN3zH4JUFu2WJBrwfHeDf772Tt2d8bssDTo/YcckKW2D+OwFrHXRC6hJvO3mHjFQTihoMV6fJOi0Hngg==} hasBin: true @@ -22895,6 +23152,54 @@ packages: use-sync-external-store: 1.2.0_react@17.0.2 dev: false + file:.yalc/@ensdomains/ensjs_ieqas7m66pmgjq3ruwnquy4qyq: + resolution: {directory: .yalc/@ensdomains/ensjs, type: directory} + id: file:.yalc/@ensdomains/ensjs + name: '@ensdomains/ensjs' + version: 3.0.0-alpha.41 + peerDependencies: + '@ethersproject/abi': ^5.6.4 + '@ethersproject/abstract-provider': ^5.7.0 + '@ethersproject/abstract-signer': ^5.7.0 + '@ethersproject/address': ^5.7.0 + '@ethersproject/bignumber': ^5.7.0 + '@ethersproject/bytes': ^5.7.0 + '@ethersproject/contracts': ^5.7.0 + '@ethersproject/keccak256': ^5.7.0 + '@ethersproject/providers': ^5.6.8 + '@ethersproject/solidity': ^5.7.0 + '@ethersproject/strings': ^5.7.0 + '@ethersproject/transactions': ^5.7.0 + '@ethersproject/web': ^5.7.1 + dependencies: + '@ensdomains/address-encoder': 0.2.20 + '@ensdomains/content-hash': 2.5.7 + '@ensdomains/dnsprovejs': 0.4.1 + '@ensdomains/dnssecoraclejs': 0.2.7_kdpqpin542yrq2nndtznhtz4cm + '@ethersproject/providers': 5.7.1 + cbor: 8.1.0 + dns-packet: 5.4.0 + graphql: 16.6.0 + graphql-request: 5.1.1-next.1_graphql@16.6.0 + idna-uts46-hx: 3.4.0 + pako: 2.1.0 + traverse: 0.6.7 + transitivePeerDependencies: + - '@nomiclabs/hardhat-web3' + - bufferutil + - encoding + - hardhat + - supports-color + - ts-node + - typescript + - utf-8-validate + - web3 + - web3-core-helpers + - web3-core-promievent + - web3-eth-abi + - web3-utils + dev: false + github.com/ethereumjs/ethereumjs-abi/ee3994657fa7a427238e6ba92a84d0b529bbcde0: resolution: {tarball: https://codeload.github.com/ethereumjs/ethereumjs-abi/tar.gz/ee3994657fa7a427238e6ba92a84d0b529bbcde0} name: ethereumjs-abi diff --git a/src/components/@atoms/NameDetailItem/TaggedNameItem.tsx b/src/components/@atoms/NameDetailItem/TaggedNameItem.tsx index 66e2d7e00..caf612708 100644 --- a/src/components/@atoms/NameDetailItem/TaggedNameItem.tsx +++ b/src/components/@atoms/NameDetailItem/TaggedNameItem.tsx @@ -55,7 +55,10 @@ export const TaggedNameItem = ({ tags.push([!!isRegistrant, 'name.owner']) } } else { - tags.push([!!isWrappedOwner, fuses.PARENT_CANNOT_CONTROL ? 'name.owner' : 'name.manager']) + tags.push([ + !!isWrappedOwner, + fuses.parent.PARENT_CANNOT_CONTROL ? 'name.owner' : 'name.manager', + ]) } return ( diff --git a/src/components/@molecules/BurnFuses/BurnFusesContent.tsx b/src/components/@molecules/BurnFuses/BurnFusesContent.tsx index 515ce332a..c35ac4257 100644 --- a/src/components/@molecules/BurnFuses/BurnFusesContent.tsx +++ b/src/components/@molecules/BurnFuses/BurnFusesContent.tsx @@ -3,32 +3,17 @@ import { useEffect, useState } from 'react' import { useTranslation } from 'react-i18next' import styled, { css } from 'styled-components' -import type { NamedFusesToBurn } from '@ensdomains/ensjs' +import type { ChildFuses } from '@ensdomains/ensjs' +import { childFuseKeys } from '@ensdomains/ensjs/utils/fuses' import { Button, FlameSVG, Helper, Typography } from '@ensdomains/thorin' import { Spacer } from '@app/components/@atoms/Spacer' import mq from '@app/mediaQuery' -import { FuseObj } from '@app/types' +import { AllChildFuses } from '@app/types' -export const baseFuseObj = { - CANNOT_UNWRAP: false, - CANNOT_BURN_FUSES: false, - CANNOT_TRANSFER: false, - CANNOT_SET_RESOLVER: false, - CANNOT_SET_TTL: false, - CANNOT_CREATE_SUBDOMAIN: false, -} - -export const defaultFuseObj = { - ...baseFuseObj, - PARENT_CANNOT_CONTROL: false, -} - -export const defaultSelectableFuses = { - ...defaultFuseObj, -} - -type SelectableFuses = Omit +export const childFuseObj = Object.fromEntries( + childFuseKeys.map((key) => [key, false]), +) as ChildFuses['current'] const FusesContainer = styled.div(({ theme }) => [ css` @@ -104,9 +89,9 @@ const BurnButton = ({ handleBurnClick, isSelected, }: { - permission: keyof FuseObj + permission: ChildFuses['fuse'] isBurned: boolean - handleBurnClick: (permission: keyof FuseObj) => void + handleBurnClick: (permission: ChildFuses['fuse']) => void isSelected: boolean }) => { const { t } = useTranslation('profile', { keyPrefix: 'tabs.more.fuses' }) @@ -146,14 +131,14 @@ const ButtonsContainer = styled.div( ) const canContinue = ( - fuseData: Partial, - fuseSelected: Partial, + fuseData: ChildFuses['options'], + fuseSelected: ChildFuses['options'], canUnsetFuse: boolean, ) => { - const filteredInitialFuseData: Partial = { ...fuseData } + const filteredInitialFuseData: ChildFuses['options'] = { ...fuseData } Object.keys(filteredInitialFuseData).forEach((key: string) => { - if (filteredInitialFuseData[key as keyof FuseObj]) { - delete filteredInitialFuseData[key as keyof FuseObj] + if (filteredInitialFuseData[key as ChildFuses['fuse']]) { + delete filteredInitialFuseData[key as ChildFuses['fuse']] } }) const cannotUnwrap = !fuseData.CANNOT_UNWRAP && !fuseSelected.CANNOT_UNWRAP @@ -164,60 +149,66 @@ const canContinue = ( return isEqual(filteredInitialFuseData, fuseSelected) || cannotUnwrap } -type Props = { - fuseData: - | { - fuseObj: Record - } - | undefined +type BaseProps = { + fuseData: AllChildFuses | undefined onDismiss: () => void - onSubmit: (fuses: NamedFusesToBurn, fuseNames: string[]) => void canUnsetFuse?: boolean + returnObject?: boolean } -const BurnFusesContent = ({ fuseData, onDismiss, onSubmit, canUnsetFuse = false }: Props) => { +type PropsWithReturnObject = BaseProps & { + returnObject: true + onSubmit: (fuses: ChildFuses['current']) => void +} + +type PropsWithReturnArray = BaseProps & { + returnObject?: never + onSubmit: (fuses: ChildFuses['fuse'][], fuseNames: string[]) => void +} + +const BurnFusesContent = ({ + fuseData, + onDismiss, + onSubmit, + canUnsetFuse = false, + returnObject, +}: PropsWithReturnArray | PropsWithReturnObject) => { const { t } = useTranslation('profile', { keyPrefix: 'tabs.more' }) const { t: tc } = useTranslation() - const [_fuseData, setFuseData] = useState(defaultSelectableFuses) - const [fuseSelected, setFuseSelected] = useState>(defaultSelectableFuses) + const [_fuseData, setFuseData] = useState(childFuseObj) + const [fuseSelected, setFuseSelected] = useState(childFuseObj) - const handleBurnClick = (permission: keyof FuseObj) => { - const nextFuseSelected = { ...fuseSelected } as FuseObj + const handleBurnClick = (permission: ChildFuses['fuse']) => { + const nextFuseSelected = { ...fuseSelected } as ChildFuses['options'] nextFuseSelected[permission] = !nextFuseSelected[permission] setFuseSelected(nextFuseSelected) } const _onSubmit = () => { - const selectedFuses: Array = [] - Object.keys(fuseSelected).forEach((key) => { - if (fuseSelected[key as keyof SelectableFuses]) { - selectedFuses.push(key as keyof SelectableFuses) - } - }) + if (returnObject) { + return onSubmit({ ...fuseData, ...fuseSelected } as ChildFuses['current']) + } + + const selectedFuses = Object.keys(fuseSelected).filter( + (key) => fuseSelected[key as ChildFuses['fuse']], + ) as ChildFuses['fuse'][] const permissions = selectedFuses.map((key) => t(`fuses.permissions.${key}`)) - onSubmit(selectedFuses as NamedFusesToBurn, permissions) + onSubmit(selectedFuses, permissions) } useEffect(() => { if (fuseData) { - const initialFuseData = Object.fromEntries( - Object.entries({ - ...(fuseData.fuseObj as FuseObj), - }).filter(([key]) => { - return !(key === 'PARENT_CANNOT_CONTROL' || key === 'CAN_DO_EVERYTHING') - }), - ) as SelectableFuses - setFuseData(initialFuseData) + setFuseData(fuseData) const initialFusesSelected = Object.fromEntries( Object.entries({ - ...initialFuseData, + ...fuseData, }).filter(([, val]) => !val), ) if (!canUnsetFuse) setFuseSelected(initialFusesSelected) - else setFuseSelected(initialFuseData) + else setFuseSelected(fuseData) } }, [fuseData, canUnsetFuse]) @@ -241,10 +232,10 @@ const BurnFusesContent = ({ fuseData, onDismiss, onSubmit, canUnsetFuse = false {Object.entries(_fuseData).map(([key, value]) => ( ))} diff --git a/src/components/pages/profile/NameSnippet.tsx b/src/components/pages/profile/NameSnippet.tsx index 805c36f1b..9730b03f5 100644 --- a/src/components/pages/profile/NameSnippet.tsx +++ b/src/components/pages/profile/NameSnippet.tsx @@ -155,7 +155,7 @@ export const NameDetailSnippet = ({ if (ownerData?.ownershipLevel === 'nameWrapper') { owners.push([ - wrapperData?.fuseObj.PARENT_CANNOT_CONTROL ? 'name.owner' : 'name.manager', + wrapperData?.parent.PARENT_CANNOT_CONTROL ? 'name.owner' : 'name.manager', ownerData.owner!, ]) } else { diff --git a/src/components/pages/profile/[name]/registration/Registration.tsx b/src/components/pages/profile/[name]/registration/Registration.tsx index 42b27e1ad..f9df9f350 100644 --- a/src/components/pages/profile/[name]/registration/Registration.tsx +++ b/src/components/pages/profile/[name]/registration/Registration.tsx @@ -5,7 +5,7 @@ import { useAccount } from 'wagmi' import { Helper } from '@ensdomains/thorin' -import { baseFuseObj } from '@app/components/@molecules/BurnFuses/BurnFusesContent' +import { childFuseObj } from '@app/components/@molecules/BurnFuses/BurnFusesContent' import { useContractAddress } from '@app/hooks/useContractAddress' import { useNameDetails } from '@app/hooks/useNameDetails' import { usePrimary } from '@app/hooks/usePrimary' @@ -63,7 +63,7 @@ const Registration = ({ nameDetails, isLoading }: Props) => { coinTypes: [{ key: 'ETH', value: address! } as any], clearRecords: resolverExists, }, - permissions: baseFuseObj, + permissions: childFuseObj, resolver: defaultResolverAddress, }, selected, diff --git a/src/components/pages/profile/[name]/registration/steps/Pricing/Pricing.tsx b/src/components/pages/profile/[name]/registration/steps/Pricing/Pricing.tsx index 32afe4de9..07d62de89 100644 --- a/src/components/pages/profile/[name]/registration/steps/Pricing/Pricing.tsx +++ b/src/components/pages/profile/[name]/registration/steps/Pricing/Pricing.tsx @@ -8,6 +8,7 @@ import { Button, Field, Heading, Toggle, Typography, mq } from '@ensdomains/thor import MobileFullWidth from '@app/components/@atoms/MobileFullWidth' import { PlusMinusControl } from '@app/components/@atoms/PlusMinusControl/PlusMinusControl' import { RegistrationTimeComparisonBanner } from '@app/components/@atoms/RegistrationTimeComparisonBanner/RegistrationTimeComparisonBanner' +import { childFuseObj } from '@app/components/@molecules/BurnFuses/BurnFusesContent' import { Card } from '@app/components/Card' import { ConnectButton } from '@app/components/ConnectButton' import { useAccountSafely } from '@app/hooks/useAccountSafely' @@ -105,7 +106,7 @@ const Pricing = ({ const fullEstimate = useEstimateFullRegistration({ registration: { - permissions: {}, + permissions: childFuseObj, records: { coinTypes: [{ key: 'ETH', value: resolverAddress }], clearRecords: resolverExists, diff --git a/src/components/pages/profile/[name]/registration/steps/Profile/Profile.tsx b/src/components/pages/profile/[name]/registration/steps/Profile/Profile.tsx index 4003b8a33..725e0049b 100644 --- a/src/components/pages/profile/[name]/registration/steps/Profile/Profile.tsx +++ b/src/components/pages/profile/[name]/registration/steps/Profile/Profile.tsx @@ -9,7 +9,7 @@ import { Button, Dialog, DownChevronSVG, Helper, Tag, Typography, mq } from '@en import { Banner } from '@app/components/@atoms/Banner/Banner' import MobileFullWidth from '@app/components/@atoms/MobileFullWidth' import BurnFusesContent, { - baseFuseObj, + childFuseObj, } from '@app/components/@molecules/BurnFuses/BurnFusesContent' import AddRecord from '@app/components/@molecules/ProfileEditor/AddRecord' import AvatarButton, { @@ -22,7 +22,6 @@ import websiteOptions from '@app/components/@molecules/ProfileEditor/options/web import { useContractAddress } from '@app/hooks/useContractAddress' import { useNameDetails } from '@app/hooks/useNameDetails' import useProfileEditor from '@app/hooks/useProfileEditor' -import { FuseObj } from '@app/types' import { ProfileFormObject, convertProfileToProfileFormObject } from '@app/utils/editor' import { BackObj, RegistrationReducerDataItem, RegistrationStepData } from '../../types' @@ -400,15 +399,12 @@ const Profile = ({ nameDetails, callback, registrationData, resolverExists }: Pr case 'permissions': { return ( setModalOpen(false)} canUnsetFuse + returnObject onSubmit={(newFuses) => { - const _newFuses = newFuses as unknown as keyof FuseObj - const newFuseObj = Object.keys(fuses).reduce((acc, key) => { - return { ...acc, [key]: _newFuses.includes(key) } - }, fuses) - setFuses(newFuseObj) + setFuses(newFuses) setModalOpen(false) }} /> @@ -481,7 +477,7 @@ const Profile = ({ nameDetails, callback, registrationData, resolverExists }: Pr isDefault={isDefaultFuses} onClick={() => setModalOption('permissions')} onResetClick={() => { - setFuses({ ...baseFuseObj }) + setFuses(childFuseObj) }} /> registrationData.permissions[key as ChildFuses['fuse']], + ) as ChildFuses['fuse'][], + unnamed: {}, + }, records: registrationData.records, reverseRecord: registrationData.reverseRecord, }), diff --git a/src/components/pages/profile/[name]/registration/types.ts b/src/components/pages/profile/[name]/registration/types.ts index bb0634ec5..13c6ac584 100644 --- a/src/components/pages/profile/[name]/registration/types.ts +++ b/src/components/pages/profile/[name]/registration/types.ts @@ -1,7 +1,6 @@ +import type { ChildFuses } from '@ensdomains/ensjs' import { RecordOptions } from '@ensdomains/ensjs/utils/recordHelpers' -import { FuseObj } from '@app/types' - export type RegistrationStep = 'pricing' | 'profile' | 'info' | 'transactions' | 'complete' type UnionToIntersection = (U extends any ? (k: U) => void : never) extends (k: infer I) => void @@ -16,7 +15,7 @@ export type RegistrationStepData = { profile: { records: RecordOptions resolver: string - permissions: Partial + permissions: ChildFuses['current'] } info: {} transactions: { diff --git a/src/components/pages/profile/[name]/tabs/MoreTab/Fuses.test.tsx b/src/components/pages/profile/[name]/tabs/MoreTab/Fuses.test.tsx index daa222252..fe16b962f 100644 --- a/src/components/pages/profile/[name]/tabs/MoreTab/Fuses.test.tsx +++ b/src/components/pages/profile/[name]/tabs/MoreTab/Fuses.test.tsx @@ -3,15 +3,11 @@ import { mockFunction, render, screen } from '@app/test-utils' import { BigNumber } from 'ethers' import { useRouter } from 'next/router' -import { useGetWrapperData } from '@app/hooks/useGetWrapperData' - import Fuses from './Fuses' jest.mock('next/router') -jest.mock('@app/hooks/useGetWrapperData') const mockUseRouter = mockFunction(useRouter) -const mockUseGetWrapperData = mockFunction(useGetWrapperData) const mockFusesResponse = { fuseObj: { @@ -23,6 +19,7 @@ const mockFusesResponse = { CANNOT_CREATE_SUBDOMAIN: false, PARENT_CANNOT_CONTROL: true, CAN_DO_EVERYTHING: false, + CAN_EXTEND_EXPIRY: true, }, rawFuses: BigNumber.from('0x40'), } @@ -45,7 +42,6 @@ describe('Fuses', () => { name: 'nick.eth', }, }) - mockUseGetWrapperData.mockReturnValue({}) render() }) @@ -55,12 +51,6 @@ describe('Fuses', () => { name: 'nick.eth', }, }) - mockUseGetWrapperData.mockReturnValue({ - wrapperData: { - ...mockFusesResponse, - fuseObj: { ...mockFusesResponse.fuseObj, PARENT_CANNOT_CONTROL: false }, - }, - }) const props = { ...defaultProps, fuseObj: { ...mockFusesResponse.fuseObj, PARENT_CANNOT_CONTROL: false }, diff --git a/src/components/pages/profile/[name]/tabs/MoreTab/Fuses.tsx b/src/components/pages/profile/[name]/tabs/MoreTab/Fuses.tsx index 08bdb2431..319fb16b9 100644 --- a/src/components/pages/profile/[name]/tabs/MoreTab/Fuses.tsx +++ b/src/components/pages/profile/[name]/tabs/MoreTab/Fuses.tsx @@ -1,7 +1,7 @@ import { useTranslation } from 'react-i18next' import styled, { css } from 'styled-components' -import { CurrentFuses, fuseEnum } from '@ensdomains/ensjs/utils/fuses' +import { ChildFuses, ParentFuses, userSettableFuseEnum } from '@ensdomains/ensjs/utils/fuses' import { Helper, Typography, mq } from '@ensdomains/thorin' import { cacheableComponentStyles } from '@app/components/@atoms/CacheableComponent' @@ -76,7 +76,7 @@ const Fuses = ({ isCachedData, }: { name: string - fuseObj: CurrentFuses + fuseObj: ChildFuses['current'] & ParentFuses['current'] canEdit: boolean isCachedData: boolean }) => { @@ -117,7 +117,8 @@ const Fuses = ({ .filter(([key]) => key !== 'CAN_DO_EVERYTHING') .sort( (a, b) => - fuseEnum[a[0] as keyof typeof fuseEnum] - fuseEnum[b[0] as keyof typeof fuseEnum], + userSettableFuseEnum[a[0] as keyof typeof userSettableFuseEnum] - + userSettableFuseEnum[b[0] as keyof typeof userSettableFuseEnum], ) .map(([key, value], inx) => ( diff --git a/src/components/pages/profile/[name]/tabs/MoreTab/MoreTab.tsx b/src/components/pages/profile/[name]/tabs/MoreTab/MoreTab.tsx index ae16be874..434c5e122 100644 --- a/src/components/pages/profile/[name]/tabs/MoreTab/MoreTab.tsx +++ b/src/components/pages/profile/[name]/tabs/MoreTab/MoreTab.tsx @@ -4,6 +4,7 @@ import { CacheableComponent } from '@app/components/@atoms/CacheableComponent' import { useNameDetails } from '@app/hooks/useNameDetails' import useOwners from '@app/hooks/useOwners' import { useSelfAbilities } from '@app/hooks/useSelfAbilities' +import { deleteProperty } from '@app/utils/utils' import Fuses from './Fuses' import Miscellaneous from './Miscellaneous' @@ -66,7 +67,10 @@ const MoreTab = ({ name, nameDetails, selfAbilities }: Props) => { )} diff --git a/src/hooks/transactions/useCallbackOnTransaction.ts b/src/hooks/transactions/useCallbackOnTransaction.ts index 17d6867ef..95d72378b 100644 --- a/src/hooks/transactions/useCallbackOnTransaction.ts +++ b/src/hooks/transactions/useCallbackOnTransaction.ts @@ -38,7 +38,10 @@ const useCallbackOnTransaction = (callback: UpdateCallback) => { useQuery( ['graphBlock', chainId, transactions], - () => gqlInstance.request(query).then((res: GraphResponse) => res._meta.block.number), + () => + gqlInstance.client + .request(query) + .then((res: GraphResponse | null) => res!._meta.block.number), { initialData: 0, refetchInterval: (data) => { diff --git a/src/hooks/useNameDates.ts b/src/hooks/useNameDates.ts index 68ea58397..c86ac0ce8 100644 --- a/src/hooks/useNameDates.ts +++ b/src/hooks/useNameDates.ts @@ -29,7 +29,7 @@ export const useNameDates = (name: string) => { } = useQuery( ['graph', 'getNameDates', name], async () => { - const { registration } = await gqlInstance.request(query, { + const { registration } = await gqlInstance.client.request(query, { id: labelhash(name.split('.')[0]), }) return registration as { registrationDate: string; expiryDate: string } diff --git a/src/hooks/useOwners.ts b/src/hooks/useOwners.ts index 9db7c6008..28f844d48 100644 --- a/src/hooks/useOwners.ts +++ b/src/hooks/useOwners.ts @@ -26,7 +26,7 @@ const useOwners = ({ ownerData, wrapperData, dnsOwner, selfAbilities }: Props) = address: ownerData.owner!, canTransfer: selfAbilities.canSend, transferType: 'owner', - label: wrapperData?.fuseObj.PARENT_CANNOT_CONTROL ? 'name.owner' : 'name.manager', + label: wrapperData?.parent.PARENT_CANNOT_CONTROL ? 'name.owner' : 'name.manager', description: 'details.descriptions.owner', testId: 'owner-button-owner', }) diff --git a/src/hooks/useRegistrationReducer.ts b/src/hooks/useRegistrationReducer.ts index 0eabc11f3..9aaa9d113 100644 --- a/src/hooks/useRegistrationReducer.ts +++ b/src/hooks/useRegistrationReducer.ts @@ -1,3 +1,4 @@ +import { childFuseObj } from '@app/components/@molecules/BurnFuses/BurnFusesContent' import { RegistrationReducerAction, RegistrationReducerData, @@ -18,7 +19,7 @@ const defaultData: RegistrationReducerDataItem = { reverseRecord: false, records: {}, resolver: '', - permissions: {}, + permissions: childFuseObj, secret: '', started: false, address: '', @@ -38,7 +39,7 @@ const makeDefaultData = (selected: SelectedItemProperties): RegistrationReducerD reverseRecord: false, records: {}, resolver: '', - permissions: {}, + permissions: childFuseObj, secret: randomSecret(), started: false, ...selected, diff --git a/src/hooks/useResolverExists.ts b/src/hooks/useResolverExists.ts index 79a12b348..b38789729 100644 --- a/src/hooks/useResolverExists.ts +++ b/src/hooks/useResolverExists.ts @@ -17,7 +17,9 @@ const useResolverExists = (name: string, address: string) => { const { data, isLoading } = useQuery( ['graph', 'getResolverExists', name], async () => { - const { resolver } = await gqlInstance.request(query, { id: `${address}-${namehash(name)}` }) + const { resolver } = await gqlInstance.client.request(query, { + id: `${address}-${namehash(name)}`, + }) return !!resolver }, { diff --git a/src/hooks/useSelfAbilities.test.ts b/src/hooks/useSelfAbilities.test.ts index fb7eb3787..f39c467cd 100644 --- a/src/hooks/useSelfAbilities.test.ts +++ b/src/hooks/useSelfAbilities.test.ts @@ -53,13 +53,18 @@ const partialUserStates = { }, wrapperData: { ownershipLevel: 'registry', + child: {}, + parent: {}, }, }, parentBasicNameData: { ownerData: { ownershipLevel: 'registry', }, - wrapperData: {}, + wrapperData: { + child: {}, + parent: {}, + }, }, }, unwrappedNameManager: { @@ -70,14 +75,18 @@ const partialUserStates = { registrant: '0xnotOwner', }, wrapperData: { - fuseObj: {}, + child: {}, + parent: {}, }, }, parentBasicNameData: { ownerData: { ownershipLevel: 'registry', }, - wrapperData: {}, + wrapperData: { + child: {}, + parent: {}, + }, }, }, unwrappedSubnameManagerHolderUnwrappedParentManager: { @@ -87,14 +96,18 @@ const partialUserStates = { owner: ownerAddress, }, wrapperData: { - fuseObj: {}, + child: {}, + parent: {}, }, }, parentBasicNameData: { ownerData: { ownershipLevel: 'registry', }, - wrapperData: {}, + wrapperData: { + child: {}, + parent: {}, + }, }, }, unwrappedSubnameUnwrappedParentManager: { @@ -103,7 +116,8 @@ const partialUserStates = { ownershipLevel: 'registry', }, wrapperData: { - fuseObj: {}, + child: {}, + parent: {}, }, }, parentBasicNameData: { @@ -112,9 +126,10 @@ const partialUserStates = { owner: ownerAddress, }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: false, }, + child: {}, }, }, }, @@ -124,7 +139,8 @@ const partialUserStates = { ownershipLevel: 'registry', }, wrapperData: { - fuseObj: {}, + child: {}, + parent: {}, }, }, parentBasicNameData: { @@ -134,7 +150,8 @@ const partialUserStates = { registrant: ownerAddress, }, wrapperData: { - fuseObj: {}, + child: {}, + parent: {}, }, }, }, @@ -144,7 +161,8 @@ const partialUserStates = { ownershipLevel: 'registry', }, wrapperData: { - fuseObj: {}, + child: {}, + parent: {}, }, }, parentBasicNameData: { @@ -153,7 +171,8 @@ const partialUserStates = { owner: ownerAddress, }, wrapperData: { - fuseObj: {}, + child: {}, + parent: {}, }, }, }, @@ -164,9 +183,10 @@ const partialUserStates = { owner: ownerAddress, }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: false, }, + child: {}, }, }, parentBasicNameData: { @@ -174,7 +194,8 @@ const partialUserStates = { ownershipLevel: 'registry', }, wrapperData: { - fuseObj: {}, + child: {}, + parent: {}, }, }, }, @@ -184,9 +205,10 @@ const partialUserStates = { ownershipLevel: 'nameWrapper', }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: false, }, + child: {}, }, }, parentBasicNameData: { @@ -195,7 +217,8 @@ const partialUserStates = { owner: ownerAddress, }, wrapperData: { - fuseObj: {}, + child: {}, + parent: {}, }, }, }, @@ -205,7 +228,8 @@ const partialUserStates = { ownershipLevel: 'nameWrapper', }, wrapperData: { - fuseObj: {}, + child: {}, + parent: {}, }, }, parentBasicNameData: { @@ -215,9 +239,10 @@ const partialUserStates = { registrant: ownerAddress, }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: false, }, + child: {}, }, }, }, @@ -228,16 +253,20 @@ const partialUserStates = { owner: ownerAddress, }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: true, }, + child: {}, }, }, parentBasicNameData: { ownerData: { ownershipLevel: 'registry', }, - wrapperData: {}, + wrapperData: { + child: {}, + parent: {}, + }, }, }, wrappedNameCTBurnedOwner: { @@ -247,17 +276,22 @@ const partialUserStates = { owner: ownerAddress, }, wrapperData: { - fuseObj: { - PARENT_CANNOT_CONTROL: true, + child: { CANNOT_TRANSFER: true, }, + parent: { + PARENT_CANNOT_CONTROL: true, + }, }, }, parentBasicNameData: { ownerData: { ownershipLevel: 'registry', }, - wrapperData: {}, + wrapperData: { + child: {}, + parent: {}, + }, }, }, wrappedNameManager: { @@ -267,16 +301,20 @@ const partialUserStates = { owner: ownerAddress, }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: false, }, + child: {}, }, }, parentBasicNameData: { ownerData: { ownershipLevel: 'registry', }, - wrapperData: {}, + wrapperData: { + child: {}, + parent: {}, + }, }, }, wrappedSubnameManagerHolderWrappedParentOwner: { @@ -286,9 +324,10 @@ const partialUserStates = { owner: ownerAddress, }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: false, }, + child: {}, }, }, parentBasicNameData: { @@ -296,9 +335,10 @@ const partialUserStates = { ownershipLevel: 'nameWrapper', }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: true, }, + child: {}, }, }, }, @@ -308,9 +348,10 @@ const partialUserStates = { ownershipLevel: 'nameWrapper', }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: false, }, + child: {}, }, }, parentBasicNameData: { @@ -319,9 +360,10 @@ const partialUserStates = { owner: ownerAddress, }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: true, }, + child: {}, }, }, }, @@ -331,9 +373,10 @@ const partialUserStates = { ownershipLevel: 'nameWrapper', }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: false, }, + child: {}, }, }, parentBasicNameData: { @@ -342,9 +385,10 @@ const partialUserStates = { owner: ownerAddress, }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: false, }, + child: {}, }, }, }, @@ -355,16 +399,20 @@ const partialUserStates = { owner: ownerAddress, }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: true, }, + child: {}, }, }, parentBasicNameData: { ownerData: { ownershipLevel: 'nameWrapper', }, - wrapperData: {}, + wrapperData: { + child: {}, + parent: {}, + }, }, }, wrappedSubnameOwnerHolderWrappedParentOwnerHolder: { @@ -374,9 +422,10 @@ const partialUserStates = { owner: ownerAddress, }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: true, }, + child: {}, }, }, parentBasicNameData: { @@ -385,9 +434,10 @@ const partialUserStates = { owner: ownerAddress, }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: true, }, + child: {}, }, }, }, @@ -398,9 +448,10 @@ const partialUserStates = { owner: ownerAddress, }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: true, }, + child: {}, }, }, parentBasicNameData: { @@ -410,7 +461,8 @@ const partialUserStates = { registrant: ownerAddress, }, wrapperData: { - fuseObj: {}, + child: {}, + parent: {}, }, }, }, @@ -420,9 +472,10 @@ const partialUserStates = { ownershipLevel: 'nameWrapper', }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: false, }, + child: {}, }, }, parentBasicNameData: { @@ -431,9 +484,10 @@ const partialUserStates = { owner: ownerAddress, }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: false, }, + child: {}, }, }, }, @@ -443,9 +497,10 @@ const partialUserStates = { ownershipLevel: 'nameWrapper', }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: false, }, + child: {}, }, }, parentBasicNameData: { @@ -454,9 +509,10 @@ const partialUserStates = { owner: ownerAddress, }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: true, }, + child: {}, }, }, }, @@ -467,7 +523,8 @@ const partialUserStates = { owner: ownerAddress, }, wrapperData: { - fuseObj: {}, + child: {}, + parent: {}, }, }, parentBasicNameData: { @@ -475,9 +532,10 @@ const partialUserStates = { ownershipLevel: 'nameWrapper', }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: true, }, + child: {}, }, }, }, @@ -487,7 +545,8 @@ const partialUserStates = { ownershipLevel: 'registry', }, wrapperData: { - fuseObj: {}, + child: {}, + parent: {}, }, }, parentBasicNameData: { @@ -496,9 +555,10 @@ const partialUserStates = { owner: ownerAddress, }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: true, }, + child: {}, }, }, }, @@ -508,7 +568,8 @@ const partialUserStates = { ownershipLevel: 'registry', }, wrapperData: { - fuseObj: {}, + child: {}, + parent: {}, }, }, parentBasicNameData: { @@ -517,9 +578,10 @@ const partialUserStates = { owner: ownerAddress, }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: false, }, + child: {}, }, }, }, @@ -529,9 +591,10 @@ const partialUserStates = { ownershipLevel: 'nameWrapper', }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: false, }, + child: {}, }, }, parentBasicNameData: { @@ -541,7 +604,8 @@ const partialUserStates = { registrant: ownerAddress, }, wrapperData: { - fuseObj: {}, + child: {}, + parent: {}, }, }, }, @@ -551,9 +615,10 @@ const partialUserStates = { ownershipLevel: 'nameWrapper', }, wrapperData: { - fuseObj: { + parent: { PARENT_CANNOT_CONTROL: false, }, + child: {}, }, }, parentBasicNameData: { @@ -562,7 +627,8 @@ const partialUserStates = { owner: ownerAddress, }, wrapperData: { - fuseObj: {}, + child: {}, + parent: {}, }, }, }, @@ -1109,7 +1175,7 @@ describe('useSelfAbilities', () => { it('should return false for all send abilities if CANNOT_TRANSFER has been burned', () => { mockUseBasicName.mockReturnValue({ wrapperData: { - fuseObj: { + child: { CANNOT_TRANSFER: true, }, }, diff --git a/src/hooks/useSelfAbilities.ts b/src/hooks/useSelfAbilities.ts index fd0548957..17e74a78d 100644 --- a/src/hooks/useSelfAbilities.ts +++ b/src/hooks/useSelfAbilities.ts @@ -199,11 +199,13 @@ export const getFunctionCallDetails = ({ if (!wrapperData || !parentWrapperData) return {} const isSubname = checkSubname(name) - const { fuseObj } = wrapperData - const { fuseObj: parentFuseObj } = parentWrapperData + const { parent: childParentFuseObj } = wrapperData + const { parent: parentParentFuseObj } = parentWrapperData const isWrapped = ownerData?.ownershipLevel === 'nameWrapper' const isOwnerOrManager = ownerData?.owner === address || ownerData?.registrant === address - const isOwner = isWrapped ? fuseObj.PARENT_CANNOT_CONTROL : ownerData?.registrant === address + const isOwner = isWrapped + ? childParentFuseObj.PARENT_CANNOT_CONTROL + : ownerData?.registrant === address if (isSubname) { const isParentWrapped = parentOwnerData?.ownershipLevel === 'nameWrapper' @@ -222,7 +224,7 @@ export const getFunctionCallDetails = ({ } const isParentManager = isParentWrapped - ? !parentFuseObj.PARENT_CANNOT_CONTROL + ? !parentParentFuseObj.PARENT_CANNOT_CONTROL : parentOwnerData?.owner === address if (isParentOwnerOrManager) { @@ -246,7 +248,7 @@ export const getFunctionCallDetails = ({ export const getPermittedActions = (props: GetFunctionCallDetailsArgs): SendPermissions => { if (!props.basicNameData.ownerData) return { canSendOwner: false, canSendManager: false } - if (props.basicNameData.wrapperData?.fuseObj?.CANNOT_TRANSFER) + if (props.basicNameData.wrapperData?.child.CANNOT_TRANSFER) return { canSendOwner: false, canSendManager: false } const result = getFunctionCallDetails(props) if (!result) return { canSendOwner: false, canSendManager: false } @@ -272,7 +274,7 @@ const isParentWithChildPCCBurnedCalc = ( !isOwnerOrManager && isParentOwnerOrManager && isWrapped && - wrapperData?.fuseObj.PARENT_CANNOT_CONTROL + wrapperData?.parent.PARENT_CANNOT_CONTROL ) } diff --git a/src/test-utils.tsx b/src/test-utils.tsx index f3d3dc405..9aa74f854 100644 --- a/src/test-utils.tsx +++ b/src/test-utils.tsx @@ -12,6 +12,8 @@ import { WagmiConfig, createClient } from 'wagmi' import { ThorinGlobalStyles, lightTheme } from '@ensdomains/thorin' +import { DeepPartial } from './types' + jest.mock('wagmi', () => { const { useQuery, useInfiniteQuery, createClient, WagmiConfig } = jest.requireActual('wagmi') @@ -86,12 +88,6 @@ const customRenderHook = ( options?: Omit, 'wrapper'>, ) => renderHook(callback, { wrapper: AllTheProviders as any, ...options }) -type DeepPartial = T extends object - ? { - [P in keyof T]?: DeepPartial - } - : T - export type PartialMockedFunction any> = ( ...args: Parameters ) => DeepPartial> diff --git a/src/transaction-flow/input/BurnFuses/BurnFuses-flow.tsx b/src/transaction-flow/input/BurnFuses/BurnFuses-flow.tsx index 6d8282dc5..66653ecc2 100644 --- a/src/transaction-flow/input/BurnFuses/BurnFuses-flow.tsx +++ b/src/transaction-flow/input/BurnFuses/BurnFuses-flow.tsx @@ -1,9 +1,10 @@ import { Dispatch } from 'react' -import type { NamedFusesToBurn } from '@ensdomains/ensjs' +import type { ChildFuses } from '@ensdomains/ensjs' import BurnFusesContent from '@app/components/@molecules/BurnFuses/BurnFusesContent' import { useGetWrapperData } from '@app/hooks/useGetWrapperData' +import { deleteProperties } from '@app/utils/utils' import { makeTransactionItem } from '../../transaction' import { TransactionDialogPassthrough, TransactionFlowAction } from '../../types' @@ -22,13 +23,13 @@ export const BurnFuses = ({ data, onDismiss, dispatch }: Props) => { const { name } = data const { wrapperData } = useGetWrapperData((name as string) || '') - const onSubmit = (selectedFuses: NamedFusesToBurn, permissions: string[]) => { + const onSubmit = (selectedFuses: ChildFuses['fuse'][], permissions: string[]) => { dispatch({ name: 'setTransactions', payload: [ makeTransactionItem('burnFuses', { name: name as string, - selectedFuses: selectedFuses as NamedFusesToBurn, + selectedFuses, permissions, }), ], @@ -36,7 +37,17 @@ export const BurnFuses = ({ data, onDismiss, dispatch }: Props) => { dispatch({ name: 'setFlowStage', payload: 'transaction' }) } - return + return ( + + ) } export default BurnFuses diff --git a/src/transaction-flow/input/SelectPrimaryName-flow.tsx b/src/transaction-flow/input/SelectPrimaryName-flow.tsx index 1ce55f37a..fec1a2cc8 100644 --- a/src/transaction-flow/input/SelectPrimaryName-flow.tsx +++ b/src/transaction-flow/input/SelectPrimaryName-flow.tsx @@ -65,7 +65,7 @@ const SelectPrimaryName = ({ data: { address, existingPrimary }, dispatch, onDis const { data, fetchNextPage, isLoading } = useInfiniteQuery( [address, 'primaryNameOptions'], async ({ pageParam }: { pageParam?: string }) => { - const { domains } = await gqlInstance.request( + const { domains } = await gqlInstance.client.request( gqlInstance.gql` query getEthRecordAvailableNames($address: String!, $lastID: String, $size: Int!) { domains(first: $size, where: { id_gt: $lastID, resolvedAddress: $address }) { diff --git a/src/transaction-flow/input/SelectPrimaryName.test.tsx b/src/transaction-flow/input/SelectPrimaryName.test.tsx index ded478189..d00915eb2 100644 --- a/src/transaction-flow/input/SelectPrimaryName.test.tsx +++ b/src/transaction-flow/input/SelectPrimaryName.test.tsx @@ -58,7 +58,9 @@ describe('SelectPrimaryName', () => { mockUseEns.mockReturnValue({ gqlInstance: { gql: (str: string) => str, - request: mockRequest, + client: { + request: mockRequest, + }, }, }) it('should show loading', async () => { diff --git a/src/transaction-flow/transaction/burnFuses.ts b/src/transaction-flow/transaction/burnFuses.ts index 16aebb909..41bd9a246 100644 --- a/src/transaction-flow/transaction/burnFuses.ts +++ b/src/transaction-flow/transaction/burnFuses.ts @@ -1,14 +1,14 @@ import type { JsonRpcSigner } from '@ethersproject/providers' import type { TFunction } from 'react-i18next' -import type { NamedFusesToBurn } from '@ensdomains/ensjs' +import type { ChildFuses } from '@ensdomains/ensjs' import { PublicENS, Transaction, TransactionDisplayItem } from '@app/types' type Data = { name: string permissions: string[] - selectedFuses: NamedFusesToBurn + selectedFuses: ChildFuses['fuse'][] } const displayItems = ( diff --git a/src/types/index.ts b/src/types/index.ts index d741b0431..ffef07aee 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -3,7 +3,7 @@ import { PopulatedTransaction } from 'ethers' import { ComponentProps } from 'react' import type { TFunction } from 'react-i18next' -import type { ENS } from '@ensdomains/ensjs' +import type { ChildFuses, ENS } from '@ensdomains/ensjs' import { Helper, Space } from '@ensdomains/thorin' export type Profile = NonNullable>> @@ -75,16 +75,7 @@ export interface Transaction { backToInput?: boolean } -export type FuseObj = { - CAN_DO_EVERYTHING: boolean - CANNOT_UNWRAP: boolean - CANNOT_BURN_FUSES: boolean - CANNOT_TRANSFER: boolean - CANNOT_SET_RESOLVER: boolean - CANNOT_SET_TTL: boolean - CANNOT_CREATE_SUBDOMAIN: boolean - PARENT_CANNOT_CONTROL: boolean -} +export type AllChildFuses = Required export type EthAddress = string @@ -101,3 +92,9 @@ export type QuerySpace = md?: Space lg?: Space } + +export type DeepPartial = T extends object + ? { + [P in keyof T]?: DeepPartial + } + : T diff --git a/src/utils/EnsProvider.tsx b/src/utils/EnsProvider.tsx index 66b32628e..31c3145bf 100644 --- a/src/utils/EnsProvider.tsx +++ b/src/utils/EnsProvider.tsx @@ -11,8 +11,7 @@ if (process.env.NEXT_PUBLIC_PROVIDER && process.env.NEXT_PUBLIC_DEPLOYMENT_ADDRE ContractName | 'ENSRegistry', string > - opts.getContractAddress = () => (contractName) => - deploymentAddresses[contractName === 'ENSRegistryWithFallback' ? 'ENSRegistry' : contractName] + opts.getContractAddress = () => (contractName) => deploymentAddresses[contractName] } if (process.env.NEXT_PUBLIC_GRAPH_URI) { diff --git a/src/utils/registrationStatus.test.ts b/src/utils/registrationStatus.test.ts index ac93d2e58..ac5f3b192 100644 --- a/src/utils/registrationStatus.test.ts +++ b/src/utils/registrationStatus.test.ts @@ -10,20 +10,22 @@ const ownerData: ReturnedENS['getOwner'] = { } const wrapperData: ReturnedENS['getWrapperData'] = { - fuseObj: { + child: { CAN_DO_EVERYTHING: true, CANNOT_BURN_FUSES: false, CANNOT_TRANSFER: false, CANNOT_UNWRAP: false, CANNOT_SET_RESOLVER: false, CANNOT_SET_TTL: false, - PARENT_CANNOT_CONTROL: false, CANNOT_CREATE_SUBDOMAIN: false, }, + parent: { + PARENT_CANNOT_CONTROL: false, + }, expiryDate: new Date(), - rawFuses: BigNumber.from(0), + rawFuses: 0, owner: '0x123', -} +} as ReturnedENS['getWrapperData'] describe('getRegistrationStatus', () => { describe('2LD .eth', () => { diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 33384bd57..a2c38a307 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -86,3 +86,19 @@ export const isLabelTooLong = (label: string) => { export const getTestId = (props: any, fallback: string): string => { return props['data-testid'] ? String(props['data-testid']) : fallback } + +export const deleteProperty = , K extends keyof T>( + key: K, + { [key]: _, ...newObj }: T, +): Omit => newObj + +export const deleteProperties = , K extends keyof T>( + obj: T, + ...keys: K[] +): Omit => { + const newObj = { ...obj } + for (const key of keys) { + delete newObj[key] + } + return newObj +} diff --git a/yalc.lock b/yalc.lock new file mode 100644 index 000000000..73495cac3 --- /dev/null +++ b/yalc.lock @@ -0,0 +1,10 @@ +{ + "version": "v1", + "packages": { + "@ensdomains/ensjs": { + "signature": "a48202939e398afd18e432ee23beb45d", + "file": true, + "replaced": "3.0.0-alpha.37" + } + } +} \ No newline at end of file