Skip to content
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

view staked nfts #16

Closed
jb4earth opened this issue Aug 3, 2022 · 1 comment
Closed

view staked nfts #16

jb4earth opened this issue Aug 3, 2022 · 1 comment
Assignees

Comments

@jb4earth
Copy link
Collaborator

jb4earth commented Aug 3, 2022

view all staked nfts (there's a call in the smart contract to do this use ether.js NOT moralis)

check smart contract for the following:
stakerWallet (show all nfts in wallet)

https://rinkeby.etherscan.io/viewsvg?t=1&a=0x550B38EdAe1d4868CD7e3AB4574a9E6c1fD66362

@dave-16
Copy link
Collaborator

dave-16 commented Aug 14, 2022

async stakedNFTS()
{
const provider = new ethers.providers.Web3Provider(window.ethereum)
const data = await provider.send("eth_requestAccounts", []);
const url = []
const array = this.ArrayofStakedtkn
console.log('fjal;dskjfadjslkf',this.ArrayofStakedtkn)
console.log('xxxxxxxxxxxxxxxx',array.length)
let NOVAcon = new web3.eth.Contract(this.ABI_DAO, this.DAO);
const name =await NOVAcon.methods.name().call()
for (var i =0; i<array.length; i++)
{
let tokenURL =await NOVAcon.methods.tokenURI(i).call();
let tokenID = this.ArrayofStakedtkn[i]
console.log('tokenID',tokenID)
console.log('token',tokenURL)
const json = {tokenURL ,name,tokenID}
console.log(json)
url.push(json)
}
return url
}

we can view the staked nfts and amount

@dave-16 dave-16 closed this as completed Aug 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants