Network Specific ENS Lookup#228
Merged
dOrgJelli merged 19 commits intoprealpha-devfrom Apr 12, 2021
Merged
Conversation
…fic-ens-lookup # Conflicts: # packages/js/plugins/ethereum/src/index.ts
namesty
reviewed
Apr 11, 2021
Collaborator
namesty
left a comment
There was a problem hiding this comment.
I noted we cannot have more than one connection to the same network. I don't know if this is something we should allow anyways
Contributor
Author
Hmmm interesting... I don't think this is a use-case we need to worry about since current wallets don't support this anyway. The most I've seen done in relation to this is having multiple fallback endpoints for a single network (ethersjs does this). I've never seen a library support multiple providers for a single network. How would we differentiate between them? Maybe an interface like this may make sense? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Notable Changes
Ethereum Plugin
Constructor
The EthereumPlugin can now be constructed with multiple network connections like so:
If no provider is provided, the name of the network (ex: "rinkeby" above) is used to get a default provider from ethers.js.
Connection Class
Multiple network connections is made possible by abstracting away the concept of a network connection into the
Connectionclass.Schema
The EthereumPlugin's schema has been updated to allow for custom network configurations to be specified. These configuration options are used to select which network connection you'd like to transact with.
ENS Plugin
The EnsPlugin has been updated to allow for network names in the URI's path like so:
If no network is specified,
mainnetis used.SimpleStorage Web3API Demo
The SimpleStorage Web3API demo has been updated in the following ways:
e2e.jsonquery recipe now specifies/ens/testnet/simplestorage.ethfor the API it is connecting to.If nothing is specified, the EthereumPlugin's
defaultProvideris used.NOTE: in the future nested configuration values like this will be configured through Web3API env variables (see: #140)
3. The
e2e.jsonqueries set the query method'sconnectiontotestnet. Otherwise, the Web3API would try and send transactions tomainnet.