Skip to content

Commit

Permalink
feat: Form, Ink support (#1584)
Browse files Browse the repository at this point in the history
* feat: Form, Ink support

* revert: changes to pre-commit
:cannot_be_undone:

* revert: even more changes to pre-commit
:cannot_be_undone: x2

* Fix ink icon
  • Loading branch information
TomiOhl authored Dec 16, 2024
1 parent 7a90943 commit 9db0898
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 17 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.29",
"@guildxyz/types": "^1.10.31",
"@hcaptcha/react-hcaptcha": "^1.4.4",
"@hookform/resolvers": "^3.3.4",
"@lexical/code": "^0.12.0",
Expand Down
3 changes: 3 additions & 0 deletions public/networkLogos/ink.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/hooks/useTokens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const TokenApiURLs: Record<Chain, string[]> = {
CORE_DAO: [],
LISK_SEPOLIA: [],
OP_BNB: [],
FORM_TESTNET: [],
FORM: [],
CYBER: [],
TAIKO: [],
KLAYTN: [],
Expand All @@ -93,6 +93,7 @@ const TokenApiURLs: Record<Chain, string[]> = {
CRONOS_ZKEVM: [],
WORLD_CHAIN: [],
INK_SEPOLIA: [],
INK: [],
}

const fetchTokens = async ([_, chain]) =>
Expand Down
34 changes: 30 additions & 4 deletions src/static/customChains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,8 @@ export const x1 = {
},
} as const satisfies Chain

export const formTestnet = {
id: 132902,
export const form = {
id: 478,
name: "Form",
nativeCurrency: {
decimals: 18,
Expand All @@ -344,8 +344,8 @@ export const formTestnet = {
},
contracts: {
multicall3: {
address: "0xf2429187a6e6f2f7980dde17a856bd22e211d2a2",
blockCreated: 1118269,
address: "0xca11bde05977b3631167028862be2a173976ca11",
blockCreated: 342734,
},
},
testnet: true,
Expand Down Expand Up @@ -428,3 +428,29 @@ export const inkSepolia = {
},
testnet: false,
} as const satisfies Chain

export const ink = {
id: 57073,
name: "Ink",
nativeCurrency: {
decimals: 18,
name: "Ether",
symbol: "ETH",
},
rpcUrls: {
default: { http: ["https://rpc-gel.inkonchain.com"] },
},
blockExplorers: {
default: {
name: "Blockscout",
url: "https://explorer.inkonchain.com",
},
},
contracts: {
multicall3: {
address: "0xca11bde05977b3631167028862be2a173976ca11",
blockCreated: 595972,
},
},
testnet: false,
} as const satisfies Chain
18 changes: 14 additions & 4 deletions src/wagmiConfig/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {
bitfinityTestnet,
bobaAvax,
exosama,
formTestnet,
form,
ink,
inkSepolia,
metisSepolia,
mint,
Expand Down Expand Up @@ -626,8 +627,8 @@ const CHAIN_CONFIG: Record<Chain, GuildChain> = {
dark: "/explorerLogos/opbnb.png",
},
},
FORM_TESTNET: {
...generateChainConfig(formTestnet, ETH_ICON),
FORM: {
...generateChainConfig(form, ETH_ICON),
iconUrl: "/networkLogos/form.svg",
blockExplorerIconUrl: {
light: "/networkLogos/form.svg",
Expand Down Expand Up @@ -733,6 +734,14 @@ const CHAIN_CONFIG: Record<Chain, GuildChain> = {
dark: "/networkLogos/inkSepolia.png",
},
},
INK: {
...generateChainConfig(ink, ETH_ICON),
iconUrl: "/networkLogos/ink.svg",
blockExplorerIconUrl: {
light: "/networkLogos/ink.svg",
dark: "/networkLogos/ink.svg",
},
},
}

enum Chains {
Expand Down Expand Up @@ -792,7 +801,7 @@ enum Chains {
CORE_DAO = coreDao.id,
LISK_SEPOLIA = liskSepolia.id,
OP_BNB = opBNB.id,
FORM_TESTNET = formTestnet.id,
FORM = form.id,
CYBER = cyber.id,
TAIKO = taiko.id,
KLAYTN = klaytn.id,
Expand All @@ -805,6 +814,7 @@ enum Chains {
CRONOS_ZKEVM = cronoszkEVM.id,
WORLD_CHAIN = worldchain.id,
INK_SEPOLIA = inkSepolia.id,
INK = ink.id,
}

export type Chain = keyof typeof Chains
Expand Down
9 changes: 6 additions & 3 deletions src/wagmiConfig/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {
beraTestnet,
bitfinityTestnet,
exosama,
formTestnet,
form,
ink,
inkSepolia,
metisSepolia,
mint,
Expand Down Expand Up @@ -181,7 +182,7 @@ export const wagmiConfig = IS_TEST
coreDao,
liskSepolia as Chain,
opBNB,
formTestnet,
form,
cyber,
taiko,
klaytn,
Expand All @@ -194,6 +195,7 @@ export const wagmiConfig = IS_TEST
cronoszkEVM,
worldchain,
inkSepolia,
ink,
],
transports: {
[mainnet.id]: http(),
Expand Down Expand Up @@ -248,7 +250,7 @@ export const wagmiConfig = IS_TEST
[coreDao.id]: http(),
[liskSepolia.id]: http(),
[opBNB.id]: http(),
[formTestnet.id]: http(),
[form.id]: http(),
[cyber.id]: http(),
[taiko.id]: http(),
[klaytn.id]: http(),
Expand All @@ -261,6 +263,7 @@ export const wagmiConfig = IS_TEST
[cronoszkEVM.id]: http(),
[worldchain.id]: http(),
[inkSepolia.id]: http(),
[ink.id]: http(),
},
ssr: true,
connectors: [
Expand Down

0 comments on commit 9db0898

Please sign in to comment.