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

feat: display Parent NFT data on the Parent page #10

Merged
merged 5 commits into from
Mar 6, 2023

Conversation

impelcrypto
Copy link
Member

image

image

@impelcrypto impelcrypto changed the title feat: display Parent NFT date on Parent page feat: display Parent NFT data on the Parent page Mar 3, 2023
@impelcrypto impelcrypto changed the base branch from main to feat/fetch-from-chain March 3, 2023 16:38
@impelcrypto impelcrypto requested a review from bobo-k2 March 3, 2023 16:39
@github-actions
Copy link

github-actions bot commented Mar 3, 2023

Visit the preview URL for this PR (updated for commit fc2e9cf):

https://ink-nft-246a8--pr10-feat-parent-page-1oitj8xi.web.app

(expires Mon, 13 Mar 2023 11:19:26 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 5ac08693a193400324311225543cd42232d18254

@impelcrypto
Copy link
Member Author

@bobo-k2
FYI: I've added chunky and parts contract addresses in providerEndpoints

@@ -75,13 +108,27 @@ export default defineComponent({

const dummyEquippedList = [dummyItemB, dummyItemA];

const equipped = computed<IBasePart[]>(() => props.parts.filter((it) => isSlotEquipped(it)));

const navigateToChild = (id: string): void => {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @bobo-k2
For the equipped items, I assume tokenId for the "/child page" can be found in z. Please let me know if this is not correct.
image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Contributor

@bobo-k2 bobo-k2 Mar 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @impelcrypto this is not correct. Z variable determines in which layer asset should be rendered. Something like z-index in css.
To get token id you should use equippable::get_equipment. The method, beside others, returns equipped item contract address and token id.

@bobo-k2
Copy link
Contributor

bobo-k2 commented Mar 6, 2023

@bobo-k2 FYI: I've added chunky and parts contract addresses in providerEndpoints

Maybe to make naming more generic. Instead of chunkyAddress name it baseContractAddress and make it array, so we can support multiple NFT contracts. partsAddress is not needed since this address can be fetched from base contract.

@impelcrypto
Copy link
Member Author

impelcrypto commented Mar 6, 2023

partsAddress is not needed since this address can be fetched from base contract.

Sorry, could you send me an example code for this?

@bobo-k2
Copy link
Contributor

bobo-k2 commented Mar 6, 2023

partsAddress is not needed since this address can be fetched from base contract.
Sorry, could you send me an example code for this?

Sure,
If you want to get assets that can be equipped to base you can call
image
As result you will get child contract address and token id.

When you want to check what is equipped on base you can call
image
In you case slotPartId can be 12 or 13

@impelcrypto
Copy link
Member Author

@bobo-k2

Maybe to make naming more generic. Instead of chunkyAddress name it baseContractAddress and make it array,

Fixed in this commit.

partsAddress is not needed since this address can be fetched from base contract.

We still need this value for now for this line. Let's take a look again once this issue has been resolved.

@impelcrypto impelcrypto merged commit d5c01ee into feat/fetch-from-chain Mar 6, 2023
@impelcrypto impelcrypto deleted the feat/parent-page branch March 6, 2023 11:37
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

Successfully merging this pull request may close these issues.

2 participants