2022-07-19 10:35:45 +02:00
import { draftTransactionInitialState } from '../ui/ducks/send' ;
2021-02-08 17:49:49 +01:00
const state = {
2021-09-13 23:04:31 +02:00
invalidCustomNetwork : {
state : 'CLOSED' ,
networkName : '' ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
unconnectedAccount : {
state : 'CLOSED' ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-20 21:05:58 +02:00
activeTab : {
id : 113 ,
title : 'E2E Test Dapp' ,
origin : 'https://metamask.github.io' ,
protocol : 'https:' ,
url : 'https://metamask.github.io/test-dapp/' ,
2021-08-31 00:56:34 +02:00
} ,
2022-03-31 16:41:39 +02:00
networkList : [
{
2022-07-22 00:43:31 +02:00
blockExplorerUrl : 'https://etherscan.io' ,
chainId : '0x1' ,
2022-03-31 16:41:39 +02:00
iconColor : 'var(--mainnet)' ,
isATestNetwork : false ,
2022-07-22 00:43:31 +02:00
labelKey : 'mainnet' ,
providerType : 'mainnet' ,
rpcUrl : 'https://mainnet.infura.io/v3/' ,
ticker : 'ETH' ,
2022-03-31 16:41:39 +02:00
viewOnly : true ,
} ,
{
2022-07-22 00:43:31 +02:00
blockExplorerUrl : 'https://ropsten.etherscan.io' ,
chainId : '0x3' ,
2022-03-31 16:41:39 +02:00
iconColor : 'var(--ropsten)' ,
isATestNetwork : true ,
2022-07-22 00:43:31 +02:00
labelKey : 'ropsten' ,
providerType : 'ropsten' ,
rpcUrl : 'https://ropsten.infura.io/v3/' ,
ticker : 'ETH' ,
2022-03-31 16:41:39 +02:00
viewOnly : true ,
} ,
{
2022-07-22 00:43:31 +02:00
blockExplorerUrl : 'https://rinkeby.etherscan.io' ,
chainId : '0x4' ,
2022-03-31 16:41:39 +02:00
iconColor : 'var(--rinkeby)' ,
isATestNetwork : true ,
2022-07-22 00:43:31 +02:00
labelKey : 'rinkeby' ,
providerType : 'rinkeby' ,
rpcUrl : 'https://rinkeby.infura.io/v3/' ,
ticker : 'ETH' ,
2022-03-31 16:41:39 +02:00
viewOnly : true ,
} ,
{
2022-07-22 00:43:31 +02:00
blockExplorerUrl : 'https://goerli.etherscan.io' ,
chainId : '0x5' ,
2022-03-31 16:41:39 +02:00
iconColor : 'var(--goerli)' ,
isATestNetwork : true ,
2022-07-22 00:43:31 +02:00
labelKey : 'goerli' ,
providerType : 'goerli' ,
rpcUrl : 'https://goerli.infura.io/v3/' ,
ticker : 'ETH' ,
2022-03-31 16:41:39 +02:00
viewOnly : true ,
} ,
{
2022-07-22 00:43:31 +02:00
blockExplorerUrl : 'https://kovan.etherscan.io' ,
chainId : '0x2a' ,
2022-03-31 16:41:39 +02:00
iconColor : 'var(--kovan)' ,
isATestNetwork : true ,
2022-07-22 00:43:31 +02:00
labelKey : 'kovan' ,
providerType : 'kovan' ,
rpcUrl : 'https://kovan.infura.io/v3/' ,
ticker : 'ETH' ,
2022-03-31 16:41:39 +02:00
viewOnly : true ,
} ,
{
2022-07-22 00:43:31 +02:00
blockExplorerUrl : '' ,
chainId : '0x539' ,
2022-03-31 16:41:39 +02:00
iconColor : 'var(--localhost)' ,
isATestNetwork : true ,
2022-07-22 00:43:31 +02:00
label : 'Localhost 8545' ,
providerType : 'rpc' ,
rpcUrl : 'http://localhost:8545' ,
ticker : 'ETH' ,
2022-03-31 16:41:39 +02:00
} ,
{
2022-07-22 00:43:31 +02:00
blockExplorerUrl : 'https://bscscan.com' ,
chainId : '0x38' ,
2022-03-31 16:41:39 +02:00
iconColor : 'var(--localhost)' ,
isATestNetwork : false ,
2022-07-22 00:43:31 +02:00
label : 'Binance Smart Chain' ,
providerType : 'rpc' ,
rpcUrl : 'https://bsc-dataseed.binance.org/' ,
ticker : 'BNB' ,
2022-03-31 16:41:39 +02:00
} ,
{
2022-07-22 00:43:31 +02:00
blockExplorerUrl : 'https://cchain.explorer.avax.network/' ,
chainId : '0xa86a' ,
2022-03-31 16:41:39 +02:00
iconColor : 'var(--localhost)' ,
isATestNetwork : false ,
2022-07-22 00:43:31 +02:00
label : 'Avalanche' ,
providerType : 'rpc' ,
rpcUrl : 'https://api.avax.network/ext/bc/C/rpc' ,
ticker : 'AVAX' ,
2022-03-31 16:41:39 +02:00
} ,
{
2022-07-22 00:43:31 +02:00
blockExplorerUrl : 'https://polygonscan.com' ,
chainId : '0x89' ,
2022-03-31 16:41:39 +02:00
iconColor : 'var(--localhost)' ,
isATestNetwork : false ,
2022-07-22 00:43:31 +02:00
label : 'Polygon' ,
providerType : 'rpc' ,
rpcUrl : 'https://polygon-rpc.com' ,
ticker : 'MATIC' ,
2022-03-31 16:41:39 +02:00
} ,
] ,
2021-09-20 21:05:58 +02:00
metamask : {
2021-10-04 15:46:18 +02:00
tokenList : {
2022-05-09 19:47:06 +02:00
'0x514910771af9ca656af840dff83e8264ecf986ca' : {
address : '0x514910771af9ca656af840dff83e8264ecf986ca' ,
symbol : 'LINK' ,
decimals : 18 ,
name : 'ChainLink Token' ,
iconUrl : 'https://crypto.com/price/coin-data/icon/LINK/color_icon.png' ,
aggregators : [
'Aave' ,
'Bancor' ,
'CMC' ,
'Crypto.com' ,
'CoinGecko' ,
'1inch' ,
'Paraswap' ,
'PMM' ,
'Zapper' ,
'Zerion' ,
'0x' ,
] ,
occurrences : 12 ,
2022-07-22 00:43:31 +02:00
unlisted : false ,
2022-05-09 19:47:06 +02:00
} ,
'0xc00e94cb662c3520282e6f5717214004a7f26888' : {
address : '0xc00e94cb662c3520282e6f5717214004a7f26888' ,
symbol : 'COMP' ,
decimals : 18 ,
name : 'Compound' ,
iconUrl : 'https://crypto.com/price/coin-data/icon/COMP/color_icon.png' ,
aggregators : [
'Bancor' ,
'CMC' ,
'Crypto.com' ,
'CoinGecko' ,
'1inch' ,
'Paraswap' ,
'PMM' ,
'Zapper' ,
'Zerion' ,
'0x' ,
] ,
occurrences : 12 ,
2022-07-22 00:43:31 +02:00
unlisted : false ,
2022-05-09 19:47:06 +02:00
} ,
'0xfffffffff15abf397da76f1dcc1a1604f45126db' : {
address : '0xfffffffff15abf397da76f1dcc1a1604f45126db' ,
symbol : 'FSW' ,
decimals : 18 ,
name : 'Falconswap' ,
2022-07-22 00:43:31 +02:00
iconUrl :
'https://assets.coingecko.com/coins/images/12256/thumb/falconswap.png?1598534184' ,
aggregators : [ 'CoinGecko' , '1inch' , 'Paraswap' , 'Zapper' , 'Zerion' ] ,
2022-05-09 19:47:06 +02:00
occurrences : 12 ,
2022-07-22 00:43:31 +02:00
unlisted : false ,
2022-05-09 19:47:06 +02:00
} ,
2022-04-01 17:52:22 +02:00
'0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f' : {
address : '0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f' ,
symbol : 'SNX' ,
decimals : 18 ,
name : 'Synthetix Network Token' ,
iconUrl : 'https://assets.coingecko.com/coins/images/3406/large/SNX.png' ,
aggregators : [
'Aave' ,
'Bancor' ,
'CMC' ,
'Crypto.com' ,
'CoinGecko' ,
'1inch' ,
'Paraswap' ,
'PMM' ,
'Synthetix' ,
'Zapper' ,
'Zerion' ,
'0x' ,
] ,
occurrences : 12 ,
2022-07-22 00:43:31 +02:00
unlisted : false ,
2022-04-01 17:52:22 +02:00
} ,
2021-10-04 15:46:18 +02:00
'0x6b175474e89094c44da98b954eedeac495271d0f' : {
address : '0x6b175474e89094c44da98b954eedeac495271d0f' ,
symbol : 'META' ,
decimals : 18 ,
image : 'metamark.svg' ,
2022-07-22 00:43:31 +02:00
unlisted : false ,
2021-10-04 15:46:18 +02:00
} ,
'0xB8c77482e45F1F44dE1745F52C74426C631bDD52' : {
address : '0xB8c77482e45F1F44dE1745F52C74426C631bDD52' ,
symbol : '0X' ,
decimals : 18 ,
image : '0x.svg' ,
2022-07-22 00:43:31 +02:00
unlisted : false ,
2021-10-04 15:46:18 +02:00
} ,
'0x1f9840a85d5af5bf1d1762f925bdaddc4201f984' : {
address : '0x1f9840a85d5af5bf1d1762f925bdaddc4201f984' ,
symbol : 'AST' ,
decimals : 18 ,
image : 'ast.png' ,
2022-07-22 00:43:31 +02:00
unlisted : false ,
2021-10-04 15:46:18 +02:00
} ,
'0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2' : {
address : '0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2' ,
symbol : 'BAT' ,
decimals : 18 ,
image : 'BAT_icon.svg' ,
2022-07-22 00:43:31 +02:00
unlisted : false ,
2021-10-04 15:46:18 +02:00
} ,
'0xe83cccfabd4ed148903bf36d4283ee7c8b3494d1' : {
address : '0xe83cccfabd4ed148903bf36d4283ee7c8b3494d1' ,
symbol : 'CVL' ,
decimals : 18 ,
image : 'CVL_token.svg' ,
2022-07-22 00:43:31 +02:00
unlisted : false ,
2021-10-04 15:46:18 +02:00
} ,
'0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e' : {
address : '0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e' ,
symbol : 'GLA' ,
decimals : 18 ,
image : 'gladius.svg' ,
2022-07-22 00:43:31 +02:00
unlisted : false ,
2021-10-04 15:46:18 +02:00
} ,
'0x467Bccd9d29f223BcE8043b84E8C8B282827790F' : {
address : '0x467Bccd9d29f223BcE8043b84E8C8B282827790F' ,
symbol : 'GNO' ,
decimals : 18 ,
image : 'gnosis.svg' ,
2022-07-22 00:43:31 +02:00
unlisted : false ,
2021-10-04 15:46:18 +02:00
} ,
'0xff20817765cb7f73d4bde2e66e067e58d11095c2' : {
address : '0xff20817765cb7f73d4bde2e66e067e58d11095c2' ,
symbol : 'OMG' ,
decimals : 18 ,
image : 'omg.jpg' ,
2022-07-22 00:43:31 +02:00
unlisted : false ,
2021-10-04 15:46:18 +02:00
} ,
'0x8e870d67f660d95d5be530380d0ec0bd388289e1' : {
address : '0x8e870d67f660d95d5be530380d0ec0bd388289e1' ,
symbol : 'WED' ,
decimals : 18 ,
image : 'wed.png' ,
2022-07-22 00:43:31 +02:00
unlisted : false ,
2021-10-04 15:46:18 +02:00
} ,
} ,
2021-09-20 21:05:58 +02:00
networkDetails : {
EIPS : {
1559 : true ,
2021-07-30 12:06:35 +02:00
} ,
} ,
2021-09-24 03:40:03 +02:00
gasFeeEstimates : '0x5208' ,
swapsState : {
quotes : { } ,
fetchParams : null ,
tokens : null ,
tradeTxId : null ,
approveTxId : null ,
quotesLastFetched : null ,
customMaxGas : '' ,
customGasPrice : null ,
selectedAggId : null ,
customApproveTxData : '' ,
errorKey : '' ,
topAggId : null ,
routeState : '' ,
swapsFeatureIsLive : false ,
swapsQuoteRefreshTime : 60000 ,
} ,
2022-07-22 00:43:31 +02:00
snapStates : { } ,
snaps : {
'local:http://localhost:8080/' : {
enabled : true ,
id : 'local:http://localhost:8080/' ,
initialPermissions : {
snap _confirm : { } ,
2022-02-15 01:02:51 +01:00
} ,
2022-07-22 00:43:31 +02:00
manifest : {
description : 'An example MetaMask Snap.' ,
initialPermissions : {
snap _confirm : { } ,
2022-02-15 01:02:51 +01:00
} ,
2022-07-22 00:43:31 +02:00
manifestVersion : '0.1' ,
proposedName : 'MetaMask Example Snap' ,
repository : {
type : 'git' ,
url : 'https://github.com/MetaMask/snaps-skunkworks.git' ,
2022-02-15 01:02:51 +01:00
} ,
2022-07-22 00:43:31 +02:00
source : {
location : {
npm : {
filePath : 'dist/bundle.js' ,
iconPath : 'images/icon.svg' ,
packageName : '@metamask/example-snap' ,
registry : 'https://registry.npmjs.org/' ,
} ,
2022-02-15 01:02:51 +01:00
} ,
2022-07-22 00:43:31 +02:00
shasum : '3lEt0yUu080DwV78neROaAAIQWXukSkMnP4OBhOhBnE=' ,
2022-02-15 01:02:51 +01:00
} ,
2022-07-22 00:43:31 +02:00
version : '0.6.0' ,
2022-02-15 01:02:51 +01:00
} ,
2022-07-22 00:43:31 +02:00
permissionName : 'wallet_snap_local:http://localhost:8080/' ,
sourceCode : '(...)' ,
status : 'stopped' ,
svgIcon : '<svg>...</svg>' ,
version : '0.6.0' ,
2022-02-15 01:02:51 +01:00
} ,
2022-07-22 00:43:31 +02:00
'Filecoin Snap' : {
enabled : true ,
id : 'npm:http://localhost:8080/' ,
initialPermissions : {
snap _confirm : { } ,
eth _accounts : { } ,
snap _manageState : { } ,
2022-02-15 01:02:51 +01:00
} ,
2022-07-22 00:43:31 +02:00
manifest : {
description :
'This swap provides developers everywhere access to an entirely new data storage paradigm, even letting your programs store data autonomously. Learn more.' ,
initialPermissions : {
snap _confirm : { } ,
eth _accounts : { } ,
snap _manageState : { } ,
2022-02-15 01:02:51 +01:00
} ,
2022-07-22 00:43:31 +02:00
manifestVersion : '0.1' ,
proposedName : 'Filecoin Snap' ,
repository : {
type : 'git' ,
url : 'https://github.com/MetaMask/snaps-skunkworks.git' ,
2022-02-15 01:02:51 +01:00
} ,
2022-07-22 00:43:31 +02:00
source : {
location : {
npm : {
filePath : 'dist/bundle.js' ,
iconPath : 'images/icon.svg' ,
packageName : '@metamask/example-snap' ,
registry : 'https://registry.npmjs.org/' ,
} ,
2022-02-15 01:02:51 +01:00
} ,
2022-07-22 00:43:31 +02:00
shasum : '3lEt0yUu080DwV78neROaAAIQWXukSkMnP4OBhOhBnE=' ,
2022-02-15 01:02:51 +01:00
} ,
2022-07-22 00:43:31 +02:00
version : '0.6.0' ,
2022-02-15 01:02:51 +01:00
} ,
2022-07-22 00:43:31 +02:00
permissionName : 'wallet_snap_npm:http://localhost:8080/' ,
sourceCode : '(...)' ,
status : 'stopped' ,
svgIcon : '<svg>...</svg>' ,
version : '0.6.0' ,
2022-02-15 01:02:51 +01:00
} ,
} ,
2021-09-29 20:42:49 +02:00
accountArray : [
{
name : 'This is a Really Long Account Name' ,
address : '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4' ,
index : 0 ,
balance : '0x176e5b6f173ebe66' ,
} ,
{
name : 'Account 2' ,
address : '0xb19ac54efa18cc3a14a5b821bfec73d284bf0c5e' ,
index : 1 ,
balance : '0x2d3142f5000' ,
} ,
] ,
connectedAccounts : [ '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4' ] ,
2021-09-20 21:05:58 +02:00
isInitialized : true ,
isUnlocked : true ,
isAccountMenuOpen : false ,
rpcUrl : 'https://rawtestrpc.metamask.io/' ,
identities : {
'0x64a845a5b02460acf8a3d84503b0d68d028b4bb4' : {
name : 'This is a Really Long Account Name' ,
address : '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4' ,
} ,
'0xb19ac54efa18cc3a14a5b821bfec73d284bf0c5e' : {
name : 'Account 2' ,
address : '0xb19ac54efa18cc3a14a5b821bfec73d284bf0c5e' ,
2021-02-08 17:49:49 +01:00
} ,
2021-09-20 21:05:58 +02:00
'0x9d0ba4ddac06032527b140912ec808ab9451b788' : {
name : 'Account 3' ,
address : '0x9d0ba4ddac06032527b140912ec808ab9451b788' ,
2021-02-08 17:49:49 +01:00
} ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-20 21:05:58 +02:00
unapprovedTxs : {
3111025347726181 : {
id : 3111025347726181 ,
time : 1620710815484 ,
status : 'unapproved' ,
metamaskNetworkId : '3' ,
msgParams : '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4' ,
chainId : '0x3' ,
loadingDefaults : false ,
txParams : {
from : '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4' ,
to : '0xaD6D458402F60fD3Bd25163575031ACDce07538D' ,
value : '0x0' ,
data :
'0xa9059cbb000000000000000000000000b19ac54efa18cc3a14a5b821bfec73d284bf0c5e0000000000000000000000000000000000000000000000003782dace9d900000' ,
gas : '0xcb28' ,
gasPrice : '0x77359400' ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
type : 'standard' ,
origin : 'metamask' ,
transactionCategory : 'transfer' ,
history : [
2021-05-25 02:20:09 +02:00
{
2021-09-20 21:05:58 +02:00
id : 7786962153682822 ,
time : 1620710815484 ,
status : 'unapproved' ,
metamaskNetworkId : '3' ,
chainId : '0x3' ,
loadingDefaults : true ,
txParams : {
from : '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4' ,
to : '0xaD6D458402F60fD3Bd25163575031ACDce07538D' ,
value : '0x0' ,
data :
'0xa9059cbb000000000000000000000000b19ac54efa18cc3a14a5b821bfec73d284bf0c5e0000000000000000000000000000000000000000000000003782dace9d900000' ,
gas : '0xcb28' ,
gasPrice : '0x77359400' ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
type : 'standard' ,
origin : 'metamask' ,
transactionCategory : 'transfer' ,
2021-05-25 02:20:09 +02:00
} ,
[
{
2021-09-13 23:04:31 +02:00
op : 'replace' ,
path : '/loadingDefaults' ,
value : false ,
note : 'Added new unapproved transaction.' ,
timestamp : 1620710815497 ,
} ,
] ,
] ,
} ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
frequentRpcList : [ ] ,
addressBook : {
undefined : {
0 : {
address : '0x39a4e4Af7cCB654dB9500F258c64781c8FbD39F0' ,
name : '' ,
isEns : false ,
} ,
} ,
2021-05-25 02:20:09 +02:00
} ,
2021-10-05 16:13:07 +02:00
addresses : [
{
address : '0x39a4e4Af7cCB654dB9500F258c64781c8FbD39F0' ,
name : 'DAI' ,
isEns : false ,
} ,
{
address : '1x39a4e4Af7cCB654dB9500F258c64781c8FbD39F0' ,
name : 'ETH' ,
isEns : true ,
} ,
] ,
2021-09-13 23:04:31 +02:00
contractExchangeRates : {
2021-09-20 21:05:58 +02:00
'0xaD6D458402F60fD3Bd25163575031ACDce07538D' : 0 ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
tokens : [
2021-02-08 17:49:49 +01:00
{
2021-10-15 14:00:36 +02:00
address : '0xaD6D458402F60fD3Bd25163575031ACDce07538A' ,
symbol : 'DAA' ,
decimals : 18 ,
} ,
{
address : '0xaD6D458402F60fD3Bd25163575031ACDce07538U' ,
symbol : 'DAU' ,
2021-09-20 21:05:58 +02:00
decimals : 18 ,
} ,
2021-05-25 02:20:09 +02:00
] ,
2022-05-09 19:47:06 +02:00
detectedTokens : [
{
2022-07-22 00:43:31 +02:00
address : '0x514910771AF9Ca656af840dff83E8264EcF986CA' ,
2022-05-09 19:47:06 +02:00
decimals : 18 ,
2022-07-22 00:43:31 +02:00
symbol : 'LINK' ,
image : 'https://crypto.com/price/coin-data/icon/LINK/color_icon.png' ,
aggregators : [ 'coinGecko' , 'oneInch' , 'paraswap' , 'zapper' , 'zerion' ] ,
2022-05-09 19:47:06 +02:00
} ,
{
2022-07-22 00:43:31 +02:00
address : '0xc00e94Cb662C3520282E6f5717214004A7f26888' ,
2022-05-09 19:47:06 +02:00
decimals : 18 ,
2022-07-22 00:43:31 +02:00
symbol : 'COMP' ,
image : 'https://crypto.com/price/coin-data/icon/COMP/color_icon.png' ,
aggregators : [
'bancor' ,
'cmc' ,
'cryptocom' ,
'coinGecko' ,
'oneInch' ,
'paraswap' ,
'pmm' ,
'zapper' ,
'zerion' ,
'zeroEx' ,
] ,
2022-05-09 19:47:06 +02:00
} ,
{
2022-07-22 00:43:31 +02:00
address : '0xfffffffFf15AbF397dA76f1dcc1A1604F45126DB' ,
2022-05-09 19:47:06 +02:00
decimals : 18 ,
2022-07-22 00:43:31 +02:00
symbol : 'FSW' ,
image :
'https://assets.coingecko.com/coins/images/12256/thumb/falconswap.png?1598534184' ,
aggregators : [
'aave' ,
'cmc' ,
'coinGecko' ,
'oneInch' ,
'paraswap' ,
'zapper' ,
'zerion' ,
] ,
} ,
2022-05-09 19:47:06 +02:00
] ,
2021-09-20 21:05:58 +02:00
pendingTokens : { } ,
customNonceValue : '' ,
send : {
gasLimit : '0xcb28' ,
gasPrice : null ,
gasTotal : null ,
tokenBalance : '8.7a73149c048545a3fe58' ,
from : '' ,
to : '0xb19ac54efa18cc3a14a5b821bfec73d284bf0c5e' ,
amount : '3782dace9d900000' ,
memo : '' ,
errors : { } ,
maxModeOn : false ,
editingTransactionId : null ,
toNickname : 'Account 2' ,
ensResolution : null ,
ensResolutionError : '' ,
token : {
address : '0xaD6D458402F60fD3Bd25163575031ACDce07538D' ,
symbol : 'DAI' ,
decimals : 18 ,
} ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
useBlockie : false ,
featureFlags : { } ,
welcomeScreenSeen : false ,
currentLocale : 'en' ,
preferences : {
useNativeCurrencyAsPrimaryCurrency : true ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
firstTimeFlowType : 'create' ,
completedOnboarding : true ,
knownMethodData : {
'0x60806040' : {
name : 'Approve Tokens' ,
} ,
'0x095ea7b3' : {
name : 'Approve Tokens' ,
2021-05-25 02:20:09 +02:00
} ,
} ,
2021-09-20 21:05:58 +02:00
participateInMetaMetrics : true ,
nextNonce : 71 ,
connectedStatusPopoverHasBeenShown : true ,
swapsWelcomeMessageHasBeenShown : true ,
defaultHomeActiveTabName : 'Assets' ,
provider : {
2022-07-22 08:44:35 +02:00
type : 'rinkeby' ,
2021-09-20 21:05:58 +02:00
ticker : 'ETH' ,
nickname : '' ,
rpcUrl : '' ,
2022-07-22 08:44:35 +02:00
chainId : '0x4' ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
previousProviderStore : {
2022-07-22 08:44:35 +02:00
type : 'rinkeby' ,
2021-09-13 23:04:31 +02:00
ticker : 'ETH' ,
nickname : '' ,
rpcUrl : '' ,
2022-07-22 08:44:35 +02:00
chainId : '0x4' ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-20 21:05:58 +02:00
network : '3' ,
accounts : {
'0x64a845a5b02460acf8a3d84503b0d68d028b4bb4' : {
address : '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4' ,
balance : '0x176e5b6f173ebe66' ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-20 21:05:58 +02:00
'0xb19ac54efa18cc3a14a5b821bfec73d284bf0c5e' : {
address : '0xb19ac54efa18cc3a14a5b821bfec73d284bf0c5e' ,
balance : '0x2d3142f5000' ,
} ,
'0x9d0ba4ddac06032527b140912ec808ab9451b788' : {
address : '0x9d0ba4ddac06032527b140912ec808ab9451b788' ,
balance : '0x15f6f0b9d4f8d000' ,
2021-05-25 02:20:09 +02:00
} ,
} ,
2021-09-20 21:05:58 +02:00
currentBlockGasLimit : '0x793af4' ,
currentNetworkTxList : [
2021-09-08 01:51:41 +02:00
{
2021-09-20 21:05:58 +02:00
chainId : '0x38' ,
dappSuggestedGasFees : null ,
firstRetryBlockNumber : '0x9c2686' ,
hash :
'0xf45e7a751adfc0fbadccc972816baf33eb34543e52ace51f0f8d0d7f357afdc6' ,
history : [
2021-09-08 01:51:41 +02:00
{
2021-09-20 21:05:58 +02:00
chainId : '0x38' ,
dappSuggestedGasFees : null ,
id : 2360388496987298 ,
loadingDefaults : true ,
metamaskNetworkId : '56' ,
origin : 'metamask' ,
status : 'unapproved' ,
time : 1629582710520 ,
txParams : {
data :
'0xa9059cbb0000000000000000000000004ef2d5a1d056e7c9e8bcdbf2bd9ac0df749a1c2900000000000000000000000000000000000000000000000029a2241af62c0000' ,
from : '0x17f62b1b2407c41c43e14da0699d6b4b0a521548' ,
gas : '0x2eb27' ,
gasPrice : '0x12a05f200' ,
to : '0x2e8c05582176fa93b4590382e8290c73deb82176' ,
type : '0x0' ,
value : '0x0' ,
2021-09-08 01:51:41 +02:00
} ,
2021-09-20 21:05:58 +02:00
type : 'transfer' ,
2021-09-08 01:51:41 +02:00
} ,
[
{
2021-09-20 21:05:58 +02:00
note : 'Added new unapproved transaction.' ,
op : 'replace' ,
path : '/loadingDefaults' ,
timestamp : 1629582710530 ,
value : false ,
} ,
2021-09-08 01:51:41 +02:00
] ,
[
{
2021-09-20 21:05:58 +02:00
note : 'txStateManager: setting status to approved' ,
op : 'replace' ,
path : '/status' ,
timestamp : 1629582711218 ,
value : 'approved' ,
} ,
2021-09-08 01:51:41 +02:00
] ,
[
{
2021-09-20 21:05:58 +02:00
note : 'transactions#approveTransaction' ,
op : 'add' ,
path : '/txParams/nonce' ,
timestamp : 1629582711220 ,
value : '0x15b' ,
2021-09-08 01:51:41 +02:00
} ,
{
2021-09-20 21:05:58 +02:00
op : 'add' ,
path : '/nonceDetails' ,
value : {
local : {
details : {
highest : 347 ,
startPoint : 347 ,
2021-09-08 01:51:41 +02:00
} ,
2021-09-20 21:05:58 +02:00
name : 'local' ,
nonce : 347 ,
2021-09-08 01:51:41 +02:00
} ,
2021-09-20 21:05:58 +02:00
network : {
details : {
baseCount : 347 ,
blockNumber : '0x9c2682' ,
2021-09-08 01:51:41 +02:00
} ,
2021-09-20 21:05:58 +02:00
name : 'network' ,
nonce : 347 ,
} ,
params : {
highestLocallyConfirmed : 327 ,
highestSuggested : 347 ,
nextNetworkNonce : 347 ,
2021-09-08 01:51:41 +02:00
} ,
2021-09-20 21:05:58 +02:00
} ,
} ,
2021-09-08 01:51:41 +02:00
] ,
[
{
2021-09-20 21:05:58 +02:00
note : 'transactions#signTransaction: add r, s, v values' ,
op : 'add' ,
path : '/r' ,
timestamp : 1629582711236 ,
value :
'0x90a4dfb0646eef9815454d0ab543b5844acb8772101084565155c93ecce8ed69' ,
2021-09-08 01:51:41 +02:00
} ,
{
2021-09-20 21:05:58 +02:00
op : 'add' ,
path : '/s' ,
value :
'0x7fd317c727025490f282c7990b8518a7dab7521b1ada1cb639f887966bc078df' ,
2021-09-08 01:51:41 +02:00
} ,
{
2021-09-20 21:05:58 +02:00
op : 'add' ,
path : '/v' ,
value : '0x93' ,
} ,
2021-09-08 01:51:41 +02:00
] ,
[
{
2021-09-20 21:05:58 +02:00
note : 'txStateManager: setting status to signed' ,
op : 'replace' ,
path : '/status' ,
timestamp : 1629582711236 ,
value : 'signed' ,
} ,
2021-09-08 01:51:41 +02:00
] ,
[
{
2021-09-20 21:05:58 +02:00
note : 'transactions#publishTransaction' ,
op : 'add' ,
path : '/rawTx' ,
timestamp : 1629582711237 ,
value :
'0xf8ad82015b85012a05f2008302eb27942e8c05582176fa93b4590382e8290c73deb8217680b844a9059cbb0000000000000000000000004ef2d5a1d056e7c9e8bcdbf2bd9ac0df749a1c2900000000000000000000000000000000000000000000000029a2241af62c00008193a090a4dfb0646eef9815454d0ab543b5844acb8772101084565155c93ecce8ed69a07fd317c727025490f282c7990b8518a7dab7521b1ada1cb639f887966bc078df' ,
} ,
2021-09-08 01:51:41 +02:00
] ,
[
{
2021-09-20 21:05:58 +02:00
note : 'transactions#setTxHash' ,
op : 'add' ,
path : '/hash' ,
timestamp : 1629582711336 ,
value :
'0xf45e7a751adfc0fbadccc972816baf33eb34543e52ace51f0f8d0d7f357afdc6' ,
} ,
2021-09-08 01:51:41 +02:00
] ,
[
{
2021-09-20 21:05:58 +02:00
note : 'txStateManager - add submitted time stamp' ,
op : 'add' ,
path : '/submittedTime' ,
timestamp : 1629582711337 ,
value : 1629582711337 ,
} ,
2021-09-08 01:51:41 +02:00
] ,
[
{
2021-09-20 21:05:58 +02:00
note : 'txStateManager: setting status to submitted' ,
op : 'replace' ,
path : '/status' ,
timestamp : 1629582711338 ,
value : 'submitted' ,
} ,
2021-09-08 01:51:41 +02:00
] ,
[
{
2021-09-20 21:05:58 +02:00
note : 'transactions/pending-tx-tracker#event: tx:block-update' ,
op : 'add' ,
path : '/firstRetryBlockNumber' ,
timestamp : 1629582711878 ,
value : '0x9c2686' ,
2021-09-08 01:51:41 +02:00
} ,
2021-09-20 21:05:58 +02:00
] ,
2021-10-15 14:00:36 +02:00
[
{
note : 'transactions/pending-tx-tracker#event: tx:block-update' ,
op : 'add' ,
path : '/firstRetryBlockNumber' ,
timestamp : 1629582711878 ,
value : '0x9c2686' ,
} ,
] ,
2021-09-29 20:43:18 +02:00
[
{
note : 'txStateManager: setting status to confirmed' ,
op : 'replace' ,
path : '/status' ,
timestamp : 1629582721178 ,
value : 'confirmed' ,
} ,
] ,
2021-09-20 21:05:58 +02:00
[
2021-09-08 01:51:41 +02:00
{
2021-09-20 21:05:58 +02:00
note : 'txStateManager: setting status to confirmed' ,
op : 'replace' ,
path : '/status' ,
timestamp : 1629582721178 ,
value : 'confirmed' ,
} ,
{
op : 'add' ,
path : '/txReceipt' ,
value : {
blockHash :
'0x30bf5dfa12e460a5d121267c00ba3047a14ba286e0c4fe75fa979010f527cba0' ,
blockNumber : '9c2688' ,
contractAddress : null ,
cumulativeGasUsed : '19a4942' ,
from : '0x17f62b1b2407c41c43e14da0699d6b4b0a521548' ,
gasUsed : '1f21a' ,
logs : [
2021-09-08 01:51:41 +02:00
{
2021-09-20 21:05:58 +02:00
address : '0x2e8c05582176fa93b4590382e8290c73deb82176' ,
blockHash :
'0x30bf5dfa12e460a5d121267c00ba3047a14ba286e0c4fe75fa979010f527cba0' ,
blockNumber : '9c2688' ,
data :
'0x00000000000000000000000000000000000000000000000028426c213d688000' ,
logIndex : '245' ,
removed : false ,
topics : [
'0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' ,
'0x00000000000000000000000017f62b1b2407c41c43e14da0699d6b4b0a521548' ,
'0x0000000000000000000000004ef2d5a1d056e7c9e8bcdbf2bd9ac0df749a1c29' ,
2021-09-08 01:51:41 +02:00
] ,
2021-09-20 21:05:58 +02:00
transactionHash :
'0xf45e7a751adfc0fbadccc972816baf33eb34543e52ace51f0f8d0d7f357afdc6' ,
transactionIndex : 'ae' ,
2021-09-08 01:51:41 +02:00
} ,
{
2021-09-20 21:05:58 +02:00
address : '0x2e8c05582176fa93b4590382e8290c73deb82176' ,
blockHash :
'0x30bf5dfa12e460a5d121267c00ba3047a14ba286e0c4fe75fa979010f527cba0' ,
blockNumber : '9c2688' ,
data :
'0x000000000000000000000000000000000000000000000000006a94d74f430000' ,
logIndex : '246' ,
removed : false ,
topics : [
'0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' ,
'0x00000000000000000000000017f62b1b2407c41c43e14da0699d6b4b0a521548' ,
'0x000000000000000000000000c825413863f677a2012bb8db3a5e4a18bbf29e56' ,
2021-09-08 01:51:41 +02:00
] ,
2021-09-20 21:05:58 +02:00
transactionHash :
'0xf45e7a751adfc0fbadccc972816baf33eb34543e52ace51f0f8d0d7f357afdc6' ,
transactionIndex : 'ae' ,
2021-09-08 01:51:41 +02:00
} ,
{
2021-09-20 21:05:58 +02:00
address : '0x2e8c05582176fa93b4590382e8290c73deb82176' ,
blockHash :
'0x30bf5dfa12e460a5d121267c00ba3047a14ba286e0c4fe75fa979010f527cba0' ,
blockNumber : '9c2688' ,
data :
'0x000000000000000000000000000000000000000000000000001ff973cafa8000' ,
logIndex : '247' ,
removed : false ,
topics : [
'0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' ,
'0x00000000000000000000000017f62b1b2407c41c43e14da0699d6b4b0a521548' ,
'0x0000000000000000000000004ef2d5a1d056e7c9e8bcdbf2bd9ac0df749a1c29' ,
2021-09-08 01:51:41 +02:00
] ,
2021-09-20 21:05:58 +02:00
transactionHash :
'0xf45e7a751adfc0fbadccc972816baf33eb34543e52ace51f0f8d0d7f357afdc6' ,
transactionIndex : 'ae' ,
} ,
2021-09-08 01:51:41 +02:00
] ,
2021-09-20 21:05:58 +02:00
logsBloom :
'0x20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000100000000000020000000000000000000000000000000008000000000080000000000000000000000000000000000000000040000000000000000000000040000000000200000010000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000200000000000000000000800000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000' ,
status : '0x1' ,
to : '0x2e8c05582176fa93b4590382e8290c73deb82176' ,
transactionHash :
'0xf45e7a751adfc0fbadccc972816baf33eb34543e52ace51f0f8d0d7f357afdc6' ,
transactionIndex : 'ae' ,
type : '0x0' ,
} ,
} ,
2021-09-08 01:51:41 +02:00
] ,
[
{
2021-09-20 21:05:58 +02:00
note : 'transactions#confirmTransaction - add txReceipt' ,
op : 'replace' ,
path : '/txReceipt/transactionIndex' ,
timestamp : 1629582721183 ,
value : 'ae' ,
2021-09-08 01:51:41 +02:00
} ,
{
2021-09-20 21:05:58 +02:00
op : 'replace' ,
path : '/txReceipt/logs/2/logIndex' ,
value : '247' ,
2021-09-08 01:51:41 +02:00
} ,
{
2021-09-20 21:05:58 +02:00
op : 'replace' ,
path : '/txReceipt/logs/2/transactionIndex' ,
value : 'ae' ,
2021-09-08 01:51:41 +02:00
} ,
{
2021-09-20 21:05:58 +02:00
op : 'replace' ,
path : '/txReceipt/logs/2/blockNumber' ,
value : '9c2688' ,
2021-09-08 01:51:41 +02:00
} ,
{
2021-09-20 21:05:58 +02:00
op : 'replace' ,
path : '/txReceipt/logs/1/logIndex' ,
value : '246' ,
2021-09-08 01:51:41 +02:00
} ,
{
2021-09-20 21:05:58 +02:00
op : 'replace' ,
path : '/txReceipt/logs/1/transactionIndex' ,
value : 'ae' ,
2021-09-08 01:51:41 +02:00
} ,
{
2021-09-20 21:05:58 +02:00
op : 'replace' ,
path : '/txReceipt/logs/1/blockNumber' ,
value : '9c2688' ,
2021-09-08 01:51:41 +02:00
} ,
{
2021-09-20 21:05:58 +02:00
op : 'replace' ,
path : '/txReceipt/logs/0/logIndex' ,
value : '245' ,
2021-09-08 01:51:41 +02:00
} ,
{
2021-09-20 21:05:58 +02:00
op : 'replace' ,
path : '/txReceipt/logs/0/transactionIndex' ,
value : 'ae' ,
2021-09-08 01:51:41 +02:00
} ,
{
2021-09-20 21:05:58 +02:00
op : 'replace' ,
path : '/txReceipt/logs/0/blockNumber' ,
value : '9c2688' ,
2021-09-08 01:51:41 +02:00
} ,
{
2021-09-20 21:05:58 +02:00
op : 'replace' ,
path : '/txReceipt/cumulativeGasUsed' ,
value : '19a4942' ,
2021-09-08 01:51:41 +02:00
} ,
{
2021-09-20 21:05:58 +02:00
op : 'replace' ,
path : '/txReceipt/blockNumber' ,
value : '9c2688' ,
} ,
] ,
2021-09-08 01:51:41 +02:00
] ,
2021-09-20 21:05:58 +02:00
id : 7900715443136469 ,
loadingDefaults : false ,
metamaskNetworkId : '56' ,
nonceDetails : {
local : {
details : {
highest : 347 ,
startPoint : 347 ,
2021-09-08 01:51:41 +02:00
} ,
2021-09-20 21:05:58 +02:00
name : 'local' ,
nonce : 347 ,
2021-09-08 01:51:41 +02:00
} ,
2021-09-20 21:05:58 +02:00
network : {
details : {
baseCount : 347 ,
blockNumber : '0x9c2682' ,
2021-09-08 01:51:41 +02:00
} ,
2021-09-20 21:05:58 +02:00
name : 'network' ,
nonce : 347 ,
} ,
params : {
highestLocallyConfirmed : 327 ,
highestSuggested : 347 ,
nextNetworkNonce : 347 ,
2021-09-08 01:51:41 +02:00
} ,
} ,
2021-09-20 21:05:58 +02:00
origin : 'metamask' ,
r : '0x90a4dfb0646eef9815454d0ab543b5844acb8772101084565155c93ecce8ed69' ,
rawTx :
'0xf8ad82015b85012a05f2008302eb27942e8c05582176fa93b4590382e8290c73deb8217680b844a9059cbb0000000000000000000000004ef2d5a1d056e7c9e8bcdbf2bd9ac0df749a1c2900000000000000000000000000000000000000000000000029a2241af62c00008193a090a4dfb0646eef9815454d0ab543b5844acb8772101084565155c93ecce8ed69a07fd317c727025490f282c7990b8518a7dab7521b1ada1cb639f887966bc078df' ,
s : '0x7fd317c727025490f282c7990b8518a7dab7521b1ada1cb639f887966bc078df' ,
status : 'confirmed' ,
submittedTime : 1629582711337 ,
time : 1629582710520 ,
txParams : {
data :
'0xa9059cbb0000000000000000000000004ef2d5a1d056e7c9e8bcdbf2bd9ac0df749a1c2900000000000000000000000000000000000000000000000029a2241af62c0000' ,
from : '0x17f62b1b2407c41c43e14da0699d6b4b0a521548' ,
gas : '0x2eb27' ,
gasPrice : '0x12a05f200' ,
nonce : '0x15b' ,
to : '0x2e8c05582176fa93b4590382e8290c73deb82176' ,
type : '0x0' ,
value : '0x0' ,
2021-09-08 01:51:41 +02:00
} ,
2021-09-20 21:05:58 +02:00
txReceipt : {
blockHash :
'0x30bf5dfa12e460a5d121267c00ba3047a14ba286e0c4fe75fa979010f527cba0' ,
blockNumber : {
length : 1 ,
negative : 0 ,
red : null ,
words : [ 10233480 , null ] ,
2021-09-08 01:51:41 +02:00
} ,
2021-09-20 21:05:58 +02:00
contractAddress : null ,
cumulativeGasUsed : {
length : 1 ,
negative : 0 ,
red : null ,
words : [ 26888514 , null ] ,
2021-09-08 01:51:41 +02:00
} ,
2021-09-20 21:05:58 +02:00
from : '0x17f62b1b2407c41c43e14da0699d6b4b0a521548' ,
gasUsed : '1f21a' ,
logs : [
2021-09-08 01:51:41 +02:00
{
2021-09-20 21:05:58 +02:00
address : '0x2e8c05582176fa93b4590382e8290c73deb82176' ,
blockHash :
'0x30bf5dfa12e460a5d121267c00ba3047a14ba286e0c4fe75fa979010f527cba0' ,
blockNumber : {
length : 1 ,
negative : 0 ,
red : null ,
words : [ 10233480 , null ] ,
2021-09-08 01:51:41 +02:00
} ,
2021-09-20 21:05:58 +02:00
data :
'0x00000000000000000000000000000000000000000000000028426c213d688000' ,
logIndex : {
length : 1 ,
negative : 0 ,
red : null ,
words : [ 581 , null ] ,
2021-09-08 01:51:41 +02:00
} ,
2021-09-20 21:05:58 +02:00
removed : false ,
topics : [
'0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' ,
'0x00000000000000000000000017f62b1b2407c41c43e14da0699d6b4b0a521548' ,
'0x0000000000000000000000004ef2d5a1d056e7c9e8bcdbf2bd9ac0df749a1c29' ,
2021-09-08 01:51:41 +02:00
] ,
2021-09-20 21:05:58 +02:00
transactionHash :
'0xf45e7a751adfc0fbadccc972816baf33eb34543e52ace51f0f8d0d7f357afdc6' ,
transactionIndex : {
length : 1 ,
negative : 0 ,
red : null ,
words : [ 174 , null ] ,
} ,
2021-09-08 01:51:41 +02:00
} ,
{
2021-09-20 21:05:58 +02:00
address : '0x2e8c05582176fa93b4590382e8290c73deb82176' ,
blockHash :
'0x30bf5dfa12e460a5d121267c00ba3047a14ba286e0c4fe75fa979010f527cba0' ,
blockNumber : {
length : 1 ,
negative : 0 ,
red : null ,
words : [ 10233480 , null ] ,
2021-09-08 01:51:41 +02:00
} ,
2021-09-20 21:05:58 +02:00
data :
'0x000000000000000000000000000000000000000000000000006a94d74f430000' ,
logIndex : {
length : 1 ,
negative : 0 ,
red : null ,
words : [ 582 , null ] ,
2021-09-08 01:51:41 +02:00
} ,
2021-09-20 21:05:58 +02:00
removed : false ,
topics : [
'0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' ,
'0x00000000000000000000000017f62b1b2407c41c43e14da0699d6b4b0a521548' ,
'0x000000000000000000000000c825413863f677a2012bb8db3a5e4a18bbf29e56' ,
2021-09-08 01:51:41 +02:00
] ,
2021-09-20 21:05:58 +02:00
transactionHash :
'0xf45e7a751adfc0fbadccc972816baf33eb34543e52ace51f0f8d0d7f357afdc6' ,
transactionIndex : {
length : 1 ,
negative : 0 ,
red : null ,
words : [ 174 , null ] ,
} ,
2021-09-08 01:51:41 +02:00
} ,
{
2021-09-20 21:05:58 +02:00
address : '0x2e8c05582176fa93b4590382e8290c73deb82176' ,
blockHash :
'0x30bf5dfa12e460a5d121267c00ba3047a14ba286e0c4fe75fa979010f527cba0' ,
blockNumber : {
length : 1 ,
negative : 0 ,
red : null ,
words : [ 10233480 , null ] ,
2021-09-08 01:51:41 +02:00
} ,
2021-09-20 21:05:58 +02:00
data :
'0x000000000000000000000000000000000000000000000000001ff973cafa8000' ,
logIndex : {
length : 1 ,
negative : 0 ,
red : null ,
words : [ 583 , null ] ,
2021-09-08 01:51:41 +02:00
} ,
2021-09-20 21:05:58 +02:00
removed : false ,
topics : [
'0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' ,
'0x00000000000000000000000017f62b1b2407c41c43e14da0699d6b4b0a521548' ,
'0x0000000000000000000000004ef2d5a1d056e7c9e8bcdbf2bd9ac0df749a1c29' ,
2021-09-08 01:51:41 +02:00
] ,
2021-09-20 21:05:58 +02:00
transactionHash :
'0xf45e7a751adfc0fbadccc972816baf33eb34543e52ace51f0f8d0d7f357afdc6' ,
transactionIndex : {
length : 1 ,
negative : 0 ,
red : null ,
words : [ 174 , null ] ,
} ,
} ,
2021-09-08 01:51:41 +02:00
] ,
2021-09-20 21:05:58 +02:00
logsBloom :
'0x20000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000100000000000020000000000000000000000000000000008000000000080000000000000000000000000000000000000000040000000000000000000000040000000000200000010000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000200000000000000000000800000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000' ,
status : '0x1' ,
to : '0x2e8c05582176fa93b4590382e8290c73deb82176' ,
transactionHash :
'0xf45e7a751adfc0fbadccc972816baf33eb34543e52ace51f0f8d0d7f357afdc6' ,
transactionIndex : {
length : 1 ,
negative : 0 ,
red : null ,
words : [ 174 , null ] ,
2021-09-08 01:51:41 +02:00
} ,
2021-09-20 21:05:58 +02:00
type : '0x0' ,
2021-09-08 01:51:41 +02:00
} ,
2021-09-20 21:05:58 +02:00
type : 'transfer' ,
v : '0x93' ,
2021-09-13 23:01:29 +02:00
} ,
2021-05-25 02:20:09 +02:00
] ,
2021-09-20 21:05:58 +02:00
cachedBalances : {
1 : {
'0x64a845a5b02460acf8a3d84503b0d68d028b4bb4' : '0x0' ,
'0xb19ac54efa18cc3a14a5b821bfec73d284bf0c5e' : '0xcaf5317161f400' ,
'0x9d0ba4ddac06032527b140912ec808ab9451b788' : '0x0' ,
} ,
3 : {
'0x64a845a5b02460acf8a3d84503b0d68d028b4bb4' : '0x18d289d450bace66' ,
'0xb19ac54efa18cc3a14a5b821bfec73d284bf0c5e' : '0x2d3142f5000' ,
'0x9d0ba4ddac06032527b140912ec808ab9451b788' : '0x15f6f0b9d4f8d000' ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-20 21:05:58 +02:00
'0x3' : {
'0x64a845a5b02460acf8a3d84503b0d68d028b4bb4' : '0x176e5b6f173ebe66' ,
'0xb19ac54efa18cc3a14a5b821bfec73d284bf0c5e' : '0x2d3142f5000' ,
'0x9d0ba4ddac06032527b140912ec808ab9451b788' : '0x15f6f0b9d4f8d000' ,
2021-02-08 17:49:49 +01:00
} ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-20 21:05:58 +02:00
unapprovedMsgs : { } ,
unapprovedMsgCount : 0 ,
unapprovedPersonalMsgs : { } ,
unapprovedPersonalMsgCount : 0 ,
unapprovedDecryptMsgs : { } ,
unapprovedDecryptMsgCount : 0 ,
unapprovedEncryptionPublicKeyMsgs : {
7786962153682822 : {
id : 7786962153682822 ,
msgParams : '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4' ,
time : 1622687544054 ,
status : 'unapproved' ,
type : 'eth_getEncryptionPublicKey' ,
origin : 'https://metamask.github.io' ,
} ,
2021-07-20 18:29:38 +02:00
} ,
2021-09-20 21:05:58 +02:00
unapprovedEncryptionPublicKeyMsgCount : 0 ,
unapprovedTypedMessages : { } ,
unapprovedTypedMessagesCount : 0 ,
keyringTypes : [
'Simple Key Pair' ,
'HD Key Tree' ,
'Trezor Hardware' ,
'Ledger Hardware' ,
2021-02-08 17:49:49 +01:00
] ,
2021-09-13 23:04:31 +02:00
keyrings : [
2021-02-08 17:49:49 +01:00
{
2021-09-13 23:04:31 +02:00
type : 'HD Key Tree' ,
accounts : [
'0x64a845a5b02460acf8a3d84503b0d68d028b4bb4' ,
'0xb19ac54efa18cc3a14a5b821bfec73d284bf0c5e' ,
'0x9d0ba4ddac06032527b140912ec808ab9451b788' ,
] ,
} ,
2021-05-25 02:20:09 +02:00
] ,
2021-09-13 23:04:31 +02:00
frequentRpcListDetail : [
2021-05-25 02:20:09 +02:00
{
2021-09-13 23:04:31 +02:00
rpcUrl : 'http://localhost:8545' ,
chainId : '0x539' ,
ticker : 'ETH' ,
nickname : 'Localhost 8545' ,
rpcPrefs : { } ,
} ,
2021-05-25 02:20:09 +02:00
] ,
2021-09-13 23:04:31 +02:00
accountTokens : {
'0x64a845a5b02460acf8a3d84503b0d68d028b4bb4' : {
'0x1' : [
2021-05-25 02:20:09 +02:00
{
2021-09-13 23:04:31 +02:00
address : '0x6b175474e89094c44da98b954eedeac495271d0f' ,
symbol : 'DAI' ,
decimals : 18 ,
2021-05-25 02:20:09 +02:00
} ,
{
2021-09-13 23:04:31 +02:00
address : '0x0d8775f648430679a709e98d2b0cb6250d2887ef' ,
symbol : 'BAT' ,
decimals : 18 ,
} ,
2021-05-25 02:20:09 +02:00
] ,
2021-09-13 23:04:31 +02:00
'0x3' : [
2021-05-25 02:20:09 +02:00
{
2021-09-20 21:05:58 +02:00
address : '0xaD6D458402F60fD3Bd25163575031ACDce07538D' ,
symbol : 'DAI' ,
decimals : 18 ,
} ,
] ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-20 21:05:58 +02:00
'0xb19ac54efa18cc3a14a5b821bfec73d284bf0c5e' : { } ,
'0x9d0ba4ddac06032527b140912ec808ab9451b788' : { } ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
accountHiddenTokens : {
'0x64a845a5b02460acf8a3d84503b0d68d028b4bb4' : {
'0x3' : [ ] ,
} ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-20 21:05:58 +02:00
assetImages : {
'0xaD6D458402F60fD3Bd25163575031ACDce07538D' : './sai.svg' ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
hiddenTokens : [ ] ,
2022-02-01 16:30:15 +01:00
suggestedAssets : [ ] ,
2021-09-13 23:04:31 +02:00
useNonceField : false ,
usePhishDetect : true ,
2022-04-01 17:52:22 +02:00
useTokenDetection : true ,
2021-09-13 23:04:31 +02:00
lostIdentities : { } ,
forgottenPassword : false ,
ipfsGateway : 'dweb.link' ,
infuraBlocked : false ,
migratedPrivacyMode : false ,
selectedAddress : '0x9d0ba4ddac06032527b140912ec808ab9451b788' ,
metaMetricsId :
'0xc2377d11fec1c3b7dd88c4854240ee5e3ed0d9f63b00456d98d80320337b827f' ,
conversionDate : 1620710825.03 ,
conversionRate : 3910.28 ,
currentCurrency : 'usd' ,
nativeCurrency : 'ETH' ,
usdConversionRate : 3910.28 ,
ticker : 'ETH' ,
alertEnabledness : {
unconnectedAccount : true ,
web3ShimUsage : true ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
unconnectedAccountAlertShownOrigins : { } ,
web3ShimUsageOrigins : { } ,
seedPhraseBackedUp : null ,
onboardingTabs : { } ,
incomingTransactions : {
'0x2de9256a7c604586f7ecfd87ae9509851e217f588f9f85feed793c54ed2ce0aa' : {
blockNumber : '8888976' ,
id : 4678200543090532 ,
metamaskNetworkId : '1' ,
status : 'confirmed' ,
time : 1573114896000 ,
txParams : {
from : '0x3f1b52850109023775d238c7ed5d5e7161041fd1' ,
gas : '0x5208' ,
gasPrice : '0x124101100' ,
nonce : '0x35' ,
to : '0x045c619e4d29bba3b92769508831b681b83d6a96' ,
value : '0xbca9bce4d98ca3' ,
2021-02-08 17:49:49 +01:00
} ,
2021-09-13 23:04:31 +02:00
hash :
'0x2de9256a7c604586f7ecfd87ae9509851e217f588f9f85feed793c54ed2ce0aa' ,
transactionCategory : 'incoming' ,
2021-02-08 17:49:49 +01:00
} ,
2021-09-13 23:04:31 +02:00
'0x320a1fd769373578f78570e5d8f56e89bc7bce9657bb5f4c12d8fe790d471bfd' : {
blockNumber : '9453174' ,
id : 4678200543090535 ,
metamaskNetworkId : '1' ,
status : 'confirmed' ,
time : 1581312411000 ,
txParams : {
from : '0xa17bd07d6d38cb9e37b29f7659a4b1047701e969' ,
gas : '0xc350' ,
gasPrice : '0x1a13b8600' ,
nonce : '0x0' ,
to : '0x045c619e4d29bba3b92769508831b681b83d6a96' ,
value : '0xcdb08ab4254000' ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
hash :
'0x320a1fd769373578f78570e5d8f56e89bc7bce9657bb5f4c12d8fe790d471bfd' ,
transactionCategory : 'incoming' ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
'0x8add6c1ea089a8de9b15fa2056b1875360f17916755c88ace9e5092b7a4b1239' : {
blockNumber : '10892417' ,
id : 4678200543090542 ,
metamaskNetworkId : '1' ,
status : 'confirmed' ,
time : 1600515224000 ,
txParams : {
from : '0x0681d8db095565fe8a346fa0277bffde9c0edbbf' ,
gas : '0x5208' ,
gasPrice : '0x1d1a94a200' ,
nonce : '0x2bb8a5' ,
to : '0x045c619e4d29bba3b92769508831b681b83d6a96' ,
value : '0xe6ed27d6668000' ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
hash :
'0x8add6c1ea089a8de9b15fa2056b1875360f17916755c88ace9e5092b7a4b1239' ,
transactionCategory : 'incoming' ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
'0x50be62ab1cabd03ff104c602c11fdef7a50f3d73c55006d5583ba97950ab1144' : {
blockNumber : '10902987' ,
id : 4678200543090545 ,
metamaskNetworkId : '1' ,
status : 'confirmed' ,
time : 1600654021000 ,
txParams : {
from : '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4' ,
gas : '0x5208' ,
gasPrice : '0x147d357000' ,
nonce : '0xf' ,
to : '0x045c619e4d29bba3b92769508831b681b83d6a96' ,
value : '0x63eb89da4ed00000' ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
hash :
'0x50be62ab1cabd03ff104c602c11fdef7a50f3d73c55006d5583ba97950ab1144' ,
transactionCategory : 'incoming' ,
} ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
incomingTxLastFetchedBlocksByNetwork : {
ropsten : 8872820 ,
rinkeby : null ,
kovan : null ,
goerli : null ,
mainnet : 10902989 ,
2021-05-25 02:20:09 +02:00
} ,
Permission System 2.0 (#12243)
# Permission System 2.0
## Background
This PR migrates the extension permission system to [the new `PermissionController`](https://github.com/MetaMask/snaps-skunkworks/tree/main/packages/controllers/src/permissions).
The original permission system, based on [`rpc-cap`](https://github.com/MetaMask/rpc-cap), introduced [`ZCAP-LD`](https://w3c-ccg.github.io/zcap-ld/)-like permissions to our JSON-RPC stack.
We used it to [implement](https://github.com/MetaMask/metamask-extension/pull/7004) what we called "LoginPerSite" in [version 7.7.0](https://github.com/MetaMask/metamask-extension/releases/tag/v7.7.0) of the extension, which enabled the user to choose which accounts, if any, should be exposed to each dapp.
While that was a worthwhile feature in and of itself, we wanted a permission _system_ in order to enable everything we are going to with Snaps.
Unfortunately, the original permission system was difficult to use, and necessitated the creation of the original `PermissionsController` (note the "s"), which was more or less a wrapper for `rpc-cap`.
With this PR, we shake off the yoke of the original permission system, in favor of the modular, self-contained, ergonomic, and more mature permission system 2.0.
Note that [the `PermissionController` readme](https://github.com/MetaMask/snaps-skunkworks/tree/main/packages/controllers/src/permissions/README.md) explains how the new permission system works.
The `PermissionController` and `SubjectMetadataController` are currently shipped via `@metamask/snap-controllers`. This is a temporary state of affairs, and we'll move them to `@metamask/controllers` once they've landed in prod.
## Changes in Detail
First, the changes in this PR are not as big as they seem. Roughly half of the additions in this PR are fixtures in the test for the new migration (number 68), and a significant portion of the remaining ~2500 lines are due to find-and-replace changes in other test fixtures and UI files.
- The extension `PermissionsController` has been deleted, and completely replaced with the new `PermissionController` from [`@metamask/snap-controllers`](https://www.npmjs.com/package/@metamask/snap-controllers).
- The original `PermissionsController` "domain metadata" functionality is now managed by the new `SubjectMetadataController`, also from [`@metamask/snap-controllers`](https://www.npmjs.com/package/@metamask/snap-controllers).
- The permission activity and history log controller has been renamed `PermissionLogController` and has its own top-level state key, but is otherwise functionally equivalent to the existing implementation.
- Migration number 68 has been added to account for the new state changes.
- The tests in `app/scripts/controllers/permissions` have been migrated from `mocha` to `jest`.
Reviewers should focus their attention on the following files:
- `app/scripts/`
- `metamask-controller.js`
- This is where most of the integration work for the new `PermissionController` occurs.
Some functions that were internal to the original controller were moved here.
- `controllers/permissions/`
- `selectors.js`
- These selectors are for `ControllerMessenger` selector subscriptions. The actual subscriptions occur in `metamask-controller.js`. See the `ControllerMessenger` implementation for details.
- `specifications.js`
- The caveat and permission specifications are required by the new `PermissionController`, and are used to specify the `eth_accounts` permission and its JSON-RPC method implementation.
See the `PermissionController` readme for details.
- `migrations/068.js`
- The new state should be cross-referenced with the controllers that manage it.
The accompanying tests should also be thoroughly reviewed.
Some files may appear new but have just moved and/or been renamed:
- `app/scripts/lib/rpc-method-middleware/handlers/request-accounts.js`
- This was previously implemented in `controllers/permissions/permissionsMethodMiddleware.js`.
- `test/mocks/permissions.js`
- A truncated version of `test/mocks/permission-controller.js`.
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-12-07 04:16:49 +01:00
subjects : {
2021-09-13 23:04:31 +02:00
'https://app.uniswap.org' : {
Permission System 2.0 (#12243)
# Permission System 2.0
## Background
This PR migrates the extension permission system to [the new `PermissionController`](https://github.com/MetaMask/snaps-skunkworks/tree/main/packages/controllers/src/permissions).
The original permission system, based on [`rpc-cap`](https://github.com/MetaMask/rpc-cap), introduced [`ZCAP-LD`](https://w3c-ccg.github.io/zcap-ld/)-like permissions to our JSON-RPC stack.
We used it to [implement](https://github.com/MetaMask/metamask-extension/pull/7004) what we called "LoginPerSite" in [version 7.7.0](https://github.com/MetaMask/metamask-extension/releases/tag/v7.7.0) of the extension, which enabled the user to choose which accounts, if any, should be exposed to each dapp.
While that was a worthwhile feature in and of itself, we wanted a permission _system_ in order to enable everything we are going to with Snaps.
Unfortunately, the original permission system was difficult to use, and necessitated the creation of the original `PermissionsController` (note the "s"), which was more or less a wrapper for `rpc-cap`.
With this PR, we shake off the yoke of the original permission system, in favor of the modular, self-contained, ergonomic, and more mature permission system 2.0.
Note that [the `PermissionController` readme](https://github.com/MetaMask/snaps-skunkworks/tree/main/packages/controllers/src/permissions/README.md) explains how the new permission system works.
The `PermissionController` and `SubjectMetadataController` are currently shipped via `@metamask/snap-controllers`. This is a temporary state of affairs, and we'll move them to `@metamask/controllers` once they've landed in prod.
## Changes in Detail
First, the changes in this PR are not as big as they seem. Roughly half of the additions in this PR are fixtures in the test for the new migration (number 68), and a significant portion of the remaining ~2500 lines are due to find-and-replace changes in other test fixtures and UI files.
- The extension `PermissionsController` has been deleted, and completely replaced with the new `PermissionController` from [`@metamask/snap-controllers`](https://www.npmjs.com/package/@metamask/snap-controllers).
- The original `PermissionsController` "domain metadata" functionality is now managed by the new `SubjectMetadataController`, also from [`@metamask/snap-controllers`](https://www.npmjs.com/package/@metamask/snap-controllers).
- The permission activity and history log controller has been renamed `PermissionLogController` and has its own top-level state key, but is otherwise functionally equivalent to the existing implementation.
- Migration number 68 has been added to account for the new state changes.
- The tests in `app/scripts/controllers/permissions` have been migrated from `mocha` to `jest`.
Reviewers should focus their attention on the following files:
- `app/scripts/`
- `metamask-controller.js`
- This is where most of the integration work for the new `PermissionController` occurs.
Some functions that were internal to the original controller were moved here.
- `controllers/permissions/`
- `selectors.js`
- These selectors are for `ControllerMessenger` selector subscriptions. The actual subscriptions occur in `metamask-controller.js`. See the `ControllerMessenger` implementation for details.
- `specifications.js`
- The caveat and permission specifications are required by the new `PermissionController`, and are used to specify the `eth_accounts` permission and its JSON-RPC method implementation.
See the `PermissionController` readme for details.
- `migrations/068.js`
- The new state should be cross-referenced with the controllers that manage it.
The accompanying tests should also be thoroughly reviewed.
Some files may appear new but have just moved and/or been renamed:
- `app/scripts/lib/rpc-method-middleware/handlers/request-accounts.js`
- This was previously implemented in `controllers/permissions/permissionsMethodMiddleware.js`.
- `test/mocks/permissions.js`
- A truncated version of `test/mocks/permission-controller.js`.
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-12-07 04:16:49 +01:00
permissions : {
2022-07-22 00:43:31 +02:00
eth _accounts : {
2021-09-13 23:04:31 +02:00
invoker : 'https://app.uniswap.org' ,
parentCapability : 'eth_accounts' ,
id : 'a7342e4b-beae-4525-a36c-c0635fd03359' ,
date : 1620710693178 ,
caveats : [
2021-05-25 02:20:09 +02:00
{
Permission System 2.0 (#12243)
# Permission System 2.0
## Background
This PR migrates the extension permission system to [the new `PermissionController`](https://github.com/MetaMask/snaps-skunkworks/tree/main/packages/controllers/src/permissions).
The original permission system, based on [`rpc-cap`](https://github.com/MetaMask/rpc-cap), introduced [`ZCAP-LD`](https://w3c-ccg.github.io/zcap-ld/)-like permissions to our JSON-RPC stack.
We used it to [implement](https://github.com/MetaMask/metamask-extension/pull/7004) what we called "LoginPerSite" in [version 7.7.0](https://github.com/MetaMask/metamask-extension/releases/tag/v7.7.0) of the extension, which enabled the user to choose which accounts, if any, should be exposed to each dapp.
While that was a worthwhile feature in and of itself, we wanted a permission _system_ in order to enable everything we are going to with Snaps.
Unfortunately, the original permission system was difficult to use, and necessitated the creation of the original `PermissionsController` (note the "s"), which was more or less a wrapper for `rpc-cap`.
With this PR, we shake off the yoke of the original permission system, in favor of the modular, self-contained, ergonomic, and more mature permission system 2.0.
Note that [the `PermissionController` readme](https://github.com/MetaMask/snaps-skunkworks/tree/main/packages/controllers/src/permissions/README.md) explains how the new permission system works.
The `PermissionController` and `SubjectMetadataController` are currently shipped via `@metamask/snap-controllers`. This is a temporary state of affairs, and we'll move them to `@metamask/controllers` once they've landed in prod.
## Changes in Detail
First, the changes in this PR are not as big as they seem. Roughly half of the additions in this PR are fixtures in the test for the new migration (number 68), and a significant portion of the remaining ~2500 lines are due to find-and-replace changes in other test fixtures and UI files.
- The extension `PermissionsController` has been deleted, and completely replaced with the new `PermissionController` from [`@metamask/snap-controllers`](https://www.npmjs.com/package/@metamask/snap-controllers).
- The original `PermissionsController` "domain metadata" functionality is now managed by the new `SubjectMetadataController`, also from [`@metamask/snap-controllers`](https://www.npmjs.com/package/@metamask/snap-controllers).
- The permission activity and history log controller has been renamed `PermissionLogController` and has its own top-level state key, but is otherwise functionally equivalent to the existing implementation.
- Migration number 68 has been added to account for the new state changes.
- The tests in `app/scripts/controllers/permissions` have been migrated from `mocha` to `jest`.
Reviewers should focus their attention on the following files:
- `app/scripts/`
- `metamask-controller.js`
- This is where most of the integration work for the new `PermissionController` occurs.
Some functions that were internal to the original controller were moved here.
- `controllers/permissions/`
- `selectors.js`
- These selectors are for `ControllerMessenger` selector subscriptions. The actual subscriptions occur in `metamask-controller.js`. See the `ControllerMessenger` implementation for details.
- `specifications.js`
- The caveat and permission specifications are required by the new `PermissionController`, and are used to specify the `eth_accounts` permission and its JSON-RPC method implementation.
See the `PermissionController` readme for details.
- `migrations/068.js`
- The new state should be cross-referenced with the controllers that manage it.
The accompanying tests should also be thoroughly reviewed.
Some files may appear new but have just moved and/or been renamed:
- `app/scripts/lib/rpc-method-middleware/handlers/request-accounts.js`
- This was previously implemented in `controllers/permissions/permissionsMethodMiddleware.js`.
- `test/mocks/permissions.js`
- A truncated version of `test/mocks/permission-controller.js`.
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-12-07 04:16:49 +01:00
type : 'restrictReturnedAccounts' ,
2021-09-13 23:04:31 +02:00
value : [ '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4' ] ,
} ,
] ,
} ,
Permission System 2.0 (#12243)
# Permission System 2.0
## Background
This PR migrates the extension permission system to [the new `PermissionController`](https://github.com/MetaMask/snaps-skunkworks/tree/main/packages/controllers/src/permissions).
The original permission system, based on [`rpc-cap`](https://github.com/MetaMask/rpc-cap), introduced [`ZCAP-LD`](https://w3c-ccg.github.io/zcap-ld/)-like permissions to our JSON-RPC stack.
We used it to [implement](https://github.com/MetaMask/metamask-extension/pull/7004) what we called "LoginPerSite" in [version 7.7.0](https://github.com/MetaMask/metamask-extension/releases/tag/v7.7.0) of the extension, which enabled the user to choose which accounts, if any, should be exposed to each dapp.
While that was a worthwhile feature in and of itself, we wanted a permission _system_ in order to enable everything we are going to with Snaps.
Unfortunately, the original permission system was difficult to use, and necessitated the creation of the original `PermissionsController` (note the "s"), which was more or less a wrapper for `rpc-cap`.
With this PR, we shake off the yoke of the original permission system, in favor of the modular, self-contained, ergonomic, and more mature permission system 2.0.
Note that [the `PermissionController` readme](https://github.com/MetaMask/snaps-skunkworks/tree/main/packages/controllers/src/permissions/README.md) explains how the new permission system works.
The `PermissionController` and `SubjectMetadataController` are currently shipped via `@metamask/snap-controllers`. This is a temporary state of affairs, and we'll move them to `@metamask/controllers` once they've landed in prod.
## Changes in Detail
First, the changes in this PR are not as big as they seem. Roughly half of the additions in this PR are fixtures in the test for the new migration (number 68), and a significant portion of the remaining ~2500 lines are due to find-and-replace changes in other test fixtures and UI files.
- The extension `PermissionsController` has been deleted, and completely replaced with the new `PermissionController` from [`@metamask/snap-controllers`](https://www.npmjs.com/package/@metamask/snap-controllers).
- The original `PermissionsController` "domain metadata" functionality is now managed by the new `SubjectMetadataController`, also from [`@metamask/snap-controllers`](https://www.npmjs.com/package/@metamask/snap-controllers).
- The permission activity and history log controller has been renamed `PermissionLogController` and has its own top-level state key, but is otherwise functionally equivalent to the existing implementation.
- Migration number 68 has been added to account for the new state changes.
- The tests in `app/scripts/controllers/permissions` have been migrated from `mocha` to `jest`.
Reviewers should focus their attention on the following files:
- `app/scripts/`
- `metamask-controller.js`
- This is where most of the integration work for the new `PermissionController` occurs.
Some functions that were internal to the original controller were moved here.
- `controllers/permissions/`
- `selectors.js`
- These selectors are for `ControllerMessenger` selector subscriptions. The actual subscriptions occur in `metamask-controller.js`. See the `ControllerMessenger` implementation for details.
- `specifications.js`
- The caveat and permission specifications are required by the new `PermissionController`, and are used to specify the `eth_accounts` permission and its JSON-RPC method implementation.
See the `PermissionController` readme for details.
- `migrations/068.js`
- The new state should be cross-referenced with the controllers that manage it.
The accompanying tests should also be thoroughly reviewed.
Some files may appear new but have just moved and/or been renamed:
- `app/scripts/lib/rpc-method-middleware/handlers/request-accounts.js`
- This was previously implemented in `controllers/permissions/permissionsMethodMiddleware.js`.
- `test/mocks/permissions.js`
- A truncated version of `test/mocks/permission-controller.js`.
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-12-07 04:16:49 +01:00
} ,
2021-09-13 23:04:31 +02:00
} ,
2022-07-22 00:43:31 +02:00
'local:http://localhost:8080/' : {
2022-02-15 01:02:51 +01:00
permissions : {
2022-07-22 00:43:31 +02:00
snap _confirm : {
invoker : 'local:http://localhost:8080/' ,
2022-02-15 01:02:51 +01:00
parentCapability : 'snap_confirm' ,
id : 'a7342F4b-beae-4525-a36c-c0635fd03359' ,
date : 1620710693178 ,
2022-07-22 00:43:31 +02:00
caveats : [ ] ,
2022-02-15 01:02:51 +01:00
} ,
} ,
} ,
2021-05-25 02:20:09 +02:00
} ,
Permission System 2.0 (#12243)
# Permission System 2.0
## Background
This PR migrates the extension permission system to [the new `PermissionController`](https://github.com/MetaMask/snaps-skunkworks/tree/main/packages/controllers/src/permissions).
The original permission system, based on [`rpc-cap`](https://github.com/MetaMask/rpc-cap), introduced [`ZCAP-LD`](https://w3c-ccg.github.io/zcap-ld/)-like permissions to our JSON-RPC stack.
We used it to [implement](https://github.com/MetaMask/metamask-extension/pull/7004) what we called "LoginPerSite" in [version 7.7.0](https://github.com/MetaMask/metamask-extension/releases/tag/v7.7.0) of the extension, which enabled the user to choose which accounts, if any, should be exposed to each dapp.
While that was a worthwhile feature in and of itself, we wanted a permission _system_ in order to enable everything we are going to with Snaps.
Unfortunately, the original permission system was difficult to use, and necessitated the creation of the original `PermissionsController` (note the "s"), which was more or less a wrapper for `rpc-cap`.
With this PR, we shake off the yoke of the original permission system, in favor of the modular, self-contained, ergonomic, and more mature permission system 2.0.
Note that [the `PermissionController` readme](https://github.com/MetaMask/snaps-skunkworks/tree/main/packages/controllers/src/permissions/README.md) explains how the new permission system works.
The `PermissionController` and `SubjectMetadataController` are currently shipped via `@metamask/snap-controllers`. This is a temporary state of affairs, and we'll move them to `@metamask/controllers` once they've landed in prod.
## Changes in Detail
First, the changes in this PR are not as big as they seem. Roughly half of the additions in this PR are fixtures in the test for the new migration (number 68), and a significant portion of the remaining ~2500 lines are due to find-and-replace changes in other test fixtures and UI files.
- The extension `PermissionsController` has been deleted, and completely replaced with the new `PermissionController` from [`@metamask/snap-controllers`](https://www.npmjs.com/package/@metamask/snap-controllers).
- The original `PermissionsController` "domain metadata" functionality is now managed by the new `SubjectMetadataController`, also from [`@metamask/snap-controllers`](https://www.npmjs.com/package/@metamask/snap-controllers).
- The permission activity and history log controller has been renamed `PermissionLogController` and has its own top-level state key, but is otherwise functionally equivalent to the existing implementation.
- Migration number 68 has been added to account for the new state changes.
- The tests in `app/scripts/controllers/permissions` have been migrated from `mocha` to `jest`.
Reviewers should focus their attention on the following files:
- `app/scripts/`
- `metamask-controller.js`
- This is where most of the integration work for the new `PermissionController` occurs.
Some functions that were internal to the original controller were moved here.
- `controllers/permissions/`
- `selectors.js`
- These selectors are for `ControllerMessenger` selector subscriptions. The actual subscriptions occur in `metamask-controller.js`. See the `ControllerMessenger` implementation for details.
- `specifications.js`
- The caveat and permission specifications are required by the new `PermissionController`, and are used to specify the `eth_accounts` permission and its JSON-RPC method implementation.
See the `PermissionController` readme for details.
- `migrations/068.js`
- The new state should be cross-referenced with the controllers that manage it.
The accompanying tests should also be thoroughly reviewed.
Some files may appear new but have just moved and/or been renamed:
- `app/scripts/lib/rpc-method-middleware/handlers/request-accounts.js`
- This was previously implemented in `controllers/permissions/permissionsMethodMiddleware.js`.
- `test/mocks/permissions.js`
- A truncated version of `test/mocks/permission-controller.js`.
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-12-07 04:16:49 +01:00
permissionActivityLog : [
2021-02-08 17:49:49 +01:00
{
2021-09-13 23:04:31 +02:00
id : 522690215 ,
method : 'eth_accounts' ,
methodType : 'restricted' ,
origin : 'https://metamask.io' ,
requestTime : 1602643170686 ,
responseTime : 1602643170688 ,
success : true ,
2021-02-08 17:49:49 +01:00
} ,
{
2021-09-13 23:04:31 +02:00
id : 1620464600 ,
method : 'eth_accounts' ,
methodType : 'restricted' ,
origin : 'https://widget.getacute.io' ,
requestTime : 1602643172935 ,
responseTime : 1602643172935 ,
success : true ,
2021-02-08 17:49:49 +01:00
} ,
{
2021-09-13 23:04:31 +02:00
id : 4279100021 ,
method : 'eth_accounts' ,
methodType : 'restricted' ,
origin : 'https://app.uniswap.org' ,
requestTime : 1620710669962 ,
responseTime : 1620710669963 ,
success : true ,
2021-02-08 17:49:49 +01:00
} ,
{
2021-09-13 23:04:31 +02:00
id : 4279100022 ,
method : 'eth_requestAccounts' ,
methodType : 'restricted' ,
origin : 'https://app.uniswap.org' ,
requestTime : 1620710686872 ,
responseTime : 1620710693187 ,
success : true ,
2021-02-08 17:49:49 +01:00
} ,
{
2021-09-13 23:04:31 +02:00
id : 4279100023 ,
method : 'eth_requestAccounts' ,
methodType : 'restricted' ,
origin : 'https://app.uniswap.org' ,
requestTime : 1620710693204 ,
responseTime : 1620710693213 ,
success : true ,
2021-02-08 17:49:49 +01:00
} ,
2021-05-25 02:20:09 +02:00
{
2021-09-13 23:04:31 +02:00
id : 4279100034 ,
method : 'eth_accounts' ,
methodType : 'restricted' ,
origin : 'https://app.uniswap.org' ,
requestTime : 1620710712072 ,
responseTime : 1620710712075 ,
success : true ,
} ,
2021-02-08 17:49:49 +01:00
] ,
Permission System 2.0 (#12243)
# Permission System 2.0
## Background
This PR migrates the extension permission system to [the new `PermissionController`](https://github.com/MetaMask/snaps-skunkworks/tree/main/packages/controllers/src/permissions).
The original permission system, based on [`rpc-cap`](https://github.com/MetaMask/rpc-cap), introduced [`ZCAP-LD`](https://w3c-ccg.github.io/zcap-ld/)-like permissions to our JSON-RPC stack.
We used it to [implement](https://github.com/MetaMask/metamask-extension/pull/7004) what we called "LoginPerSite" in [version 7.7.0](https://github.com/MetaMask/metamask-extension/releases/tag/v7.7.0) of the extension, which enabled the user to choose which accounts, if any, should be exposed to each dapp.
While that was a worthwhile feature in and of itself, we wanted a permission _system_ in order to enable everything we are going to with Snaps.
Unfortunately, the original permission system was difficult to use, and necessitated the creation of the original `PermissionsController` (note the "s"), which was more or less a wrapper for `rpc-cap`.
With this PR, we shake off the yoke of the original permission system, in favor of the modular, self-contained, ergonomic, and more mature permission system 2.0.
Note that [the `PermissionController` readme](https://github.com/MetaMask/snaps-skunkworks/tree/main/packages/controllers/src/permissions/README.md) explains how the new permission system works.
The `PermissionController` and `SubjectMetadataController` are currently shipped via `@metamask/snap-controllers`. This is a temporary state of affairs, and we'll move them to `@metamask/controllers` once they've landed in prod.
## Changes in Detail
First, the changes in this PR are not as big as they seem. Roughly half of the additions in this PR are fixtures in the test for the new migration (number 68), and a significant portion of the remaining ~2500 lines are due to find-and-replace changes in other test fixtures and UI files.
- The extension `PermissionsController` has been deleted, and completely replaced with the new `PermissionController` from [`@metamask/snap-controllers`](https://www.npmjs.com/package/@metamask/snap-controllers).
- The original `PermissionsController` "domain metadata" functionality is now managed by the new `SubjectMetadataController`, also from [`@metamask/snap-controllers`](https://www.npmjs.com/package/@metamask/snap-controllers).
- The permission activity and history log controller has been renamed `PermissionLogController` and has its own top-level state key, but is otherwise functionally equivalent to the existing implementation.
- Migration number 68 has been added to account for the new state changes.
- The tests in `app/scripts/controllers/permissions` have been migrated from `mocha` to `jest`.
Reviewers should focus their attention on the following files:
- `app/scripts/`
- `metamask-controller.js`
- This is where most of the integration work for the new `PermissionController` occurs.
Some functions that were internal to the original controller were moved here.
- `controllers/permissions/`
- `selectors.js`
- These selectors are for `ControllerMessenger` selector subscriptions. The actual subscriptions occur in `metamask-controller.js`. See the `ControllerMessenger` implementation for details.
- `specifications.js`
- The caveat and permission specifications are required by the new `PermissionController`, and are used to specify the `eth_accounts` permission and its JSON-RPC method implementation.
See the `PermissionController` readme for details.
- `migrations/068.js`
- The new state should be cross-referenced with the controllers that manage it.
The accompanying tests should also be thoroughly reviewed.
Some files may appear new but have just moved and/or been renamed:
- `app/scripts/lib/rpc-method-middleware/handlers/request-accounts.js`
- This was previously implemented in `controllers/permissions/permissionsMethodMiddleware.js`.
- `test/mocks/permissions.js`
- A truncated version of `test/mocks/permission-controller.js`.
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2021-12-07 04:16:49 +01:00
permissionHistory : {
2021-09-20 21:05:58 +02:00
'https://metamask.github.io' : {
eth _accounts : {
lastApproved : 1620710693213 ,
accounts : {
'0x64a845a5b02460acf8a3d84503b0d68d028b4bb4' : 1620710693213 ,
} ,
} ,
} ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
threeBoxSyncingAllowed : false ,
showRestorePrompt : true ,
threeBoxLastUpdated : 0 ,
threeBoxAddress : null ,
threeBoxSynced : false ,
threeBoxDisabled : false ,
swapsState : {
quotes : { } ,
fetchParams : null ,
tokens : null ,
tradeTxId : null ,
approveTxId : null ,
quotesLastFetched : null ,
customMaxGas : '' ,
customGasPrice : null ,
selectedAggId : null ,
customApproveTxData : '' ,
errorKey : '' ,
topAggId : null ,
routeState : '' ,
swapsFeatureIsLive : false ,
swapsQuoteRefreshTime : 60000 ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
ensResolutionsByAddress : { } ,
pendingApprovals : { } ,
pendingApprovalCount : 0 ,
2022-02-15 01:02:51 +01:00
subjectMetadata : {
2022-07-22 00:43:31 +02:00
'http://localhost:8080' : {
2022-02-15 01:02:51 +01:00
extensionId : null ,
iconUrl : null ,
2022-07-22 00:43:31 +02:00
name : 'Hello, Snaps!' ,
origin : 'http://localhost:8080' ,
subjectType : 'website' ,
2022-02-15 01:02:51 +01:00
} ,
2022-07-22 00:43:31 +02:00
'https://metamask.github.io' : {
2022-02-15 01:02:51 +01:00
extensionId : null ,
iconUrl : null ,
2022-07-22 00:43:31 +02:00
name : 'Snaps Iframe Execution Environment' ,
origin : 'https://metamask.github.io' ,
subjectType : 'website' ,
2022-02-15 01:02:51 +01:00
} ,
2022-07-22 00:43:31 +02:00
'local:http://localhost:8080/' : {
2022-02-15 01:02:51 +01:00
extensionId : null ,
iconUrl : null ,
2022-07-22 00:43:31 +02:00
name : 'MetaMask Example Snap' ,
origin : 'local:http://localhost:8080/' ,
subjectType : 'snap' ,
svgIcon : '<svg>...</svg>' ,
version : '0.6.0' ,
} ,
} ,
2021-02-08 17:49:49 +01:00
} ,
2021-09-13 23:04:31 +02:00
appState : {
shouldClose : false ,
menuOpen : false ,
modal : {
open : false ,
modalState : {
name : null ,
2022-07-22 00:43:31 +02:00
props : {
token : {
address : '0xaD6D458402F60fD3Bd25163575031ACDce07538D' ,
symbol : 'DAI' ,
decimals : 18 ,
} ,
history : { } ,
} ,
2021-09-13 23:04:31 +02:00
} ,
previousModalState : {
name : null ,
2021-05-25 02:20:09 +02:00
} ,
} ,
2021-09-13 23:04:31 +02:00
sidebar : {
isOpen : false ,
transitionName : '' ,
type : '' ,
props : { } ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
alertOpen : false ,
alertMessage : null ,
qrCodeData : null ,
networkDropdownOpen : false ,
accountDetail : {
subview : 'transactions' ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
isLoading : false ,
warning : null ,
buyView : { } ,
isMouseUser : true ,
gasIsLoading : false ,
defaultHdPaths : {
trezor : "m/44'/60'/0'/0" ,
ledger : "m/44'/60'/0'/0/0" ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
networksTabSelectedRpcUrl : '' ,
loadingMethodData : false ,
show3BoxModalAfterImport : false ,
threeBoxLastUpdated : null ,
requestAccountTabs : { } ,
openMetaMaskTabs : { } ,
currentWindowTab : { } ,
2021-02-08 17:49:49 +01:00
} ,
2021-09-13 23:04:31 +02:00
history : {
mostRecentOverviewPage : '/' ,
2021-02-08 17:49:49 +01:00
} ,
2021-09-20 21:05:58 +02:00
send : {
toDropdownOpen : false ,
gasButtonGroupShown : true ,
errors : { } ,
asset : {
type : 'NATIVE' ,
balance : '0x0' ,
details : null ,
2021-09-08 01:51:41 +02:00
} ,
2021-10-15 14:02:13 +02:00
gas : { error : 'gas' } ,
amount : {
error : 'amount' ,
2021-09-24 03:39:22 +02:00
} ,
2022-07-19 10:35:45 +02:00
currentTransactionUUID : 'test-uuid' ,
draftTransactions : {
'test-uuid' : {
... draftTransactionInitialState ,
} ,
} ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-20 21:05:58 +02:00
confirmTransaction : {
txData : {
id : 3111025347726181 ,
time : 1620723786838 ,
status : 'unapproved' ,
metamaskNetworkId : '3' ,
chainId : '0x3' ,
loadingDefaults : false ,
txParams : {
from : '0x64a845a5b02460acf8a3d84503b0d68d028b4bb4' ,
to : '0xaD6D458402F60fD3Bd25163575031ACDce07538D' ,
value : '0x0' ,
data :
'0x095ea7b30000000000000000000000009bc5baf874d2da8d216ae9f137804184ee5afef40000000000000000000000000000000000000000000000000000000000011170' ,
gas : '0xea60' ,
gasPrice : '0x4a817c800' ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-20 21:05:58 +02:00
type : 'transfer' ,
origin : 'https://metamask.github.io' ,
transactionCategory : 'approve' ,
history : [
2021-05-25 02:20:09 +02:00
{
2021-09-20 21:05:58 +02:00
id : 3111025347726181 ,
time : 1620723786838 ,
status : 'unapproved' ,
metamaskNetworkId : '3' ,
chainId : '0x3' ,
loadingDefaults : true ,
txParams : {
from : '0x983211ce699ea5ab57cc528086154b6db1ad8e55' ,
to : '0xaD6D458402F60fD3Bd25163575031ACDce07538D' ,
value : '0x0' ,
data :
'0x095ea7b30000000000000000000000009bc5baf874d2da8d216ae9f137804184ee5afef40000000000000000000000000000000000000000000000000000000000011170' ,
gas : '0xea60' ,
gasPrice : '0x4a817c800' ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
type : 'standard' ,
origin : 'https://metamask.github.io' ,
transactionCategory : 'approve' ,
2021-05-25 02:20:09 +02:00
} ,
[
{
2021-09-13 23:04:31 +02:00
op : 'replace' ,
path : '/loadingDefaults' ,
value : false ,
note : 'Added new unapproved transaction.' ,
timestamp : 1620723786844 ,
} ,
] ,
] ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
tokenData : {
args : [
'0x9bc5baF874d2DA8D216aE9f137804184EE5AfEF4' ,
2021-05-25 02:20:09 +02:00
{
2021-09-13 23:04:31 +02:00
type : 'BigNumber' ,
hex : '0x011170' ,
} ,
2021-05-25 02:20:09 +02:00
] ,
2021-09-13 23:04:31 +02:00
functionFragment : {
type : 'function' ,
name : 'approve' ,
constant : false ,
inputs : [
2021-05-25 02:20:09 +02:00
{
2021-09-13 23:04:31 +02:00
name : '_spender' ,
type : 'address' ,
indexed : null ,
components : null ,
arrayLength : null ,
arrayChildren : null ,
baseType : 'address' ,
_isParamType : true ,
2021-05-25 02:20:09 +02:00
} ,
{
2021-09-13 23:04:31 +02:00
name : '_value' ,
type : 'uint256' ,
indexed : null ,
components : null ,
arrayLength : null ,
arrayChildren : null ,
baseType : 'uint256' ,
_isParamType : true ,
} ,
2021-05-25 02:20:09 +02:00
] ,
2021-09-13 23:04:31 +02:00
outputs : [
2021-05-25 02:20:09 +02:00
{
2021-09-13 23:04:31 +02:00
name : 'success' ,
type : 'bool' ,
indexed : null ,
components : null ,
arrayLength : null ,
arrayChildren : null ,
baseType : 'bool' ,
_isParamType : true ,
} ,
2021-05-25 02:20:09 +02:00
] ,
2021-09-13 23:04:31 +02:00
payable : false ,
stateMutability : 'nonpayable' ,
gas : null ,
_isFragment : true ,
} ,
name : 'approve' ,
signature : 'approve(address,uint256)' ,
sighash : '0x095ea7b3' ,
value : {
type : 'BigNumber' ,
hex : '0x00' ,
2021-05-25 02:20:09 +02:00
} ,
} ,
2021-09-13 23:04:31 +02:00
fiatTransactionAmount : '0' ,
fiatTransactionFee : '4.72' ,
fiatTransactionTotal : '4.72' ,
ethTransactionAmount : '0' ,
ethTransactionFee : '0.0012' ,
ethTransactionTotal : '0.0012' ,
hexTransactionAmount : '0x0' ,
hexTransactionFee : '0x44364c5bb0000' ,
hexTransactionTotal : '0x44364c5bb0000' ,
nonce : '' ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
swaps : {
aggregatorMetadata : null ,
approveTxId : null ,
balanceError : false ,
fetchingQuotes : false ,
fromToken : null ,
quotesFetchStartTime : null ,
topAssets : { } ,
toToken : null ,
customGas : {
price : null ,
limit : null ,
loading : 'INITIAL' ,
priceEstimates : { } ,
fallBackPrice : null ,
} ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
gas : {
customData : {
price : null ,
limit : '0xcb28' ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
basicEstimates : {
average : 2 ,
2021-05-25 02:20:09 +02:00
} ,
2021-09-13 23:04:31 +02:00
basicEstimateIsLoading : false ,
} ,
} ;
2021-02-08 17:49:49 +01:00
export default state ;