-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detect chainIds in eip681 URIs #882
base: master
Are you sure you want to change the base?
Conversation
src/ethereum/EthereumTools.ts
Outdated
@@ -205,6 +206,21 @@ export class EthereumTools implements EdgeCurrencyTools { | |||
} | |||
address = contractAddress | |||
|
|||
// Split the address to get the chainId according to EIP-681 | |||
if (address.includes('@')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this allow using an Ethereum: uri with an L2 like optimism if and only if the chainId exists?
96cb5e2
to
8cb7297
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved, but please remove the else
throw new Error( | ||
'chainId must be present when using ethereum: prefix on a non-ethereum network' | ||
) | ||
} else if (address.includes('@')) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This else
isn't needed, since the previous if
can only throw. Un-indenting this block would make it more obvious that it runs in every case, assuming we pass the error check.
CHANGELOG
Does this branch warrant an entry to the CHANGELOG?
Dependencies
noneDescription
none