Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/friendly-suns-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@thirdweb-dev/sdk": patch
---

Improve fetchPublishedContractFromPolygon
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,18 @@ export async function fetchPublishedContractFromPolygon(
});

// get the metadata for each version
const versionMetadata = await Promise.all(
allVersions.map(async (c) => {
return {
name: c.id,
publishedTimestamp: c.timestamp,
publishedMetadata: await fetchAndCacheDeployMetadata(
c.metadataUri,
storage,
),
};
}),
);
const versionMetadata = (
await Promise.all(
allVersions.map((c) =>
fetchAndCacheDeployMetadata(c.metadataUri, storage),
),
)
).map((item, index) => ({
name: allVersions[index].id,
publishedTimestamp: allVersions[index].timestamp,
publishedMetadata: item,
}));

// find the version that matches the version string
const versionMatch = versionMetadata.find(
(metadata) =>
Expand Down