-
-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Collectibles -> Nfts #237
Collectibles -> Nfts #237
Conversation
watchNFTsButton.onclick = async () => { | ||
const currentTokenId = await nftsContract.currentTokenId(); | ||
const nftsContractAddress = nftsContract.address; | ||
let watchNftsResult; | ||
try { | ||
watchNftsResult = await ethereum.sendAsync( | ||
Array.from({ length: currentTokenId }, (_, i) => i + 1).map( | ||
(tokenId) => { | ||
return { | ||
method: 'wallet_watchAsset', | ||
params: { | ||
type: 'ERC721', | ||
options: { | ||
address: nftsContractAddress, | ||
tokenId, | ||
}, | ||
}, | ||
}; | ||
}, | ||
), | ||
); | ||
} catch (error) { | ||
console.error(error); | ||
} | ||
console.log(watchNftsResult); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is slightly unrelated. It is simply moving this onclick handler outside of the mintButton
onclick handler so that it can be used to watch already minted NFTs when you pass a contract address to the dapp via url query string (without calling a new mint in that session).
In the extension we have dropped use of the term
collectible
in favor ofnft
. This PR simply updates the test-dapp to unify our terminology.This will require updating our e2e tests to look grab the new text.