Skip to content

Commit

Permalink
feat: XDC support (#1599)
Browse files Browse the repository at this point in the history
* feat: XDC support

* deps: update @guildxyz/types

* temp: exclude verax from requirement type
  • Loading branch information
TomiOhl authored Feb 7, 2025
1 parent 8edcf7e commit 29676ad
Show file tree
Hide file tree
Showing 8 changed files with 801 additions and 5 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"@emotion/styled": "^11.11.0",
"@fuels/connectors": "^0.36.0",
"@fuels/react": "^0.36.0",
"@guildxyz/types": "^1.10.40",
"@guildxyz/types": "^1.10.42",
"@hcaptcha/react-hcaptcha": "^1.4.4",
"@hookform/resolvers": "^3.3.4",
"@lexical/code": "^0.12.0",
Expand Down
777 changes: 777 additions & 0 deletions public/networkLogos/xdc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/components/[guild]/collect/hooks/useGuildFee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const chainsWithOverrides = [
"SONIC",
"ZERO",
"MANTLE",
"XDC",
]

const useGuildFee = (
Expand Down
3 changes: 3 additions & 0 deletions src/hooks/useTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ const TokenApiURLs: Record<Chain, string[]> = {
SONIC: ["https://tokens.coingecko.com/sonic/all.json"],
SOPHON: [],
ZERO: [],
XDC: [
"https://raw.githubusercontent.com/XSwapProtocol/xdc-token-list/refs/heads/master/mainnet.tokenlist.json",
],
}

const fetchTokens = async ([_, chain]) =>
Expand Down
2 changes: 2 additions & 0 deletions src/requirements/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { Requirement } from "types"

export type RequirementType = Exclude<
Schemas["Requirement"]["type"],
| "VERAX_ATTEST"
| "VERAX_ATTESTED_BY"
| "JUMPER_LEVEL"
| "JUMPER_TYPE"
| "JUMPER_TRAITS"
Expand Down
10 changes: 10 additions & 0 deletions src/wagmiConfig/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ import {
taiko,
worldchain,
x1Testnet,
xdc,
zetachain,
zetachainAthensTestnet,
zkSync,
Expand Down Expand Up @@ -778,6 +779,14 @@ const CHAIN_CONFIG: Record<Chain, GuildChain> = {
dark: "/networkLogos/zero.svg",
},
},
XDC: {
...generateChainConfig(xdc, "/networkLogos/xdc.svg"),
iconUrl: "/networkLogos/xdc.svg",
blockExplorerIconUrl: {
light: "/networkLogos/xdc.svg",
dark: "/networkLogos/xdc.svg",
},
},
}

enum Chains {
Expand Down Expand Up @@ -855,6 +864,7 @@ enum Chains {
SONIC = sonic.id,
SOPHON = sophon.id,
ZERO = zero.id,
XDC = xdc.id,
}

export type Chain = keyof typeof Chains
Expand Down
3 changes: 3 additions & 0 deletions src/wagmiConfig/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ import {
taiko,
worldchain,
x1Testnet,
xdc,
zetachain,
zetachainAthensTestnet,
zkSync,
Expand Down Expand Up @@ -204,6 +205,7 @@ export const wagmiConfig = IS_TEST
sonic,
sophon,
zero,
xdc,
],
transports: {
[mainnet.id]: http(),
Expand Down Expand Up @@ -276,6 +278,7 @@ export const wagmiConfig = IS_TEST
[sonic.id]: http(),
[sophon.id]: http(),
[zero.id]: http(),
[xdc.id]: http(),
},
ssr: true,
connectors: [
Expand Down

0 comments on commit 29676ad

Please sign in to comment.