Skip to content
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

feat: add form mainnet #519

Merged
merged 1 commit into from
Dec 11, 2024
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/bright-cheetahs-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@roll-network/web3': major
---

Added form mainnet
22 changes: 11 additions & 11 deletions examples/example-web-oauth-client/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,66 +32,66 @@
/* V1 */
@font-face {
src: local('OpenSans-Regular'),
url('@roll-network/design-system/dist/fonts/OpenSans-Regular.tts');
url('@roll-network/design-system/dist/fonts/OpenSans-Regular.ttf');
font-family: 'OpenSans-Regular';
}

@font-face {
src: local('OpenSans-Bold'),
url('@roll-network/design-system/dist/fonts/OpenSans-Bold.tts');
url('@roll-network/design-system/dist/fonts/OpenSans-Bold.ttf');
font-family: 'OpenSans-Bold';
}

@font-face {
src: local('OpenSans-BoldItalic'),
url('@roll-network/design-system/dist/fonts/OpenSans-BoldItalic.tts');
url('@roll-network/design-system/dist/fonts/OpenSans-BoldItalic.ttf');
font-family: 'OpenSans-BoldItalic';
}

@font-face {
src: local('OpenSans-ExtraBold'),
url('@roll-network/design-system/dist/fonts/OpenSans-ExtraBold.tts');
url('@roll-network/design-system/dist/fonts/OpenSans-ExtraBold.ttf');
font-family: 'OpenSans-ExtraBold';
}

@font-face {
src: local('OpenSans-ExtraBoldItalic'),
url('@roll-network/design-system/dist/fonts/OpenSans-ExtraBoldItalic.tts');
url('@roll-network/design-system/dist/fonts/OpenSans-ExtraBoldItalic.ttf');
font-family: 'OpenSans-ExtraBoldItalic';
}

@font-face {
src: local('OpenSans-Italic'),
url('@roll-network/design-system/dist/fonts/OpenSans-Italic.tts');
url('@roll-network/design-system/dist/fonts/OpenSans-Italic.ttf');
font-family: 'OpenSans-Italic';
}

@font-face {
src: local('OpenSans-Light'),
url('@roll-network/design-system/dist/fonts/OpenSans-Light.tts');
url('@roll-network/design-system/dist/fonts/OpenSans-Light.ttf');
font-family: 'OpenSans-Light';
}

@font-face {
src: local('OpenSans-LightItalic'),
url('@roll-network/design-system/dist/fonts/OpenSans-LightItalic.tts');
url('@roll-network/design-system/dist/fonts/OpenSans-LightItalic.ttf');
font-family: 'OpenSans-LightItalic';
}

@font-face {
src: local('OpenSans-SemiBold'),
url('@roll-network/design-system/dist/fonts/OpenSans-SemiBold.tts');
url('@roll-network/design-system/dist/fonts/OpenSans-SemiBold.ttf');
font-family: 'OpenSans-SemiBold';
}

@font-face {
src: local('OpenSans-SemiBoldItalic'),
url('@roll-network/design-system/dist/fonts/OpenSans-SemiBoldItalic.tts');
url('@roll-network/design-system/dist/fonts/OpenSans-SemiBoldItalic.ttf');
font-family: 'OpenSans-SemiBoldItalic';
}

@font-face {
src: local('SourceCodePro-Regular'),
url('@roll-network/design-system/dist/fonts/SourceCodePro-Regular.tts');
url('@roll-network/design-system/dist/fonts/SourceCodePro-Regular.ttf');
font-family: 'SourceCodePro-Regular';
}
22 changes: 11 additions & 11 deletions examples/example-web3-client/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -32,66 +32,66 @@
/* V1 */
@font-face {
src: local('OpenSans-Regular'),
url('@roll-network/design-system/dist/fonts/OpenSans-Regular.tts');
url('@roll-network/design-system/dist/fonts/OpenSans-Regular.ttf');
font-family: 'OpenSans-Regular';
}

@font-face {
src: local('OpenSans-Bold'),
url('@roll-network/design-system/dist/fonts/OpenSans-Bold.tts');
url('@roll-network/design-system/dist/fonts/OpenSans-Bold.ttf');
font-family: 'OpenSans-Bold';
}

@font-face {
src: local('OpenSans-BoldItalic'),
url('@roll-network/design-system/dist/fonts/OpenSans-BoldItalic.tts');
url('@roll-network/design-system/dist/fonts/OpenSans-BoldItalic.ttf');
font-family: 'OpenSans-BoldItalic';
}

@font-face {
src: local('OpenSans-ExtraBold'),
url('@roll-network/design-system/dist/fonts/OpenSans-ExtraBold.tts');
url('@roll-network/design-system/dist/fonts/OpenSans-ExtraBold.ttf');
font-family: 'OpenSans-ExtraBold';
}

@font-face {
src: local('OpenSans-ExtraBoldItalic'),
url('@roll-network/design-system/dist/fonts/OpenSans-ExtraBoldItalic.tts');
url('@roll-network/design-system/dist/fonts/OpenSans-ExtraBoldItalic.ttf');
font-family: 'OpenSans-ExtraBoldItalic';
}

@font-face {
src: local('OpenSans-Italic'),
url('@roll-network/design-system/dist/fonts/OpenSans-Italic.tts');
url('@roll-network/design-system/dist/fonts/OpenSans-Italic.ttf');
font-family: 'OpenSans-Italic';
}

@font-face {
src: local('OpenSans-Light'),
url('@roll-network/design-system/dist/fonts/OpenSans-Light.tts');
url('@roll-network/design-system/dist/fonts/OpenSans-Light.ttf');
font-family: 'OpenSans-Light';
}

@font-face {
src: local('OpenSans-LightItalic'),
url('@roll-network/design-system/dist/fonts/OpenSans-LightItalic.tts');
url('@roll-network/design-system/dist/fonts/OpenSans-LightItalic.ttf');
font-family: 'OpenSans-LightItalic';
}

@font-face {
src: local('OpenSans-SemiBold'),
url('@roll-network/design-system/dist/fonts/OpenSans-SemiBold.tts');
url('@roll-network/design-system/dist/fonts/OpenSans-SemiBold.ttf');
font-family: 'OpenSans-SemiBold';
}

@font-face {
src: local('OpenSans-SemiBoldItalic'),
url('@roll-network/design-system/dist/fonts/OpenSans-SemiBoldItalic.tts');
url('@roll-network/design-system/dist/fonts/OpenSans-SemiBoldItalic.ttf');
font-family: 'OpenSans-SemiBoldItalic';
}

@font-face {
src: local('SourceCodePro-Regular'),
url('@roll-network/design-system/dist/fonts/SourceCodePro-Regular.tts');
url('@roll-network/design-system/dist/fonts/SourceCodePro-Regular.ttf');
font-family: 'SourceCodePro-Regular';
}
2 changes: 2 additions & 0 deletions packages/web3/src/connectors/connectors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const CHAIN_ID_GOERLI = 5
export const CHAIN_ID_MUMBAI = 80001
export const CHAIN_ID_HARDHAT = 31337
export const CHAIN_ID_FORM_TESTNET = 132902
export const CHAIN_ID_FORM = 478
export const CHAIN_ID_SEPOLIA = 11155111

export const SUPPORTED_CHAIN_IDS = [
Expand All @@ -19,6 +20,7 @@ export const SUPPORTED_CHAIN_IDS = [
CHAIN_ID_MUMBAI,
CHAIN_ID_HARDHAT,
CHAIN_ID_FORM_TESTNET,
CHAIN_ID_FORM,
]

export class Web3Connectors {
Expand Down
36 changes: 32 additions & 4 deletions packages/web3/src/providers/web3ProviderWagmi/chains.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Chain } from 'wagmi'
import { CHAIN_ID_FORM_TESTNET } from '../../connectors'

const rpcUrl = 'https://testnet-rpc.form.network/http'
const explorerUrl = 'https://testnet-explorer.form.network/'
const testnetRpcUrl = 'https://sepolia-rpc.form.network/http'
const testnetExplorerUrl = 'https://sepolia-explorer.form.network/'

export const formTestnet = {
id: CHAIN_ID_FORM_TESTNET,
Expand All @@ -13,17 +13,45 @@ export const formTestnet = {
name: 'Ethereum',
symbol: 'ETH',
},
rpcUrls: {
public: { http: [testnetRpcUrl] },
default: { http: [testnetRpcUrl] },
},
blockExplorers: {
etherscan: {
name: 'FormTestnetExplorer',
url: testnetExplorerUrl,
},
default: {
name: 'FormTestnetExplorer',
url: testnetExplorerUrl,
},
},
} as const satisfies Chain

const rpcUrl = 'https://rpc.form.network/http'
const explorerUrl = 'https://explorer.form.network/'

export const form = {
id: 478,
name: 'Form',
network: 'form',
nativeCurrency: {
decimals: 18,
name: 'Ethereum',
symbol: 'ETH',
},
rpcUrls: {
public: { http: [rpcUrl] },
default: { http: [rpcUrl] },
},
blockExplorers: {
etherscan: {
name: 'FormTestnetExplorer',
name: 'FormExplorer',
url: explorerUrl,
},
default: {
name: 'FormTestnetExplorer',
name: 'FormExplorer',
url: explorerUrl,
},
},
Expand Down
13 changes: 11 additions & 2 deletions packages/web3/src/providers/web3ProviderWagmi/utils.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
import { Chain } from 'wagmi'
import { sepolia, hardhat, polygon, polygonMumbai, goerli, mainnet } from 'wagmi/chains'
import {
sepolia,
hardhat,
polygon,
polygonMumbai,
goerli,
mainnet,
} from 'wagmi/chains'
import {
CHAIN_ID_FORM_TESTNET,
CHAIN_ID_FORM,
CHAIN_ID_GOERLI,
CHAIN_ID_HARDHAT,
CHAIN_ID_MAIN_NET,
CHAIN_ID_MUMBAI,
CHAIN_ID_POLYGON,
CHAIN_ID_SEPOLIA,
} from '../../connectors'
import { formTestnet } from './chains'
import { form, formTestnet } from './chains'

const MAP_CHAINS: Record<number, Chain> = {
[CHAIN_ID_MAIN_NET]: mainnet,
Expand All @@ -19,6 +27,7 @@ const MAP_CHAINS: Record<number, Chain> = {
[CHAIN_ID_HARDHAT]: hardhat,
[CHAIN_ID_MUMBAI]: polygonMumbai,
[CHAIN_ID_FORM_TESTNET]: formTestnet,
[CHAIN_ID_FORM]: form,
}

export const getChainsById = (chains: number[]) => {
Expand Down
Loading