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

2834 Commits

Author SHA1 Message Date
Brad Decker
a81629e104
refactor incoming tx controller (#10639) 2021-03-19 16:54:30 -05:00
ryanml
530e8c132f
Fixing incorrectly typed token decimal attribute (#10666) 2021-03-19 10:17:39 -07:00
Shane
b50fe3184a
fix: replace dnode background with JSON-RPC (#10627)
fixes #10090
2021-03-18 11:23:46 -07:00
Dan J Miller
480512d14f
Swaps support for local testnet (#10658)
* Swaps support for local testnet

* Create util method for comparison of token addresses/symbols to default swaps token

* Get chainId from txMeta in _trackSwapsMetrics of transaction controller

* Add comment to document purpose of getTransactionGroupRecipientAddressFilter

* Use isSwapsDefaultTokenSymbol in place of repeated defaultTokenSymbol comparisons in build-quote.js
2021-03-18 07:50:06 -02:30
Brad Decker
5a233e4634
colocate tests in flat structure (#10655) 2021-03-16 16:00:08 -05:00
Dan J Miller
153bbc6053
Move swaps constants to the shared constants directory (#10614) 2021-03-15 10:51:35 -02:30
Brad Decker
3d4dfc74a8
prefer chainId over networkId in most cases (#10594) 2021-03-12 16:23:26 -06:00
Shane
b21cc5660f
fix: speedup cancellation (#10579)
fixes #7305
2021-03-12 11:26:07 -08:00
Niranjana Binoy
84b1379b40
Setting balance to 0x0 when the original value is undefined (#10634) 2021-03-12 10:20:33 -05:00
Brad Decker
2ed5bafa11
remove transactionCategory in favor of more types (#10615)
* remove transactionCategory in favor of more types

* remove reference to STANDARD in stubs
2021-03-10 14:16:44 -06:00
Erik Marks
a29fc51838
Ensure permission log will only store JSON-able data (#10524) 2021-03-10 11:50:06 -08:00
Brad Decker
38fe75b7d9
prefer chainId when building block explorer urls (#10587) 2021-03-09 15:37:19 -06:00
David Walsh
92680cf56f
Add support for multiple Ledger & Trezor hardware accounts (#10505) 2021-03-09 14:39:16 -06:00
David Walsh
aeffe176b3
Hide zero balance tokens with preference (#10486) 2021-03-09 13:35:55 -06:00
Dan J Miller
c86ceacfd9
Standard reference to ETH_SWAPS_TOKEN_ADDRESS via ETH_SWAPS_TOKEN_OBJECT.address (#10613) 2021-03-09 12:29:35 -03:30
Mark Stacey
79a7199a2f
Fix mobile sync of ERC20 tokens (#10591)
In #10510 we changed how tokens are stored, keying them by `chainId`
rather than network type. However we didn't update our mobile sync
function to account for this, which ended up breaking the filtering
logic used to prepare the data that is synced.

Specifically, custom tokens added by users are filtered out to just
those that are confirmed to be ERC20 tokens in our built-in list of
tokens. This filters out unrecognized tokens and NFTs.

The filtering logic has been restored to the pre-#10510 behaviour.
2021-03-04 18:43:15 -03:30
Brad Decker
e42658b590
cache balances by chain id (#10545) 2021-03-02 16:53:07 -06:00
Brad Decker
616b71271a
add chainId to all new transaction metadata (#10528) 2021-03-01 09:15:42 -06:00
Brad Decker
caa32d87fb
key tokens by chainId (#10510) 2021-02-26 09:40:25 -06:00
Brad Decker
1a2dc850a3
addEthereumChain bug fixes (#10520) 2021-02-25 16:25:51 -06:00
Brad Decker
15d78b8158
use chain id for enabling ENS IPFS resolution (#10507) 2021-02-25 05:40:57 -06:00
Niranjana Binoy
465dcb5e91
Wrong Currency Symbol when using Custom Network (#10490) 2021-02-24 15:39:56 -05:00
Mark Stacey
684c5855cd
Remove unused TransactionController option (#10508)
The function `getNetwork` was being passed into the
TransactionController constructor, but no such option was used in the
controller itself.
2021-02-24 01:01:09 -03:30
Brad Decker
aaec480e32
fix misuse of getCurrentNetwork (#10504) 2021-02-23 12:33:33 -06:00
Brad Decker
823466b62a
Re-add handler for addEthereumChain (#10489) 2021-02-23 10:32:46 -06:00
Brad Decker
1d23b59af3
add Custom Network Added event (#10484) 2021-02-23 09:58:35 -06:00
Shane
e3084b87cc
fix: manually connect accountsChanged (#10477)
fixes #9933
2021-02-19 09:48:49 -08:00
Austin Akers
2122b8cf16
Hide links to etherscan when no block explorer is specified for a custom network (#10455)
Conditionally render view on Etherscan text if it's a custom network

Fixes: #5631
2021-02-17 09:45:30 -03:30
Brad Decker
4c5edea294
fix contract exchange rate race condition (#10414) 2021-02-12 11:41:53 -06:00
Erik Marks
e48053a6d5
Add custom network RPC method (#9724)
Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
Co-authored-by: Brad Decker <git@braddecker.dev>
2021-02-12 09:25:58 -06:00
jpatel888
38078d7a8d
Fix BatchRequest.execute() multiple window issue (#10423) 2021-02-11 18:37:56 -03:30
Brad Decker
bd1683402a
use native currency in asset row (#10413)
* use native currency in asset row

* set native currency on startup
2021-02-11 12:20:08 -06:00
Brad Decker
19fa2f5962
cancel unapproved confirmations on network change (#10357) 2021-02-08 17:22:30 -06:00
Erik Marks
76a2a9bb8b
@metamask/eslint config@5.0.0 (#10358)
* @metamask/eslint-config@5.0.0
* Update eslintrc and prettierrc
* yarn lint:fix
2021-02-04 10:15:23 -08:00
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
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
Erik Marks
7ebab83e40
Fix logWeb3ShimUsage metrics (#10286) 2021-01-25 14:20:44 -08: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
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
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
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
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
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
Brad Decker
b5fc1f9314
improve handling of last selected provider (#10093) 2021-01-06 17:31:11 -06:00
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