Only the first parameter, `type`, was ever passed in. The others are
superfluous. The defaults have been set directly instead.
It's a bit silly to set the `rpcUrl` and `nickname` to an empty string,
but to make this more sensible would take much more effort. This at
least is simpler and guaranteed to be equivalent.
* Moving RPC Urls to network constants
* Including RPC url in switchEthereumChain requestData
* Setting project id to var
* Fix built-in networks switch-ethereum-chain
`switch-ethereum-chain` did not work correctly with built-in networks.
It was treating them as custom networks, rather than as built-in
networks. This affected how they were displayed in the network
dropdown, and resulted in slight differences to the network stack used
as well.
The problem was that `updateRpcTarget` was used, which was meant for
custom networks only. Now that `setProviderType` is used in the case of
a built-in network, the behaviour should match the network switcher
exactly.
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
* Moving RPC Urls to network constants
* Including RPC url in switchEthereumChain requestData
* Setting project id to var
* Fix built-in networks switch-ethereum-chain
`switch-ethereum-chain` did not work correctly with built-in networks.
It was treating them as custom networks, rather than as built-in
networks. This affected how they were displayed in the network
dropdown, and resulted in slight differences to the network stack used
as well.
The problem was that `updateRpcTarget` was used, which was meant for
custom networks only. Now that `setProviderType` is used in the case of
a built-in network, the behaviour should match the network switcher
exactly.
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
* Removing support notification from what's new
* Adding migration for support notification removal
* Expanding test cases, using async/await for storage comparison
Sentry is now configured with environment variables, rather than with
hard-coded values. This makes it easier to test Sentry functionality
using a different Sentry account, as we did recently during QA of
v9.5.1.
The only change for the normal build process is the introduction of the
`SENTRY_DSN_DEV` variable, which can be set via `.metamaskrc` or via an
environment variable. This determines where error reports are sent. It
still defaults to our team Sentry account's `metamask-testing` project.
The `sentry:publish` script now requires SENTRY_ORG and SENTRY_PROJECT
to be set in order to publish release artifacts. The CircleCI
configuration has been updated with these values, so it should act the
same as it did before. Previously we had used a CLI flag to specify the
organization and project, but Sentry already natively supports these
environment variables [1].
[1]: https://docs.sentry.io/product/cli/configuration/#configuration-values
* Add a notification for BSC Swaps
* Add a new logo for BSC sources, update an image for BSC notification
* Mark a BSC notification as seen when a user clicks on “Start swapping”
* Add conditional rendering of notifications
* Remove divider for the last notification
* Remove a divider for the last notification
* Remove !
* Trigger pipeline
Three uses of `hasOwnProperty.call` have been replaced with simpler
alternatives. I did this because I found this convention confusing.
The `ComposableObservableStore` changes required adding a check for
whether the `config` is defined, because the old syntax would allow
iterating over `undefined` as if it was an empty object. Functionally
it should be identical. A new test was added to highlight this
functionality.
The version field is now stored in the main `package.json` file rather
than in the base manifest. It is built into the final manifest during
the build script.
This makes it easier to communicate what the current version should be
to our `auto-changelog` script. It's also generally a more conventional
place to keep track of the version, even considering that we're not
publishing to npm.
The `assert` module has two modes: "Legacy" and "strict". When using
strict mode, the "strict" version of each assertion method is implied.
Whereas in legacy mode, by default it will use the deprecated, "loose"
version of each assertion.
We now use strict mode everywhere. A few tests required updates where
they were asserting the wrong thing, and it was passing beforehand due
to the loose matching.
The `SET_CURRENT_FIAT` action has been removed. It has been replaced
by a call to `forceUpdateMetamaskState`. The only purpose of this
action was to eagerly update the current fiat currency settings before
the next state update. Forcing a state update instead is simpler and
safer.
The `setCurrentCurrency` function in the background has been updated to
no longer return the state, now that it's no longer needed.
* Allow 0% slippage, show a warning for 0 < slippage <= 1, disable “Review Swap” button for negative slippage
* Update a translation key, use both new and old key until it’s translated everywhere
* Keep an old key for `en`: swapSlippageTooLow
* Fix an ESLint issue
* Only use swapSlippageNegative, remove swapSlippageTooLow
* warn users when they attempt to add a network that is already configured
* clean up validation logic
* fixing up e2e tests
* Update test/e2e/helpers.js
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
* Show custom tokens in Swaps
* Add messages for adding a custom token in Swaps
* Add the first version of importing custom tokens in swaps
* Fix lint rules
* Create a new component: ImportToken
* Remove a pointer cursor from regular heading
* Fix a CSS issue for tokens with long names
* Update a comment
* Don’t return a custom token if it doesn’t have symbol or decimals
* Only search by contract address if nothing was found
* Track “Token Imported” event
* Fix unit tests
* Import tracking for “Token Imported”, increase token icon font size
* Disable token import for Source Token
* Update logic and content for notifications, update tests
* Do not hide a dropdown placeholder on click, so a user can click on a link
* Update a key name
* Update styling for the “danger” type notification in Swaps
* Show either a warning or danger notification based on token verification occurences
* Remove testnets from SWAPS_CHAINID_DEFAULT_BLOCK_EXPLORER_URL_MAP
* Use the “shouldSearchForImports” prop
* Create a new function for handling token import: “onOpenImportTokenModalClick”
* Filter token duplicities before iterating over tokens
* Use “address” instead of “symbol” for checking uniqueness
* Trigger Build
* Use a new API (/token) to get token data for importing in Swaps
* Temporarily decrese Jest threshold for functions