mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
eeee8852cd
`eth_getProof` is an unpermissioned, read-only RPC method for getting account-related Merkle proofs, specified here: https://eips.ethereum.org/EIPS/eip-1186 It's been supported by major Ethereum clients, and Infura, for some time. By adding it to the safe methods list, we enable this method for our users.
99 lines
2.3 KiB
JavaScript
99 lines
2.3 KiB
JavaScript
export const APPROVAL_TYPE = 'wallet_requestPermissions'
|
|
|
|
export const WALLET_PREFIX = 'wallet_'
|
|
|
|
export const HISTORY_STORE_KEY = 'permissionsHistory'
|
|
|
|
export const LOG_STORE_KEY = 'permissionsLog'
|
|
|
|
export const METADATA_STORE_KEY = 'domainMetadata'
|
|
|
|
export const METADATA_CACHE_MAX_SIZE = 100
|
|
|
|
export const CAVEAT_NAMES = {
|
|
exposedAccounts: 'exposedAccounts',
|
|
primaryAccountOnly: 'primaryAccountOnly',
|
|
}
|
|
|
|
export const CAVEAT_TYPES = {
|
|
limitResponseLength: 'limitResponseLength',
|
|
filterResponse: 'filterResponse',
|
|
}
|
|
|
|
export const NOTIFICATION_NAMES = {
|
|
accountsChanged: 'metamask_accountsChanged',
|
|
unlockStateChanged: 'metamask_unlockStateChanged',
|
|
chainChanged: 'metamask_chainChanged',
|
|
}
|
|
|
|
export const LOG_IGNORE_METHODS = [
|
|
'wallet_registerOnboarding',
|
|
'wallet_watchAsset',
|
|
]
|
|
|
|
export const LOG_METHOD_TYPES = {
|
|
restricted: 'restricted',
|
|
internal: 'internal',
|
|
}
|
|
|
|
export const LOG_LIMIT = 100
|
|
|
|
export const SAFE_METHODS = [
|
|
'eth_blockNumber',
|
|
'eth_call',
|
|
'eth_chainId',
|
|
'eth_coinbase',
|
|
'eth_decrypt',
|
|
'eth_estimateGas',
|
|
'eth_gasPrice',
|
|
'eth_getBalance',
|
|
'eth_getBlockByHash',
|
|
'eth_getBlockByNumber',
|
|
'eth_getBlockTransactionCountByHash',
|
|
'eth_getBlockTransactionCountByNumber',
|
|
'eth_getCode',
|
|
'eth_getEncryptionPublicKey',
|
|
'eth_getFilterChanges',
|
|
'eth_getFilterLogs',
|
|
'eth_getLogs',
|
|
'eth_getProof',
|
|
'eth_getStorageAt',
|
|
'eth_getTransactionByBlockHashAndIndex',
|
|
'eth_getTransactionByBlockNumberAndIndex',
|
|
'eth_getTransactionByHash',
|
|
'eth_getTransactionCount',
|
|
'eth_getTransactionReceipt',
|
|
'eth_getUncleByBlockHashAndIndex',
|
|
'eth_getUncleByBlockNumberAndIndex',
|
|
'eth_getUncleCountByBlockHash',
|
|
'eth_getUncleCountByBlockNumber',
|
|
'eth_getWork',
|
|
'eth_hashrate',
|
|
'eth_mining',
|
|
'eth_newBlockFilter',
|
|
'eth_newFilter',
|
|
'eth_newPendingTransactionFilter',
|
|
'eth_protocolVersion',
|
|
'eth_sendRawTransaction',
|
|
'eth_sendTransaction',
|
|
'eth_sign',
|
|
'eth_signTypedData',
|
|
'eth_signTypedData_v1',
|
|
'eth_signTypedData_v3',
|
|
'eth_signTypedData_v4',
|
|
'eth_submitHashrate',
|
|
'eth_submitWork',
|
|
'eth_syncing',
|
|
'eth_uninstallFilter',
|
|
'metamask_getProviderState',
|
|
'metamask_watchAsset',
|
|
'net_listening',
|
|
'net_peerCount',
|
|
'net_version',
|
|
'personal_ecRecover',
|
|
'personal_sign',
|
|
'wallet_watchAsset',
|
|
'web3_clientVersion',
|
|
'web3_sha3',
|
|
]
|