1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00
Commit Graph

3882 Commits

Author SHA1 Message Date
Thomas Huang
6a89261f28
Reject Trezor eth_getEncryptionPublicKey requests (#10330)
Further implements request rejection on eth_getEncryptionPublicKey for Trezor as they do not implement this method either.
2021-02-02 07:25:30 -08:00
Mark Stacey
f9b5b7ee37
Update ko localized messages (#10266)
* Update `ko` localized messages

These translations were provided by Lionbridge.

* Update `lockoutTimeTooGreat` message

* Update statements with bold 'Never'

The sentences did not make sense previously. They have been updated to
be grammatically correct and to emphasize the negation.

* Apply suggested change to 'swapNewQuoteIn'
2021-02-02 11:22:52 -03:30
Etienne Dusseault
6b34fb4184
Use @lavamoat/allow-scripts (#10009)
* use @lavamoat/allow-scripts for package postinstall allow list
* dnode: set "weak" to false

Co-authored-by: kumavis <kumavis@users.noreply.github.com>
Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
2021-02-01 20:08:42 -08:00
Thomas Huang
23bab62008
Reject eth_getEncryptionPublicKey for ledger hw wallets (#10326)
Fixes #10111

Determine if the msgParams/address for the newRequestEncryptionPublicKey is a ledger keyring via getKeyringForAccount and return a promise rejection.
2021-02-01 12:39:09 -08:00
Mark Stacey
d8993883b7
Add origin to signature request confirmation page (#10300)
Fixes #6071

The origin of the dapp that suggested signing has been added to the
signature request confirmation page. This only applies to `eth_sign`,
`personal_sign`, `eth_signTypedData`, and `eth_signTypedData_v1`. The
confirmation page for `eth_signTypedData_v3` and `eth_signTypedData_v4`
already featured the origin.
2021-01-28 14:29:25 -03:30
Brad Decker
471140fdea
Add Truncated Definition List (#10292) 2021-01-28 11:22:37 -06:00
MetaMask Bot
d21dcb919d Version v9.0.4 2021-01-26 17:25:51 -03:30
Mark Stacey
5b48896ab1
Restore missing locale descriptions (#10261)
The localized message descriptions from the `en` locale have been
restored to all other locales. These descriptions are intended to help
translators understand the context for each message, and are not
intended to be translated.
2021-01-26 13:29:44 -03:30
Erik Marks
7ebab83e40
Fix logWeb3ShimUsage metrics (#10286) 2021-01-25 14:20:44 -08:00
Mark Stacey
7b1e12fd95
Update hi localized messages (#10264)
These translations were provided by Lionbridge.
2021-01-22 21:01:35 -08:00
Mark Stacey
74ee13f7c3 Merge remote-tracking branch 'origin/develop' into sync-master
* origin/develop: (29 commits)
  Reset swaps routeState in navigateBackToBuildQuote (#10166)
  Fix decrypt message confirmation UI crash (#10252)
  Fix site metadata JSON-RPC handler (#10243)
  Fix design system error constants (#10246)
  Remove unused environment variables (#10234)
  Update `yarn.lock` (#10241)
  Update postMessage structure for TrezorConnect 8 (#10192)
  Increase minimum Firefox version to v68 (#10195)
  Bump socket.io from 2.2.0 to 2.4.1 (#10232)
  Update `@reduxjs/toolkit` from v1.3.2 to v1.5.0 (#10228)
  eth-rpc-errors@4.0.2 (#10226)
  Add MAX_SAFE_CHAIN_ID and refactor chain ID validation (#10224)
  add chip component (#10199)
  add new typography component (#10197)
  @metamask/inpage-provider@8.0.3 (#10219)
  Add NETWORK_TYPE_RPC constant (#10203)
  Further improve organization of constants (#10200)
  add includePaths to sass-loader in storybook (#10213)
  Disable the swaps submit button after the first time it is clicked (#10162)
  Remove default to 18 decimals in quotesToRenderableData method (#10212)
  ...
2021-01-22 17:12:14 -03:30
Thomas Huang
a88a087b60 Fix site metadata JSON-RPC handler (#10243)
* Fix getting the site metadata from the request origin params.

Regressed from inpage-provider ts migration the request. The property domainMetadata is now set as a params key for the request.

https://github.com/MetaMask/inpage-provider/blob/v7.0.0/src/siteMetadata.js#L19-L25
vs
https://github.com/MetaMask/inpage-provider/blob/main/src/siteMetadata.ts#L19-L27

* Change hardcoded mocked response of the request to the prod response.
2021-01-22 15:11:09 -03:30
MetaMask Bot
ae5ee105bf Version v9.0.3 2021-01-22 18:29:03 +00:00
Thomas Huang
1dad4abfdc
Fix site metadata JSON-RPC handler (#10243)
* Fix getting the site metadata from the request origin params.

Regressed from inpage-provider ts migration the request. The property domainMetadata is now set as a params key for the request.

https://github.com/MetaMask/inpage-provider/blob/v7.0.0/src/siteMetadata.js#L19-L25
vs
https://github.com/MetaMask/inpage-provider/blob/main/src/siteMetadata.ts#L19-L27

* Change hardcoded mocked response of the request to the prod response.
2021-01-22 10:27:07 -08:00
David Walsh
9b4715cc8f
Update postMessage structure for TrezorConnect 8 (#10192) 2021-01-21 11:12:54 -06:00
Mark Stacey
408586aa4d
Increase minimum Firefox version to v68 (#10195)
Firefox v68 is the _previous_ Extended Support Release. We are
increasing this because our current minimum version doesn't support
async iterators, so some of our dependencies cause the extension to
crash.

Our metrics show that usage of Firefox versions older than this is
quite low (under 0.7% of Firefox users in the past month). These older
versions are also _very behind_ on security updates. Using the Extended
Support Release also makes it easier for us to test the minimum
version, and ensure our extension remains compatible with it.

Relates to #6805
2021-01-21 09:01:42 -06:00
Erik Marks
30ff153103
eth-rpc-errors@4.0.2 (#10226) 2021-01-20 22:06:41 -08:00
Erik Marks
4fef2b7443
Add MAX_SAFE_CHAIN_ID and refactor chain ID validation (#10224)
* Add MAX_SAFE_CHAIN_ID constant
* Add isSafeChainId to shared utils module
* Move isPrefixedFormattedHexString to shared utils module
* Validate custom RPC chain IDs in network controller
* Update some network controller error messages.
* Add isSafeChainId validation to UI
2021-01-20 15:37:18 -08:00
Mark Stacey
774b537a9b Merge remote-tracking branch 'origin/develop' into sync-master
* origin/develop:
  add new typography component (#10197)
  @metamask/inpage-provider@8.0.3 (#10219)
  Add NETWORK_TYPE_RPC constant (#10203)
  Further improve organization of constants (#10200)
  add includePaths to sass-loader in storybook (#10213)
  Disable the swaps submit button after the first time it is clicked (#10162)
  Remove default to 18 decimals in quotesToRenderableData method (#10212)
  use dart sass, and update related modules (#10208)
  Fetch with a timeout everywhere (#10101)
  Make hiring link a link on text (#10206)
  improve design system scss (#10193)
  zh_TW: Translate buy, assets, activity (#10207)
  Update TW term 乙太 -> 以太 (#10191)
  Fix hardware account selection (#10198)
  Add hiring note to the README (#10190)
  drop the fox in about (#10174)
2021-01-20 18:55:04 -03:30
MetaMask Bot
d7e1ee166f Version v9.0.2 2021-01-20 10:49:50 -08:00
Yahsin Huang
32121107c2 zh_TW: Translate buy, assets, activity (#10207) 2021-01-20 10:49:50 -08:00
gasolin
9ed181f4e1 Update TW term 乙太 -> 以太 (#10191) 2021-01-20 10:49:50 -08:00
Erik Marks
7077ee68dc
Add NETWORK_TYPE_RPC constant (#10203)
* Refactor network display props
* Add NETWORK_TYPE_RPC constant
* Consolidate network constants
2021-01-20 08:49:05 -08:00
Erik Marks
90289ec22a
Further improve organization of constants (#10200) 2021-01-20 08:13:14 -08:00
Erik Marks
7159dd6867
Fetch with a timeout everywhere (#10101)
* Use fetchWithTimeout everywhere
* Memoize getFetchWithTimeout
* Require specified timeout
2021-01-19 08:41:57 -08:00
Yahsin Huang
1007f4b6f2
zh_TW: Translate buy, assets, activity (#10207) 2021-01-18 13:29:01 -08:00
gasolin
b0bb190b5e
Update TW term 乙太 -> 以太 (#10191) 2021-01-18 13:18:27 -08:00
MetaMask Bot
51b736245b Version v9.0.1 2021-01-12 20:30:10 -08:00
Erik Marks
0dfdd44ae7
Restore support for @metamask/inpage provider@"< 8.0.0" (#10179)
This restores support for versions of the inpage provider prior to v8.
This is intended to support dapps and extensions that directly
instantiated their own provider rather than using the injected
provider.

* Forward traffic between old and new provider streams

* Ignore publicConfig stream for non-legacy muxes

* Transform accountsChanged notification for legacy streams

* Convert publicConfigStore to singleton

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-01-12 17:43:45 -08:00
MetaMask Bot
6369f88571 Version v9.0.0 2021-01-11 11:12:19 -03:30
Dan J Miller
2431a5821c
Migration 51: ensure chainId is set in state for default/infura providers (#10170)
* Migration 51: ensure chainId is set in network controller provider state for all infura/default networks

* Clean up

* Migrate incorrect as well as falsy chainIds

Co-authored-by: Erik Marks <rekmarks@protonmail.com>
2021-01-11 11:09:15 -03:30
Wanshan
bcdd2ec91e
Update zh_CN translation (#9772)
* Update zh_CN translation

* Translate 'Gas Limit' to 'Gas 上限'

Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
2021-01-08 10:19:41 -08:00
Mark Stacey
69e883c728
Detect tokens on custom Mainnet RPC endpoints (#10157)
Our automatic token detection was hard-coded to only work on our built-
in Infura Mainnet endpoint. It now works with custom Mainnet RPC
endpoints as well.

Relates to #6992
2021-01-08 10:55:46 -03:30
Erik Marks
bc6663d849
Fix block explorer translations (#10160) 2021-01-07 13:13:00 -08:00
Mark Stacey
672a387779 Merge remote-tracking branch 'origin/develop' into sync-master
* origin/develop: (66 commits)
  Disable swaps based on chainId, instead of network id (#10155)
  improve handling of last selected provider (#10093)
  Add links to Community Forum to README (#10152)
  @metamask/contract-metadata@1.21.0 (#10142)
  Prevent malformed next nonce warning (#10143)
  add module resolution for node-analytics/axios (#10139)
  Ensure that gas for swap tx submitted at same time as approval is in hex (#10135)
  Fix useTransactionDisplayData unit tests (#10134)
  Fix network settings Kovan block explorer link (#10117)
  Use destructured signal (#10115)
  throw a new wrapped error instead of default one from segment (#10118)
  @metamask/contract-metadata@1.20.0 (#10116)
  Use late-bound noop function when disabling console (#10110)
  Bump @metamask/contract-metadata from 1.19.0 to 1.20.0 (#10104)
  Remove unnecessary swaps footer space when in dropdown mode (#10100)
  Tighten up loading indication logic (#10103)
  Skip reporting of successive persistence failures (#10099)
  Update `@metamask/controllers` to v5.1.0 (#10096)
  @metamask/obs-store@5.0.0 (#10092)
  set last provider when switching to a customRPC (#10084)
  ...
2021-01-07 15:57:40 -03:30
Dan Miller
a30d39f3f3 Version v8.1.11 2021-01-07 14:25:34 -03:30
Brad Decker
b5fc1f9314
improve handling of last selected provider (#10093) 2021-01-06 17:31:11 -06:00
Mark Stacey
7606353100 Merge remote-tracking branch 'origin/develop' into sync-master
* origin/develop: (60 commits)
  Ensure that gas for swap tx submitted at same time as approval is in hex (#10135)
  Fix useTransactionDisplayData unit tests (#10134)
  Fix network settings Kovan block explorer link (#10117)
  Use destructured signal (#10115)
  throw a new wrapped error instead of default one from segment (#10118)
  @metamask/contract-metadata@1.20.0 (#10116)
  Use late-bound noop function when disabling console (#10110)
  Bump @metamask/contract-metadata from 1.19.0 to 1.20.0 (#10104)
  Remove unnecessary swaps footer space when in dropdown mode (#10100)
  Tighten up loading indication logic (#10103)
  Skip reporting of successive persistence failures (#10099)
  Update `@metamask/controllers` to v5.1.0 (#10096)
  @metamask/obs-store@5.0.0 (#10092)
  set last provider when switching to a customRPC (#10084)
  Fetch swap quote refresh time from API (#10069)
  Fix `fetch-with-cache` handling of interwoven requests (#10079)
  Fix 9874 - Improve gas maximum estimation  (#10043)
  Add eth_getProof to safe methods (#10070)
  fix metametrics option tracking (#10071)
  Disable console in contentscript (#10040)
  ...
2021-01-04 15:26:46 -03:30
MetaMask Bot
a8d1cdb7ee Version v8.1.10 2020-12-23 14:04:00 -03:30
Brad Decker
1aa6d7bfea throw a new wrapped error instead of default one from segment (#10118) 2020-12-23 14:04:00 -03:30
Mark Stacey
a492a5b0d1 Use late-bound noop function when disabling console (#10110)
The `disable-console` script introduced in #10040 used an arrow-
function no-op function to replace `console.log` and `console.info`.
This replacement function was early-bound to the `this` context of the
`disable-console` script, because that's how arrow functions work.

This violates an assumption baked into Sentry, which also replaces the
`console` functions. It wraps them in a function it uses to track
console logs as breadcrumbs. This wrapper function blows up for some
reason if the "original" `console` function is early-bound to a `this`
value of `undefined`.

This resulted in various UI freezes. One example is during onboarding,
when using Firefox with Enhanced Tracking Protection set in "strict"
mode. After submitting a password in the 'Create wallet' flow, the
Sentry `console` wrapper would throw and leave the user stuck on the
loading screen.

By replacing the no-op arrow function with a no-op function
declaration, the problem has been resolved.

Relates to #10097
2020-12-23 14:04:00 -03:30
David Walsh
c42087d044
Use destructured signal (#10115) 2020-12-23 10:15:07 -06:00
Brad Decker
64adcae08d
throw a new wrapped error instead of default one from segment (#10118) 2020-12-23 00:24:49 -03:30
Mark Stacey
889ca62723
Use late-bound noop function when disabling console (#10110)
The `disable-console` script introduced in #10040 used an arrow-
function no-op function to replace `console.log` and `console.info`.
This replacement function was early-bound to the `this` context of the
`disable-console` script, because that's how arrow functions work.

This violates an assumption baked into Sentry, which also replaces the
`console` functions. It wraps them in a function it uses to track
console logs as breadcrumbs. This wrapper function blows up for some
reason if the "original" `console` function is early-bound to a `this`
value of `undefined`.

This resulted in various UI freezes. One example is during onboarding,
when using Firefox with Enhanced Tracking Protection set in "strict"
mode. After submitting a password in the 'Create wallet' flow, the
Sentry `console` wrapper would throw and leave the user stuck on the
loading screen.

By replacing the no-op arrow function with a no-op function
declaration, the problem has been resolved.

Relates to #10097
2020-12-19 16:58:49 -03:30
Mark Stacey
8dd8bfd690 Skip reporting of successive persistence failures (#10099)
Failure to persist state will now only report to Sentry if the last
attempt to save state succeeded. This ensures that if anyone is stuck
in a state where state can't be saved (e.g. low disk space), we aren't
flooded with repeated errors on Sentry.
2020-12-18 17:36:58 -03:30
Mark Stacey
d2b6376c3d
Skip reporting of successive persistence failures (#10099)
Failure to persist state will now only report to Sentry if the last
attempt to save state succeeded. This ensures that if anyone is stuck
in a state where state can't be saved (e.g. low disk space), we aren't
flooded with repeated errors on Sentry.
2020-12-17 15:39:01 -03:30
Mark Stacey
bba2b9646d
Update @metamask/controllers to v5.1.0 (#10096)
This update comes with a breaking change to the Approval controller. It
now requires a `defaultApprovalType` parameter.

I don't think we have any use for a default approval type, but I've
added a "NO_TYPE" one for now because it's a strict requirement. We
should consider making this parameter optional in the future, for cases
like this where it's not needed.

This update will hopefully address some caching issues we've been
seeing with our phishing configuration. See here for more details:
https://github.com/MetaMask/controllers/pull/297
2020-12-17 12:06:29 -03:30
Erik Marks
e05be40d92
@metamask/obs-store@5.0.0 (#10092) 2020-12-16 13:14:49 -08:00
Mark Stacey
4a48f17420 Merge remote-tracking branch 'origin/develop' into sync-master
* origin/develop: (46 commits)
  Fetch swap quote refresh time from API (#10069)
  Fix `fetch-with-cache` handling of interwoven requests (#10079)
  Fix 9874 - Improve gas maximum estimation  (#10043)
  Add eth_getProof to safe methods (#10070)
  fix metametrics option tracking (#10071)
  Disable console in contentscript (#10040)
  Use Boolean for filters (#10066)
  Add approval controller (#9401)
  Cache dependencies (#10065)
  Bump ini from 1.3.5 to 1.3.7 (#10064)
  Add HTML coverage report to MetaMask bot comment (#10061)
  Remove coveralls (#10063)
  Prevent metaMaskFee prop error in FeeCard (#10047)
  Display boolean values when signing typed data (#10048)
  Use CircleCI executors to simplify CI config (#10055)
  Use `.zip` for Firefox e2e tests (#10056)
  Update `selenium-webdriver` and `geckodriver` (#10057)
  Update Firefox version used on CI for e2e tests (#10058)
  Add web3 shim usage notification (#10039)
  Refactor home notification (#10046)
  ...
2020-12-15 19:40:19 -03:30
MetaMask Bot
5d30613120 Version v8.1.9 2020-12-15 16:56:00 -03:30