-
Notifications
You must be signed in to change notification settings - Fork 57
feat: batch fetch substates api #1547
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
Changes from 37 commits
259140e
a113185
424f38c
3402246
d40784c
9d14ac2
c70d084
32bae7c
6c10300
60ad255
9adfbc6
8b65616
5d0bfbe
8bbdcd4
3f6eb9f
0ad9823
0ab232a
3e34430
17a88b5
a96e257
5e84834
d25c9a7
d2a77f8
0935711
98ca256
9b0c541
5101a4d
928f0da
6dae149
03926c4
78c712d
12d26c6
ab67002
0e9ef5a
5fbc61b
fa5f556
1ebd3de
f6d8455
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -86,13 +86,14 @@ function Resources() { | |||||||||||||||
| } | ||||||||||||||||
| if (nftData) { | ||||||||||||||||
| console.log(nftData); | ||||||||||||||||
| let { image_url, name } = nftData; | ||||||||||||||||
| const nftSubstateId = { NonFungible: nft.address }; | ||||||||||||||||
| let address = substateIdToString(nftSubstateId).split("_", 4); | ||||||||||||||||
| const { image_url, name } = nftData; | ||||||||||||||||
| const nftId = nft.address.id; | ||||||||||||||||
| const key = Object.keys(nftId)[0]; | ||||||||||||||||
| const address = `${key}_${nftId[key as keyof typeof nftId]}`; | ||||||||||||||||
| nfts.push({ | ||||||||||||||||
|
Comment on lines
+90
to
93
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use canonical address formatter; avoid Object.keys-based derivation Relying on the “first key” of - const { image_url, name } = nftData;
- const nftId = nft.address.id;
- const key = Object.keys(nftId)[0];
- const address = `${key}_${nftId[key as keyof typeof nftId]}`;
+ const { image_url, name } = nftData;
+ const address = substateIdToString(nft.address);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||
| img: image_url, | ||||||||||||||||
| title: name, | ||||||||||||||||
| address: `${address[2]}_${address[3]}`, | ||||||||||||||||
| address, | ||||||||||||||||
| version: nft.version, | ||||||||||||||||
| }); | ||||||||||||||||
| } | ||||||||||||||||
|
|
@@ -125,9 +126,9 @@ function Resources() { | |||||||||||||||
|
|
||||||||||||||||
| {nfts.length > 0 && ( | ||||||||||||||||
| <ImageList cols={4} gap={8}> | ||||||||||||||||
| {nfts.map((item) => | ||||||||||||||||
| {nfts.map((item, i) => | ||||||||||||||||
| item.img ? ( | ||||||||||||||||
| <ImageListItem key={item.address}> | ||||||||||||||||
| <ImageListItem key={i}> | ||||||||||||||||
| <img | ||||||||||||||||
| src={`${item.img}?size=248&fit=fill&auto=format`} | ||||||||||||||||
| srcSet={`${item.img}?size=248&fit=fill&auto=format&dpr=2 4x`} | ||||||||||||||||
|
|
@@ -145,7 +146,7 @@ function Resources() { | |||||||||||||||
| /> | ||||||||||||||||
| </ImageListItem> | ||||||||||||||||
| ) : ( | ||||||||||||||||
| <ImageListItem key={item.address}> | ||||||||||||||||
| <ImageListItem key={i}> | ||||||||||||||||
| <ImageListItemBar | ||||||||||||||||
| title={item.title} | ||||||||||||||||
| subtitle={ | ||||||||||||||||
|
|
@@ -156,7 +157,7 @@ function Resources() { | |||||||||||||||
| position="below" | ||||||||||||||||
| /> | ||||||||||||||||
| </ImageListItem> | ||||||||||||||||
| ) | ||||||||||||||||
| ), | ||||||||||||||||
| )} | ||||||||||||||||
| </ImageList> | ||||||||||||||||
| )} | ||||||||||||||||
|
|
||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.