
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
deployless-viewer
Advanced tools
npm i deployless-viewer
Specific use case for multicall.
The method batchGetAllTokensByOwner is just a wrapper for method multicall which calls DeploylessNFTViewer with easy interface.
const { DeploylessViewerClient } = require('deployless-viewer')
const { ethers } = require("ethers");
const rpc = "https://mainnet.infura.io/v3/<YOUR_API_KEY>"
async function main () {
const provider = new ethers.providers.JsonRpcProvider(rpc);
let d = new DeploylessViewerClient(provider)
let ret = await d.batchGetAllTokensByOwner('0x7a9fe22691c811ea339d9b73150e6911a5343dca', [
{
nftType: 2,
nft: '0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb'
}, {
nftType: 1,
nft: '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d'
}])
console.log(`ret:`, ret)
}
main()
1: ERC721Enumerable
2: CryptoPunks
3: ERC721 without ERC721Enumerable(rare case)
Accept an array of calls and call them all at once.
If 0x0 is passed as address to call, DeploylessNFTViewer will be called instead.
const {
DeploylessViewerClient,
NFTEnumerable__factory,
} = require('deployless-viewer')
const { ethers } = require('ethers')
const rpc = 'https://mainnet.infura.io/v3/af88d7776e3f4e1888ac935b9b16effd'
async function main () {
const provider = new ethers.providers.JsonRpcProvider(rpc)
let d = new DeploylessViewerClient(provider)
let ret = await d.multicall([
{
target: ethers.constants.AddressZero,
callData: d.deploylessNFTViewer.interface.encodeFunctionData('batchGetAllTokensByOwner', [
'0x7a9fe22691c811ea339d9b73150e6911a5343dca', [
{
nftType: 2,
nft: '0xb47e3cd837ddf8e4c57f05d70ab865de6e193bbb',
}, {
nftType: 1,
nft: '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d',
}]]),
},
{
target: '0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d',
callData: NFTEnumerable__factory.createInterface()
.encodeFunctionData('tokenURI', [999]),
},
])
let { blockNumber, resultsArray: [ret1, ret2] } = ret
let ret1Value = d.deploylessNFTViewer.interface.decodeFunctionResult('batchGetAllTokensByOwner', ret1)
let ret2Value = NFTEnumerable__factory.createInterface()
.decodeFunctionResult('tokenURI', ret2)
console.log(`ret1Value:`, ret1Value)
console.log(`ret2Value:`, ret2Value)
}
main()
FAQs
```shell npm i deployless-viewer ```
The npm package deployless-viewer receives a total of 0 weekly downloads. As such, deployless-viewer popularity was classified as not popular.
We found that deployless-viewer demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.