Giter VIP home page Giter VIP logo

ensjs-v3's Introduction

ENSjs

The ultimate ENS javascript library, with viem under the hood.

Features

  • Super fast response times
  • Easy call batchability
  • Written in TypeScript
  • Supports the most cutting edge ENS features
  • Full tree-shaking support

Installation

Install @ensdomains/ensjs, alongside viem.

npm install @ensdomains/ensjs viem

Getting Started

The most simple way to get started is to create a public ENS client, with a supported chain and transport imported from viem. The public client has all the read functions available on it, as well as all subgraph functions.

// Import viem transport, viem chain, and ENSjs
import { http } from 'viem'
import { mainnet } from 'viem/chains'
import { createEnsPublicClient } from '@ensdomains/ensjs'

// Create the client
const client = createEnsPublicClient({
  chain: mainnet,
  transport: http(),
})

// Use the client
const ethAddress = client.getAddressRecord({ name: 'ens.eth' })

Docs

Docs can be found here. Full docs site coming soon.

ensjs-v3's People

Contributors

caaatisgood avatar github-actions[bot] avatar jackromo888 avatar jefflau avatar leonmanrolls avatar mdtanrikulu avatar rex4539 avatar storywithoutend avatar sugh01 avatar tateb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ensjs-v3's Issues

Add block number parameter to resolver methods

TL;DR: Functions like getName, getOwner, getProfile, getRecords, getResolver, getContentHash, getText, and other getters should take a second parameter 'blockNumber' which defaults to 'latest'.


A use case I have at the moment (which seems likely to be common) is a Dapp that allows use of and displays ENS names instead of addresses (where available), including looking for and displaying data about past transactions and the ENS-labeled names of who took various actions.

Existing library methods do the translation as of the latest block with no parameter for being able to resolve names in either direction as of some past block. The link goes to ethers but the issue is here too, and will probably have to be fixed in an ENS-maintained library before it gets to ethers.js.

Sometimes, ENS addresses change hands, and it's not always through kind good-faith means between fully mutually trusting parties.

I don't have a proof-of-concept demo at hand at the moment of why the lack of this feature seems dangerous, but it seems like there are probably some exploits out there which involve changing the ENS name <=> address correspondence and then executing functions or encouraging/letting people use interfaces that consider past transaction data but only through the lens of present ENS names.

In some settings, the use of present names is exactly appropriate, but it isn't always, and Dapp developers who want to do the right thing when it isn't currently have a lot of work ahead to figure out how to get the historical data. Having commonly used libraries (or at least the one maintained by ENS!) be able to support historical forward & reverse resolution by passing a block number parameter to the resolver functions (w/default value 'latest') could help improve the overall state of Dapp security.

Here’s one example not requiring any bad actors: suppose a DAO that takes great pains to avoid conflicts of interest or appearances thereof. A DAO president awards a grant to new ecosystem member Joe and the grant is wildly successful in its goals; over time Joe becomes integrated as a valuable member of the community, then a core member, and then even the DAO president with the associated ENS name. However, an outside observer looking at the DAO’s financial records would then be able to see using even the DAO’s own tooling that in the past President Joe gave a large grant to...himself, and all that language about avoiding even the appearance of a conflict of interest must just be BS in this DAO (when really it’s not).

While it appears that a workaround for the absence of this feature likely exists, it’s a long detour / lot-of-work workaround compared to adding another parameter in a read call (as can be done when reading from custom contracts in ethers or web3).

`getOwner` crashes on Mainnet if the ENS domain name does not exist/has not been registtered

On Mainnet, the function .getOwner crashes with an error if the ENS domain name input to the function has not been registered.

Example:

    const NOT_REGISTERED_ENS_DOMAIN = "thisisnotregisteredens.eth"
    const ownerObject = await ENSInstance.getOwner(NOT_REGISTERED_ENS_DOMAIN);
    console.log(ownerObject);

crashes with the following error instead of returning undefined

/home/x/node_modules/graphql-request/dist/index.js:67
            op = body.call(thisArg, _);
                      ^
ClientError: Type `Domain` has no field `registration`: {"response":{"errors":[{"locations":[{"line":3,"column":5}],"message":"Type `Domain` has no field `registration`"}],"status":200,"headers":{}},"request":{"query":"\n  query GetRegistrant($namehash: String!) {\n    domain(id: $namehash) {\n      registration {\n        registrant {\n          id\n        }\n      }\n    }\n  }\n","variables":{"namehash":"0xd4a5aec5954a3e37fc24f33c3bd145d0e258e521f74a15371e3d3079637047b3"}}}
    at /home/x/node_modules/graphql-request/src/index.ts:498:11
    at step (/home/x/node_modules/graphql-request/dist/index.js:67:23)
    at Object.next (/home/x/node_modules/graphql-request/dist/index.js:48:53)
    at fulfilled (/home/x/node_modules/graphql-request/dist/index.js:39:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  response: {
    errors: [ [Object] ],
    status: 200,
    headers: Headers { [Symbol(map)]: [Object: null prototype] }
  },
  request: {
    query: '\n' +
      '  query GetRegistrant($namehash: String!) {\n' +
      '    domain(id: $namehash) {\n' +
      '      registration {\n' +
      '        registrant {\n' +
      '          id\n' +
      '        }\n' +
      '      }\n' +
      '    }\n' +
      '  }\n',
    variables: {
      namehash: '0xd4a5aec5954a3e37fc24f33c3bd145d0e258e521f74a15371e3d3079637047b3'
    }
  }
}

However
On Goerli Network, the same function does not crash and returns, correctly, undefined since the ens domain "thisisnotregisteredens.eth" is still available to be purchased

Module not found: Error: Can't resolve 'graphql/language'

Getting this error
package.json

{
 "@ensdomains/ensjs": "^3.0.0-alpha.58",
 "ethers": "^5.7.2",
 "graphql": "^16.6.0",
 "stream": "^0.0.2",
 "typescript": "^4.9.3",
 "wagmi": "^0.7.14",
}
ERROR in ./node_modules/@ensdomains/ensjs/dist/esm/GqlManager.mjs 73:77-103

Module not found: Error: Can't resolve 'graphql/language' in 'C:\Projects\verity_web\node_modules\@ensdomains\ensjs\dist\esm'
Did you mean 'index.mjs'?
BREAKING CHANGE: The request 'graphql/language' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

image

Universal Resolver/coinType updates

Hi @TateB!

We deployed an example with your library https://github.com/TickerDao/tkn-js-example

We have two requirements:

  1. Support hybird resolvers:
    ensdomains/ens-contracts#324
  2. Support arbitrary coinTypes. We support many EVM chains that most likely won't be given 'BTC', 'SOL' style address-encoder keys.
    ensdomains/address-encoder#398

I'm posting here to track when these two dependency updates get updated here into ensjs. It looks like hopefully the dev work has already been completed on these two.

Thank you for your great work!

cc: @adraffy

TypeError: imported.GraphQLClient is not a constructor

issue file in node_modules/.pnpm/@[email protected]_mcvdqz4zwuomkpehair733j7qa/node_modules/@ensdomains/ensjs/dist/esm/GqlManager.mjs

at :

var GqlManager = class {
  gql = () => null;
  client = 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, {   // TypeError: imported.GraphQLClient is not a constructor
        requestMiddleware: requestMiddleware(visit, parse, print),
        responseMiddleware: responseMiddleware(traverse.default)
      });
      this.gql = imported.gql;
    } else {
      this.client = null;
      this.gql = () => null;
    }
  };
  request = (...arg) => this.client ? this.client.request(...arg) : null;
};

repo:

const provider = new ethers.providers.JsonRpcProvider('https://eth-goerli.g.alchemy.com/v2/xxxxxxxx')
  const ENSInstance = new ENS()
  await ENSInstance.setProvider(provider) // when i `setProvider` will show error
  ENSInstance.getName(address.value).then((res) => {
    console.log(res)
  })

and i hope u guys can add some demo, about how use v3 with goerli testnet

`getProfile` does not update at the same time of `getOwner`

Let's assume I want to register this free ENS domain myensname.eth.
In my application I check in every block if myensname.eth has been registered via polling.
Inside my app, I call the functions .getProfile and .getOwner.

  const provider = new ethers.providers.JsonRpcProvider(INFURA_NODE);
  await ENSInstance.setProvider(provider);

  provider.on("block", async () => {
    const ensProfileObject = await ENSInstance.getProfile(
      "myensname.eth"
    );

    const ensRegisteredObject = await ENSInstance.getOwner(
      "myensname.eth"
    );
    
    console.log(ensProfileObject)
    console.log(ensRegisteredObject)

}

Before registration, I have two undefined as output of the console.log

    ensProfileObject: undefined
    ensRegisteredObject: undefined

then I register the ENS on https://app.ens.domains/
After the registration I get this:

    ensProfileObject: undefined
    ensRegisteredObject: {
          registrant: '0x...402',
          owner: '0x...402',
          ownershipLevel: 'registrar'
        }

Expected:
Both .getProfile and .getOwner should return an object with the actual information
Actual:
Only .getOwner returns the object, .getProfile returns undefined

Error TS2526: A 'this' type is available only in a non-static member of a class or interface

node_modules/@ensdomains/ensjs/dist/types/index.d.ts:604:159 - error TS2526: A 'this' type is available only in a non-static member of a class or interface.

604             every<S extends string | boolean>(predicate: (value: string | boolean, index: number, array: (string | boolean)[]) => value is S, thisArg?: any): this is S[];
                                                                                                                                                                  ~~~~


Found 1 error in node_modules/@ensdomains/ensjs/dist/types/index.d.ts:604

while using in a typescript project

Question on binding `Signer` from external source

Hi ens devs, I'm currently using ensjs-v3 with wagmi (and rainbowkit). The question is when I try to setRecord using the following flow, the error shows Unhandled Runtime Error TypeError: thisRef.provider?.getSigner is not a function:

async function test(ensName: string) {
      const provider = useProvider<providers.BaseProvider>();
      const ens = new ENS();
      await ens.setProvider(provider as any);
      const profile = await ens.getProfile(ensName); // works fine
      
      const record = {
        type: 'contentHash',
        record:
          'ipns://k51qzi5uqu5dgox2z23r6e99oqency055a6xt92xzmyvpz8mwz5ycjavm0u150',
        addressOrIndex: 1,
      };
      const tx = await ens.setRecord(ensName, record as any); // errors
}

Since the setProvider param is ethers.providers.JsonRpcProvider instead of ethers.providers.web3Provider, the current way for ENS instance gets the Signer is from JsonRpcProvider.getSigner method.
Could it be possible for ENS add an API like:

      ens.setSigner(signer);

So that it will be more flexible to add external signer instead of getting from JsonRpcProvider? Or do you have any suggestion for my case using ENSjsV3 with wagmi (and rainbowkit)?

Thanks in advance for the reply!

[ERR_UNSUPPORTED_DIR_IMPORT]: Directory import in GqlManager.ts

I'm using the library in Node v19. The dynamic import(graphql/language) in GqlManager.ts is causing runtime errors

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()
}
}
}

Causes the:

    Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '/Users/adam/workspace/nimi/nimi-services/node_modules/graphql/language' is not supported resolving ES modules imported from /Users/adam/workspace/nimi/nimi-services/node_modules/@ensdomains/ensjs/dist/esm/GqlManager.mjs
Did you mean to import graphql/language/index.js?
    at new NodeError (node:internal/errors:393:5)
    at finalizeResolution (node:internal/modules/esm/resolve:253:17)
    at moduleResolve (node:internal/modules/esm/resolve:876:10)
    at defaultResolve (node:internal/modules/esm/resolve:1084:11)
    at nextResolve (node:internal/modules/esm/loader:161:28)
    at ESMLoader.resolve (node:internal/modules/esm/loader:831:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:413:18)
    at ESMLoader.import (node:internal/modules/esm/loader:514:22)
    at importModuleDynamically (node:internal/modules/esm/translators:110:35)
    at importModuleDynamicallyCallback (node:internal/process/esm_loader:36:14)

Get content hash from subnames error

Hello,

Every time I try to get a content hash from a subname, I get the following error...
I have tried with getRecords() and getContentHashRecord()
Is it possible?

  • version: 3.0.0-beta.1
  • name: hack.playerone.eth
  • network: goerli
Uncaught (in promise) ContractFunctionExecutionError: The contract function "resolve" reverted with the following reason:
UniversalResolver: Wildcard on non-extended resolvers is not supported

Contract Call:
  address:   0x56522D00C410a43BFfDF00a9A569489297385790
  function:  resolve(bytes name, bytes data)
  args:             (0x046861636b09706c617965726f6e650365746800, 0xbc1c58d1a8ad6d835ca594a6d1cd3bc2d409f4f1421c7d7191d17e2b358f2e9034856f9f)

Version: [email protected]
    at getContractError (webpack-internal:///(app-pages-browser)/./node_modules/viem/dist/esm/utils/errors/getContractError.js:31:12)
    at AsyncFunction.decode (webpack-internal:///(app-pages-browser)/./node_modules/@ensdomains/ensjs/dist/esm/functions/public/universalWrapper.js:68:70)
    at decode (webpack-internal:///(app-pages-browser)/./node_modules/@ensdomains/ensjs/dist/esm/functions/public/getContentHashRecord.js:13:87)
    at single (webpack-internal:///(app-pages-browser)/./node_modules/@ensdomains/ensjs/dist/esm/utils/generateFunction.js:20:20)
    at async _get (webpack-internal:///(app-pages-browser)/./src/web3/hooks/useEnsClient.js:150:29)
getContractError @ getContractError.js:24
decode @ universalWrapper.js:53
decode @ getContentHashRecord.js:9
single @ generateFunction.js:14
...

Missing class properties transform

`./node_modules/@ensdomains/ensjs/dist/cjs/index.js
SyntaxError: /Users/anshuman/Desktop/work related/gwei-club-web/node_modules/@ensdomains/ensjs/dist/cjs/index.js: Missing class properties transform.
40 | };
41 | class ENS {

42 | options;
| ^^^^^^^^
43 | provider;
44 | graphURI;
45 | initialProvider;
`

Can someone suggest a resolution on what is this issue?

Error when trying to import into native ESM project

I'm trying to import ENS into a node module with "type": "module" and I'm getting the following error:

SyntaxError: Cannot use import statement outside a module

Looking at the package.json for @ensdomains/ensjs it does seem like "type": "module" is not defined.

Are there plans to support native ESM?

bug: getName not resolving correct for some addresses

Package Version

3.2.0

Current Behavior

The getName function correctly resolves addresses for some ENS names (e.g., renanmav.eth and graynewfield.eth) and fails for others (e.g. alvaroraminelli.eth)

Expected Behavior

getName for the following names:

renanmav.eth
alvaroraminelli.eth
graynewfield.eth

Link to Minimal Reproducible Example (StackBlitz, CodeSandbox, GitHub repo etc.)

https://stackblitz.com/edit/viem-getting-started-uwm8cj?file=package.json,index.ts

Anything else?

No response

Question: getNames -> type parameter

in getNames there is a "type" parameter with acceptable values: "owner" | "wrappedOwner" | "registrant" | "all";

const getNames = async (
{ gqlInstance }: ENSArgs<'gqlInstance'>,
{
address: _address,
type,
page,
pageSize = 10,
orderDirection,
orderBy = 'labelName',
}: Params,

Is there any documentation that explains each of these values?
I've seen this https://docs.ens.domains/terminology, but I'm wondering is it possible for the Controller to be different from the "owner", "wrappedOwner", or "registrant"?

signer is assumed

Hi there. i reviewed with library that found out that the provider is assumed to be holding the private keys. e.g metamask. however this makes it unusable in node with providers that don't hold the private keys like infura, alchemy, etc. since they don't hold private keys they don't allow the eth_sendTransaction method. I think it would be nice to either get the signer for instantiating the contracts when in the constructor so a signer with a private key can be handed as well. this way the contract methods can be used with the aforementioned providers as well. heres a working piece of code with those things considered.

it's using the ensjs v2 but they work the same in this criteria

async function setSubnodeRecordExample() {
  const provider = new ethers.providers.JsonRpcProvider(INFURA_PROVIDER_URL);
  // const provider = providers.getDefaultProvider('mainnet');

  const signer = new ethers.Wallet(privateKey, provider);
  const ensContract = new ethers.Contract('registry.ens.eth', ensAbi.abi, signer);

  const ens = new ENS({ provider, ensAddress: getEnsAddress('1') });

  const nameWrapper = ens.name('nameWrapper.eth');
  const onwer = await nameWrapper.getOwner();

  const resolver = await nameWrapper.getResolver();

  const lh = labelhash('test');
  const nh = namehash('nameWrapper.eth');

  const Submitedtransaction = await ensContract.estimateGas.setSubnodeRecord(nh, lh, onwer, resolver, 100000);

  console.log(Submitedtransaction);
}

this way the contract is instantiated using the signer from the private key and does the job.
I'd like to hear from you guys about this.

`hexEncodeName` is broken

I am trying to figure out a dns-wire encoding for my project and I believe it's implementation in ENS lives in @ensdomains/ensjs/src/utils/hexEncodedName.ts (correct me if I am wrong). This is really just a re-export of some functionality that lives in the dns-packet package. When I try to run the following code, I get this error:

import { hexEncodeName } from '@ensdomains/ensjs/src/utils/hexEncodedName'
hexEncodeName('asdf.ens')
ERROR in node_modules/@ensdomains/ensjs/src/utils/hexEncodedName.ts:4:15
TS2339: Property 'name' does not exist on type 'typeof import("/Users/drewtada/rust/register/node_modules/@types/dns-packet/index")'.
    2 |
    3 | export const hexEncodeName = (name: string) =>
  > 4 |   `0x${packet.name.encode(name).toString('hex')}`
      |               ^^^^
    5 |
    6 | export const hexDecodeName = (hex: string): string =>
    7 |   packet.name.decode(Buffer.from(hex.slice(2), 'hex')).toString()

ERROR in node_modules/@ensdomains/ensjs/src/utils/hexEncodedName.ts:7:10
TS2339: Property 'name' does not exist on type 'typeof import("/Users/drewtada/rust/register/node_modules/@types/dns-packet/index")'.
    5 |
    6 | export const hexDecodeName = (hex: string): string =>
  > 7 |   packet.name.decode(Buffer.from(hex.slice(2), 'hex')).toString()
      |          ^^^^
    8 |

I poked around the source code for dns-packet and it doesn't look like the functionality is there either? Does anyone know where I can find some code that does this for me? I rolled my own and it works for ASCII and most UTF-8, just having some trouble with emojis and other complex characters. Thanks in advance

Fix types for ENSInstance.batch

The return type after awaiting the promise is any[] | undefined. Any chance that could be adjusted to reflect the real return type of the batched functions? Thanks!

Example below. Check the type of res.

import { ENS } from '@ensdomains/ensjs'
import { providers } from 'ethers'

const provider = new providers.AlchemyProvider(1, process.env.ALCHEMY_KEY)
const ENSInstance = new ENS()
await ENSInstance.setProvider(provider)

const res = await ENSInstance.batch(
  ENSInstance.getName.batch('0x0000000000000000000000000000000000000000')
)

getName

I will run the code below:

async function test(){
let ens = new ENS();
try{
let name = await ens.getName('0xF11804c522753E2afd2a4a8d9c1BF7AB0ABAf60f')
console.log(name)
}catch (e){
console.log(e)
}
}

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/mnt/c/src/test/js/ens/node_modules/@ensdomains/ensjs/dist/cjs/functions/initialGetters' imported from /mnt/c/src/test/js/ens/node_modules/@ensdomains/ensjs/dist/cjs/index.js
at new NodeError (internal/errors.js:322:7)
at finalizeResolution (internal/modules/esm/resolve.js:308:11)
at moduleResolve (internal/modules/esm/resolve.js:731:10)
at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:842:11)
at Loader.resolve (internal/modules/esm/loader.js:89:40)
at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)
at Loader.import (internal/modules/esm/loader.js:177:28)
at importModuleDynamically (internal/modules/cjs/loader.js:1028:27)
at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:30:14)
at ENS.mainFunc [as getName] (/mnt/c/src/test/js/ens/node_modules/@ensdomains/ensjs/dist/cjs/index.js:64:26) {
code: 'ERR_MODULE_NOT_FOUND'
}

"@ensdomains/ensjs@^3.0.0-alpha.39":
version "3.0.0-alpha.39"
node: v14.18.0

why?

Feedback

General

  • I think we should consider writing the tests so we don’t use ENSInstance on functions that are not being tests in that file. E.g. in burnFuses, we can instantiate the namewrapper contract separately and then call the function directly. transferName can call namewrapper.ownerOf, registry.owner() and registrar.ownerOf(). This will mean we can pinpoint the source of the problem instead of having a waterfall of breaking tests. We can decide how far we go with this (e.g. i can see how ENSInstance.getFuses() is much easier to use than nameWrapper.getFuses(), but I think generally we should test one thing at a time.
  • Do we not have a way to delete or edit a subname? I only see createSubname
    • We should add a way to setSubname, which could be used for a parent owner to change the owner of subnames. We could use this for delete (since it’s just setting it to 0x0…
  • getFuses should also be able to identify additional fuses that exist but aren’t documented in NameWrapper. It’s possible for users to add their own fuses and use that to burn permissions in their own smart contracts.
  • We need to have an unwrap function for namewrapper
  • Still not sure about truthLevel, because this is quite confusing for me. I think we should be verbose for now, and say something like ownershipLevel or something very explicit unless we can come up with a better term. 

    expect(result).toMatchObject({
      owner: '0x866B3c4994e1416B7C738B9818b31dC246b95eEE',
      registrant: '0x866B3c4994e1416B7C738B9818b31dC246b95eEE',
      truthLevel: 'registrar',
    })
  • The new reverse registrar will allow setName() to setName for contracts and other accounts that have approved you on the registry, so this functionality will need to be added too.
  • wrapName.ts - I think wrap and wrapETH is nice better than wrapOther.
  • getFuses.ts - should expose vulnerability, vulnerableNode, which shows what node is vulnerable and the type of vulnerability.

Tests

  • getHistory.test.ts doesn’t need revert or createSnapshot. Remove. Same for most getter functions.

batch.test.ts

  • Test to make sure it works for a single call as well
  • Test it errors when you batch unbatchable functions
  • Test it errors when you batch a batchable function with an unbatchable function

burnFuses.test.ts

  • test should have a more explicit name than “should return a transaction and succeed”
    getFuses.test.ts
  • Test for vulnerability and vulnerable node

getName.test.ts

  • Should test for a reverse record that has been set, but does not have forward resolution.

getOwner.test.ts

  • Check for registry ownership only, e.g unwrapped subdomain

setRecords.test.ts

  • Maybe we shouldn’t use batch to check for the records even though it’s convenient. Try to keep the tests from breaking if we break batch. Let’s use resolver.addr() etc.

setResolver.test.ts

  • Remove ENSInstance.getResolver() in favour of registry.resolver() and nameWrapper.resolver()
    transferName.test.ts
  • Should test for transferring registry ownership.

Docs

  • Explain the difference between batch and batchWrapper (possibly a name change to make it more explicit, it sounds like a wrapper for batch, but it seems liek it’s just when you put a batch into the universal resolver. Also as I mentioned, I think this is only useful pre CCIP-read
  • Explain options object. I specifically got confused by addressOrIndex before i checked the code itself
  • Document that getProfile automatically searches for your .eth record and returns it regardless. Or it may be confusing why that record always appears

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.