Skip to content

Commit

Permalink
@metamask/contract-metadata (#9968)
Browse files Browse the repository at this point in the history
  • Loading branch information
rekmarks authored Dec 1, 2020
1 parent cc1161a commit 9d4b8a4
Show file tree
Hide file tree
Showing 15 changed files with 21 additions and 17 deletions.
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ updates:
interval: "daily"
allow:
- dependency-name: "@metamask/*"
- dependency-name: "eth-contract-metadata"
versioning-strategy: "lockfile-only"
4 changes: 2 additions & 2 deletions app/scripts/controllers/detect-tokens.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Web3 from 'web3'
import contracts from 'eth-contract-metadata'
import contracts from '@metamask/contract-metadata'
import { warn } from 'loglevel'
import SINGLE_CALL_BALANCES_ABI from 'single-call-balance-checker-abi'
import { MAINNET } from './network/enums'
Expand Down Expand Up @@ -32,7 +32,7 @@ export default class DetectTokensController {
}

/**
* For each token in eth-contract-metadata, find check selectedAddress balance.
* For each token in @metamask/contract-metadata, find check selectedAddress balance.
*/
async detectNewTokens() {
if (!this.isActive) {
Expand Down
2 changes: 1 addition & 1 deletion app/scripts/metamask-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import TrezorKeyring from 'eth-trezor-keyring'
import LedgerBridgeKeyring from '@metamask/eth-ledger-bridge-keyring'
import EthQuery from 'eth-query'
import nanoid from 'nanoid'
import contractMap from 'eth-contract-metadata'
import contractMap from '@metamask/contract-metadata'
import {
AddressBookController,
CurrencyRateController,
Expand Down
2 changes: 1 addition & 1 deletion development/build/static.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const copyTargets = [
dest: `images`,
},
{
src: `./node_modules/eth-contract-metadata/images/`,
src: `./node_modules/@metamask/contract-metadata/images/`,
dest: `images/contract`,
},
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
"@formatjs/intl-relativetimeformat": "^5.2.6",
"@fortawesome/fontawesome-free": "^5.13.0",
"@material-ui/core": "^4.11.0",
"@metamask/contract-metadata": "^1.19.0",
"@metamask/controllers": "^4.2.0",
"@metamask/eth-ledger-bridge-keyring": "^0.2.6",
"@metamask/eth-token-tracker": "^3.0.1",
Expand Down Expand Up @@ -104,7 +105,6 @@
"dnode": "^1.2.2",
"end-of-stream": "^1.4.4",
"eth-block-tracker": "^4.4.2",
"eth-contract-metadata": "^1.16.0",
"eth-ens-namehash": "^2.0.8",
"eth-json-rpc-errors": "^2.0.2",
"eth-json-rpc-filters": "^4.2.1",
Expand Down
4 changes: 2 additions & 2 deletions shared/constants/tokens.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import contractMap from 'eth-contract-metadata'
import contractMap from '@metamask/contract-metadata'

/**
* A normalized list of addresses exported as part of the contractMap in
* eth-contract-metadata. Used primarily to validate if manually entered
* @metamask/contract-metadata. Used primarily to validate if manually entered
* contract addresses do not match one of our listed tokens
*/
export const LISTED_CONTRACT_ADDRESSES = Object.keys(
Expand Down
2 changes: 1 addition & 1 deletion test/unit/app/controllers/detect-tokens-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import assert from 'assert'
import sinon from 'sinon'
import ObservableStore from 'obs-store'
import contracts from 'eth-contract-metadata'
import contracts from '@metamask/contract-metadata'
import BigNumber from 'bignumber.js'

import DetectTokensController from '../../../../app/scripts/controllers/detect-tokens'
Expand Down
2 changes: 1 addition & 1 deletion ui/app/components/ui/identicon/identicon.component.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
import contractMap from 'eth-contract-metadata'
import contractMap from '@metamask/contract-metadata'

import { checksumAddress } from '../../../helpers/utils/util'
import Jazzicon from '../jazzicon'
Expand Down
2 changes: 1 addition & 1 deletion ui/app/helpers/utils/token-util.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import log from 'loglevel'
import BigNumber from 'bignumber.js'
import contractMap from 'eth-contract-metadata'
import contractMap from '@metamask/contract-metadata'
import * as util from './util'
import { conversionUtil, multiplyCurrencies } from './conversion-util'
import { formatCurrency } from './confirm-tx.util'
Expand Down
2 changes: 1 addition & 1 deletion ui/app/hooks/useTokensToSearch.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useMemo } from 'react'
import { useSelector } from 'react-redux'
import contractMap from 'eth-contract-metadata'
import contractMap from '@metamask/contract-metadata'
import BigNumber from 'bignumber.js'
import { isEqual, shuffle } from 'lodash'
import { checksumAddress } from '../helpers/utils/util'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import contractMap from 'eth-contract-metadata'
import contractMap from '@metamask/contract-metadata'
import Fuse from 'fuse.js'
import InputAdornment from '@material-ui/core/InputAdornment'
import TextField from '../../../components/ui/text-field'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { connect } from 'react-redux'
import { compose } from 'redux'
import { withRouter } from 'react-router-dom'
import contractMap from 'eth-contract-metadata'
import contractMap from '@metamask/contract-metadata'
import { clearConfirmTransaction } from '../../ducks/confirm-transaction/confirm-transaction.duck'

import {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import ethUtil from 'ethereumjs-util'
import contractMap from 'eth-contract-metadata'
import contractMap from '@metamask/contract-metadata'
import {
REQUIRED_ERROR,
INVALID_RECIPIENT_ADDRESS_ERROR,
Expand Down
2 changes: 1 addition & 1 deletion ui/lib/icon-factory.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { isValidAddress } from 'ethereumjs-util'
import contractMap from 'eth-contract-metadata'
import contractMap from '@metamask/contract-metadata'
import { checksumAddress } from '../app/helpers/utils/util'

let iconFactory
Expand Down
7 changes: 6 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2014,6 +2014,11 @@
prop-types "^15.7.2"
react-is "^16.8.0"

"@metamask/contract-metadata@^1.19.0":
version "1.19.0"
resolved "https://registry.yarnpkg.com/@metamask/contract-metadata/-/contract-metadata-1.19.0.tgz#2f074bce7ab7ffd0d20e3905b1936da0749a0473"
integrity sha512-TklMuz7ZbFJ2Zc6C7I+9qL3J9J+4prs5Ok5MJzoxD/57Iq6espzArhpI275elVCFF9ci8IMvach1kH8+F04/hA==

"@metamask/controllers@^3.1.0":
version "3.2.0"
resolved "https://registry.yarnpkg.com/@metamask/controllers/-/controllers-3.2.0.tgz#8ad2e63f7953d294712d9b5bacaea1c5261ce588"
Expand Down Expand Up @@ -9942,7 +9947,7 @@ eth-block-tracker@^4.4.2:
pify "^3.0.0"
safe-event-emitter "^1.0.1"

eth-contract-metadata@^1.11.0, eth-contract-metadata@^1.16.0:
eth-contract-metadata@^1.11.0:
version "1.17.0"
resolved "https://registry.yarnpkg.com/eth-contract-metadata/-/eth-contract-metadata-1.17.0.tgz#96d4b056ac9a7175eeba091dbabd0713cfd4c703"
integrity sha512-vlw4OiW3+9J3kJfEtPCyiSW9fhdWTqrAhXcvdMY2CevGxbhvOd5Lz59DeWerSTV3IoSXttghDurPA76dAeTV+A==
Expand Down

0 comments on commit 9d4b8a4

Please sign in to comment.