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/lovely-items-live.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"thirdweb": patch
---

Fixes Brave Wallet Metadata
21 changes: 17 additions & 4 deletions packages/thirdweb/scripts/wallets/generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,22 @@ import { join } from "node:path";
import { format } from "prettier";
import sharp from "sharp";

const walletConnectWalletsJson = await fetch(
const walletConnectWallets = await fetch(
"https://explorer-api.walletconnect.com/w3m/v1/getAllListings?projectId=145769e410f16970a79ff77b2d89a1e0",
).then((res) => res.json());
).then(async (res) => {
const wallets: { listings: Record<string, Wallet> } = await res.json();

// Remove duplicated wallets by wallet RDNS
const filteredWallets: Wallet[] = [];
for (const _w of Object.values(wallets.listings)) {
if (_w.rdns && filteredWallets.find((w) => w.rdns === _w.rdns)) {
continue;
}
filteredWallets.push(_w);
}

return filteredWallets;
});

const extraWalletsJson = JSON.parse(
await readFile(join(__dirname, "./extra-wallets.json"), "utf-8"),
Expand Down Expand Up @@ -61,10 +74,10 @@ type Wallet = {
};
};

const allWalletsArray = Object.values(walletConnectWalletsJson.listings)
const allWalletsArray = Object.values(walletConnectWallets)
.map((w) => ({ ...(w as Omit<Wallet, "type">), _type: "wc" }))
.concat(
extraWalletsJson.map((w) => ({
extraWalletsJson.map((w: Wallet) => ({
...(w as Omit<Wallet, "type">),
_type: "extra",
})),
Expand Down
92 changes: 67 additions & 25 deletions packages/thirdweb/src/wallets/__generated__/getWalletInfo.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 9 additions & 6 deletions packages/thirdweb/src/wallets/__generated__/wallet-ids.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 45 additions & 15 deletions packages/thirdweb/src/wallets/__generated__/wallet-infos.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading