diff --git a/ui/pages/send/send-content/send-content.component.js b/ui/pages/send/send-content/send-content.component.js
index a856624d12fa..9a157c0b7d11 100644
--- a/ui/pages/send/send-content/send-content.component.js
+++ b/ui/pages/send/send-content/send-content.component.js
@@ -71,7 +71,7 @@ export default class SendContent extends Component {
const showHexData =
this.props.showHexData &&
asset.type !== ASSET_TYPES.TOKEN &&
- asset.type !== ASSET_TYPES.COLLECTIBLE;
+ asset.type !== ASSET_TYPES.NFT;
const showKnownRecipientWarning =
recipient.warning === 'knownAddressRecipient';
diff --git a/ui/pages/settings/experimental-tab/experimental-tab.component.js b/ui/pages/settings/experimental-tab/experimental-tab.component.js
index 3f644bb4b5fb..fc05a862076c 100644
--- a/ui/pages/settings/experimental-tab/experimental-tab.component.js
+++ b/ui/pages/settings/experimental-tab/experimental-tab.component.js
@@ -14,8 +14,8 @@ export default class ExperimentalTab extends PureComponent {
};
static propTypes = {
- useCollectibleDetection: PropTypes.bool,
- setUseCollectibleDetection: PropTypes.func,
+ useNftDetection: PropTypes.bool,
+ setUseNftDetection: PropTypes.func,
setOpenSeaEnabled: PropTypes.func,
openSeaEnabled: PropTypes.bool,
eip1559V2Enabled: PropTypes.bool,
@@ -52,8 +52,8 @@ export default class ExperimentalTab extends PureComponent {
const { t } = this.context;
const {
- useCollectibleDetection,
- setUseCollectibleDetection,
+ useNftDetection,
+ setUseNftDetection,
openSeaEnabled,
setOpenSeaEnabled,
} = this.props;
@@ -72,7 +72,7 @@ export default class ExperimentalTab extends PureComponent {
{
this.context.trackEvent({
category: EVENT.CATEGORIES.SETTINGS,
@@ -85,7 +85,7 @@ export default class ExperimentalTab extends PureComponent {
if (!value && !openSeaEnabled) {
setOpenSeaEnabled(!value);
}
- setUseCollectibleDetection(!value);
+ setUseNftDetection(!value);
}}
offLabel={t('off')}
onLabel={t('on')}
@@ -104,8 +104,8 @@ export default class ExperimentalTab extends PureComponent {
const {
openSeaEnabled,
setOpenSeaEnabled,
- useCollectibleDetection,
- setUseCollectibleDetection,
+ useNftDetection,
+ setUseNftDetection,
} = this.props;
return (
@@ -133,8 +133,8 @@ export default class ExperimentalTab extends PureComponent {
},
});
// value is positive when being toggled off
- if (value && useCollectibleDetection) {
- setUseCollectibleDetection(false);
+ if (value && useNftDetection) {
+ setUseNftDetection(false);
}
setOpenSeaEnabled(!value);
}}
diff --git a/ui/pages/settings/experimental-tab/experimental-tab.container.js b/ui/pages/settings/experimental-tab/experimental-tab.container.js
index aa4f8b2cf0c2..16d2fbfb3dd9 100644
--- a/ui/pages/settings/experimental-tab/experimental-tab.container.js
+++ b/ui/pages/settings/experimental-tab/experimental-tab.container.js
@@ -2,13 +2,13 @@ import { compose } from 'redux';
import { connect } from 'react-redux';
import { withRouter } from 'react-router-dom';
import {
- setUseCollectibleDetection,
+ setUseNftDetection,
setOpenSeaEnabled,
setEIP1559V2Enabled,
setImprovedTokenAllowanceEnabled,
} from '../../../store/actions';
import {
- getUseCollectibleDetection,
+ getUseNftDetection,
getOpenSeaEnabled,
getEIP1559V2Enabled,
getIsImprovedTokenAllowanceEnabled,
@@ -17,7 +17,7 @@ import ExperimentalTab from './experimental-tab.component';
const mapStateToProps = (state) => {
return {
- useCollectibleDetection: getUseCollectibleDetection(state),
+ useNftDetection: getUseNftDetection(state),
openSeaEnabled: getOpenSeaEnabled(state),
eip1559V2Enabled: getEIP1559V2Enabled(state),
improvedTokenAllowanceEnabled: getIsImprovedTokenAllowanceEnabled(state),
@@ -26,8 +26,7 @@ const mapStateToProps = (state) => {
const mapDispatchToProps = (dispatch) => {
return {
- setUseCollectibleDetection: (val) =>
- dispatch(setUseCollectibleDetection(val)),
+ setUseNftDetection: (val) => dispatch(setUseNftDetection(val)),
setOpenSeaEnabled: (val) => dispatch(setOpenSeaEnabled(val)),
setEIP1559V2Enabled: (val) => dispatch(setEIP1559V2Enabled(val)),
setImprovedTokenAllowanceEnabled: (val) =>
diff --git a/ui/selectors/selectors.js b/ui/selectors/selectors.js
index a4ce54be8ef7..74305d7e9e79 100644
--- a/ui/selectors/selectors.js
+++ b/ui/selectors/selectors.js
@@ -1023,13 +1023,13 @@ export function getUseTokenDetection(state) {
}
/**
- * To get the useCollectibleDetection flag which determines whether we autodetect NFTs
+ * To get the useNftDetection flag which determines whether we autodetect NFTs
*
* @param {*} state
* @returns Boolean
*/
-export function getUseCollectibleDetection(state) {
- return Boolean(state.metamask.useCollectibleDetection);
+export function getUseNftDetection(state) {
+ return Boolean(state.metamask.useNftDetection);
}
/**
diff --git a/ui/store/actions.js b/ui/store/actions.js
index d2c61284636d..ab46d03641fd 100644
--- a/ui/store/actions.js
+++ b/ui/store/actions.js
@@ -1781,7 +1781,7 @@ export async function getBalancesInSingleCall(tokens) {
return await submitRequestToBackground('getBalancesInSingleCall', [tokens]);
}
-export function addCollectible(address, tokenID, dontShowLoadingIndicator) {
+export function addNft(address, tokenID, dontShowLoadingIndicator) {
return async (dispatch) => {
if (!address) {
throw new Error('MetaMask - Cannot add collectible without address');
@@ -1793,7 +1793,7 @@ export function addCollectible(address, tokenID, dontShowLoadingIndicator) {
dispatch(showLoadingIndication());
}
try {
- await submitRequestToBackground('addCollectible', [address, tokenID]);
+ await submitRequestToBackground('addNft', [address, tokenID]);
} catch (error) {
log.error(error);
dispatch(displayWarning(error.message));
@@ -1804,7 +1804,7 @@ export function addCollectible(address, tokenID, dontShowLoadingIndicator) {
};
}
-export function addCollectibleVerifyOwnership(
+export function addNftVerifyOwnership(
address,
tokenID,
dontShowLoadingIndicator,
@@ -1820,7 +1820,7 @@ export function addCollectibleVerifyOwnership(
dispatch(showLoadingIndication());
}
try {
- await submitRequestToBackground('addCollectibleVerifyOwnership', [
+ await submitRequestToBackground('addNftVerifyOwnership', [
address,
tokenID,
]);
@@ -1841,11 +1841,7 @@ export function addCollectibleVerifyOwnership(
};
}
-export function removeAndIgnoreCollectible(
- address,
- tokenID,
- dontShowLoadingIndicator,
-) {
+export function removeAndIgnoreNft(address, tokenID, dontShowLoadingIndicator) {
return async (dispatch) => {
if (!address) {
throw new Error('MetaMask - Cannot ignore collectible without address');
@@ -1857,10 +1853,7 @@ export function removeAndIgnoreCollectible(
dispatch(showLoadingIndication());
}
try {
- await submitRequestToBackground('removeAndIgnoreCollectible', [
- address,
- tokenID,
- ]);
+ await submitRequestToBackground('removeAndIgnoreNft', [address, tokenID]);
} catch (error) {
log.error(error);
dispatch(displayWarning(error.message));
@@ -1871,7 +1864,7 @@ export function removeAndIgnoreCollectible(
};
}
-export function removeCollectible(address, tokenID, dontShowLoadingIndicator) {
+export function removeNft(address, tokenID, dontShowLoadingIndicator) {
return async (dispatch) => {
if (!address) {
throw new Error('MetaMask - Cannot remove collectible without address');
@@ -1883,7 +1876,7 @@ export function removeCollectible(address, tokenID, dontShowLoadingIndicator) {
dispatch(showLoadingIndication());
}
try {
- await submitRequestToBackground('removeCollectible', [address, tokenID]);
+ await submitRequestToBackground('removeNft', [address, tokenID]);
} catch (error) {
log.error(error);
dispatch(displayWarning(error.message));
@@ -1894,31 +1887,27 @@ export function removeCollectible(address, tokenID, dontShowLoadingIndicator) {
};
}
-export async function checkAndUpdateAllCollectiblesOwnershipStatus() {
- await submitRequestToBackground(
- 'checkAndUpdateAllCollectiblesOwnershipStatus',
- );
+export async function checkAndUpdateAllNftsOwnershipStatus() {
+ await submitRequestToBackground('checkAndUpdateAllNftsOwnershipStatus');
}
-export async function isCollectibleOwner(
+export async function isNftOwner(
ownerAddress,
collectibleAddress,
collectibleId,
) {
- return await submitRequestToBackground('isCollectibleOwner', [
+ return await submitRequestToBackground('isNftOwner', [
ownerAddress,
collectibleAddress,
collectibleId,
]);
}
-export async function checkAndUpdateSingleCollectibleOwnershipStatus(
- collectible,
-) {
- await submitRequestToBackground(
- 'checkAndUpdateSingleCollectibleOwnershipStatus',
- [collectible, false],
- );
+export async function checkAndUpdateSingleNftOwnershipStatus(collectible) {
+ await submitRequestToBackground('checkAndUpdateSingleNftOwnershipStatus', [
+ collectible,
+ false,
+ ]);
}
export async function getTokenStandardAndDetails(
@@ -2729,11 +2718,11 @@ export function setUseTokenDetection(val) {
};
}
-export function setUseCollectibleDetection(val) {
+export function setUseNftDetection(val) {
return (dispatch) => {
dispatch(showLoadingIndication());
- log.debug(`background.setUseCollectibleDetection`);
- callBackgroundMethod('setUseCollectibleDetection', [val], (err) => {
+ log.debug(`background.setUseNftDetection`);
+ callBackgroundMethod('setUseNftDetection', [val], (err) => {
dispatch(hideLoadingIndication());
if (err) {
dispatch(displayWarning(err.message));
@@ -2755,11 +2744,11 @@ export function setOpenSeaEnabled(val) {
};
}
-export function detectCollectibles() {
+export function detectNfts() {
return async (dispatch) => {
dispatch(showLoadingIndication());
- log.debug(`background.detectCollectibles`);
- await submitRequestToBackground('detectCollectibles');
+ log.debug(`background.detectNfts`);
+ await submitRequestToBackground('detectNfts');
dispatch(hideLoadingIndication());
await forceUpdateMetamaskState(dispatch);
};
diff --git a/yarn.lock b/yarn.lock
index 6afea26c5f5a..a84ca04f44ec 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2909,6 +2909,49 @@
web3 "^0.20.7"
web3-provider-engine "^16.0.3"
+"@metamask/controllers@^33.0.0":
+ version "33.0.0"
+ resolved "https://registry.yarnpkg.com/@metamask/controllers/-/controllers-33.0.0.tgz#908c05f6bee741c0beecd9d85d50c304afa38f2b"
+ integrity sha512-ImnoLztyyE9qswPAv6zk7d40d5FTMPiJYqAjjnJz+hEYhhGPGYI87+2OF/i+kVLv3gatyBQzNxvE1qtQSDWJsg==
+ dependencies:
+ "@ethereumjs/common" "^2.3.1"
+ "@ethereumjs/tx" "^3.2.1"
+ "@ethersproject/abi" "^5.7.0"
+ "@ethersproject/contracts" "^5.7.0"
+ "@ethersproject/providers" "^5.7.0"
+ "@keystonehq/metamask-airgapped-keyring" "^0.6.1"
+ "@metamask/contract-metadata" "^1.35.0"
+ "@metamask/metamask-eth-abis" "3.0.0"
+ "@metamask/types" "^1.1.0"
+ "@types/uuid" "^8.3.0"
+ abort-controller "^3.0.0"
+ async-mutex "^0.2.6"
+ babel-runtime "^6.26.0"
+ deep-freeze-strict "^1.1.1"
+ eth-ens-namehash "^2.0.8"
+ eth-json-rpc-infura "^5.1.0"
+ eth-keyring-controller "^7.0.2"
+ eth-method-registry "1.1.0"
+ eth-phishing-detect "^1.2.0"
+ eth-query "^2.1.2"
+ eth-rpc-errors "^4.0.0"
+ eth-sig-util "^3.0.0"
+ ethereumjs-util "^7.0.10"
+ ethereumjs-wallet "^1.0.1"
+ ethjs-unit "^0.1.6"
+ fast-deep-equal "^3.1.3"
+ immer "^9.0.6"
+ isomorphic-fetch "^3.0.0"
+ json-rpc-engine "^6.1.0"
+ jsonschema "^1.2.4"
+ multiformats "^9.5.2"
+ nanoid "^3.1.31"
+ punycode "^2.1.1"
+ single-call-balance-checker-abi "^1.0.0"
+ uuid "^8.3.2"
+ web3 "^0.20.7"
+ web3-provider-engine "^16.0.3"
+
"@metamask/design-tokens@^1.6.0", "@metamask/design-tokens@^1.9.0":
version "1.9.0"
resolved "https://registry.yarnpkg.com/@metamask/design-tokens/-/design-tokens-1.9.0.tgz#2b173c671f36b0d3faa2e31ea4bf66e811a7ff49"