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

Decoding AssetId for Estates #663

Closed
1 of 2 tasks
neocybereth opened this issue Nov 10, 2018 · 12 comments
Closed
1 of 2 tasks

Decoding AssetId for Estates #663

neocybereth opened this issue Nov 10, 2018 · 12 comments

Comments

@neocybereth
Copy link

🎉 Description

Whenever I utilize the decodeTokenId() with an assetId from an estate I get back false X, Y values.

!!!!! This is more a request for help

  • 🐛 This is a bug report.
  • 📈 This is a feature request.

📝 Details

So I'm getting data from the blockchain and running it through the decodeTokenId function. Whenever it's an estate I'm not able to get the sale/creation data. How can I do that for an estate?

@nachomazzara
Copy link
Contributor

Hey, you don't need to use decodeTokenId for Estate.

The id for an Estate has not specially encoded as LAND. So you could get an Estate's order as:

marketplaceContract.orderByAssetId(EstateRegistryContractAddress, Estate_ID_WITHOUT_DECODING)

E.G:
marketplaceContract.orderByAssetId('0x8e5660b4ab70168b5a6feea0e0315cb49c8cd539', 1)

This will get the order for the Estate with Id 1

@neocybereth
Copy link
Author

Cool, that works. How can I get the # of LAND available in that estate and their particular coordinates?

@nachomazzara
Copy link
Contributor

Get # of LAND by EstateId

const stateSize = await estateContract.getEstateSize(EstateId)

Get LAND coordinates by EstateId

for (let i = 0; i < stateSize; i++) {
  // LAND
  const landId = await estateRegistry.estateLandIds(estateId, index)
}

@neocybereth
Copy link
Author

sweeet, thanks. And the estateContract is built up of the estate contract ABI and estate Proxy address correct?

@nachomazzara
Copy link
Contributor

Yes!

@neocybereth
Copy link
Author

doooopeeee. all sorted, thank you!

@neocybereth
Copy link
Author

image 13-11-18 at 4 45 pm

I've tried this with both the EstateRegistryContractAddress as well as the MarketPlace (& Proxy) address to no avail. Any ideas what I could be doing wrong @nachomazzara ?

Hey, you don't need to use decodeTokenId for Estate.

The id for an Estate has not specially encoded as LAND. So you could get an Estate's order as:

marketplaceContract.orderByAssetId(EstateRegistryContractAddress, Estate_ID_WITHOUT_DECODING)

E.G:
marketplaceContract.orderByAssetId('0x8e5660b4ab70168b5a6feea0e0315cb49c8cd539', 1)

This will get the order for the Estate with Id 1

@nachomazzara
Copy link
Contributor

That estate doesn't have an open publication.
Check the marketplace and try with an Estate on sale

@neocybereth
Copy link
Author

@nachomazzara I tried the above with an estate on sale and no dice. Sorry I'm just getting back to you, I'm just now circling around to this issue

@neocybereth
Copy link
Author

screen shot 2019-01-07 at 5 14 02 pm
screen shot 2019-01-07 at 5 14 11 pm

@nachomazzara
Copy link
Contributor

You can’t use etherscan to check it cause you need to use the proxy contract address with the contract ABI.

You can do it with mycrypto

Marketplace proxy contract: 0x8e5660b4ab70168b5a6feea0e0315cb49c8cd539

Marketplace contract: 0x19a8ed4860007a66805782ed7e0bed4e44fc6717

@neocybereth
Copy link
Author

ahh okay, that fixed it!

marketplaceContract.orderByAssetId(EstateRegistryContractAddress, Estate_ID_WITHOUT_DECODING)

I was using the address from the example just below this one ^, but it was the marketplace address! And thank you, mycrypto works way better!

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

2 participants