Skip to content

Commit dc70b2f

Browse files
chore: add arbitrum chains (#1133)
1 parent 002969c commit dc70b2f

File tree

7 files changed

+120
-202
lines changed

7 files changed

+120
-202
lines changed

package-lock.json

Lines changed: 78 additions & 194 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"dependencies": {
4747
"@apollo/client": "^3.8.1",
4848
"@bosonprotocol/chat-sdk": "^1.3.1-alpha.9",
49-
"@bosonprotocol/react-kit": "^0.39.0-alpha.4",
49+
"@bosonprotocol/react-kit": "^0.39.1-alpha.1",
5050
"@davatar/react": "^1.10.4",
5151
"@ethersproject/address": "^5.6.1",
5252
"@ethersproject/units": "^5.7.0",

src/lib/constants/chainInfo.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,21 @@ const CHAIN_INFO: ChainInfoMap = {
202202
decimals: 18
203203
}
204204
},
205+
[ChainId.ARBITRUM_SEPOLIA]: {
206+
networkType: NetworkType.L2,
207+
blockWaitMsBeforeWarning: ms(`10m`),
208+
bridge: "https://testnets.superbridge.app/arbitrum-sepolia",
209+
docs: "https://docs.arbitrum.io",
210+
explorer: "https://sepolia.arbiscan.io/",
211+
infoLink: "https://info.uniswap.org/#/arbitrum-sepolia/",
212+
label: "Arbitrum Sepolia",
213+
logoUrl: arbitrumLogoUrl,
214+
circleLogoUrl: arbitrumCircleLogoUrl,
215+
defaultListUrl: ARBITRUM_LIST,
216+
helpCenterUrl:
217+
"https://help.uniswap.org/en/collections/3137787-uniswap-on-arbitrum",
218+
nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 }
219+
},
205220
[ChainId.POLYGON]: {
206221
networkType: NetworkType.L1,
207222
blockWaitMsBeforeWarning: ms(`10m`),

src/lib/constants/chains.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export const CHAIN_IDS_TO_FRIENDLY_NAMES = {
4747
[ChainId.CELO_ALFAJORES]: "Celo Alfajores",
4848
[ChainId.ARBITRUM_ONE]: "Arbitrum",
4949
[ChainId.ARBITRUM_GOERLI]: "Arbitrum Goerli",
50+
[ChainId.ARBITRUM_SEPOLIA]: "Arbitrum Sepolia",
5051
[ChainId.OPTIMISM]: "Optimism",
5152
[ChainId.OPTIMISM_GOERLI]: "Optimism Goerli",
5253
[ChainId.OPTIMISM_SEPOLIA]: "OP-Sepolia",
@@ -67,7 +68,9 @@ const SUPPORTED_CHAINS = [
6768
ChainId.SEPOLIA,
6869
ChainId_POLYGON_AMOY,
6970
ChainId_BASE_SEPOLIA,
70-
ChainId.OPTIMISM_SEPOLIA
71+
ChainId.OPTIMISM_SEPOLIA,
72+
ChainId.ARBITRUM_ONE,
73+
ChainId.ARBITRUM_SEPOLIA
7174
] as const;
7275
export declare type SupportedChainsType = (typeof SUPPORTED_CHAINS)[number];
7376

@@ -110,7 +113,7 @@ export const SUPPORTED_GAS_ESTIMATE_CHAIN_IDS = [
110113
ChainId.POLYGON,
111114
// ChainId.CELO,
112115
ChainId.OPTIMISM,
113-
// ChainId.ARBITRUM_ONE
116+
ChainId.ARBITRUM_ONE,
114117
// ChainId.BNB,
115118
// ChainId.AVALANCHE,
116119
ChainId.BASE
@@ -123,6 +126,7 @@ export const TESTNET_CHAIN_IDS = [
123126
ChainId_POLYGON_AMOY,
124127
ChainId_BASE_SEPOLIA,
125128
ChainId.OPTIMISM_SEPOLIA,
129+
ChainId.ARBITRUM_SEPOLIA,
126130
LocalChainId
127131
// ChainId.ARBITRUM_GOERLI,
128132
// ChainId.OPTIMISM_GOERLI,
@@ -154,7 +158,8 @@ export type SupportedL1ChainId = (typeof L1_CHAIN_IDS)[number];
154158
* The expectation is that all of these networks have immediate transaction confirmation.
155159
*/
156160
export const L2_CHAIN_IDS = [
157-
// ChainId.ARBITRUM_ONE,
161+
ChainId.ARBITRUM_ONE,
162+
ChainId.ARBITRUM_SEPOLIA,
158163
// ChainId.ARBITRUM_GOERLI,
159164
ChainId.OPTIMISM,
160165
ChainId.OPTIMISM_SEPOLIA,
@@ -182,9 +187,10 @@ export function getChainPriority(chainId: number): number {
182187
case ChainId.BASE:
183188
case ChainId_BASE_SEPOLIA:
184189
return 1;
185-
// case ChainId.ARBITRUM_ONE:
186-
// case ChainId.ARBITRUM_GOERLI:
187-
// return 2;
190+
case ChainId.ARBITRUM_ONE:
191+
case ChainId.ARBITRUM_SEPOLIA:
192+
// case ChainId.ARBITRUM_GOERLI:
193+
return 2;
188194
case ChainId.OPTIMISM:
189195
case ChainId.OPTIMISM_SEPOLIA:
190196
return 3;

src/lib/constants/providers.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,10 @@ export const RPC_PROVIDERS: {
7575
[ChainId.SEPOLIA]: new AppJsonRpcProvider(ChainId.SEPOLIA),
7676
[ChainId.OPTIMISM]: new AppJsonRpcProvider(ChainId.OPTIMISM),
7777
[ChainId.POLYGON]: new AppJsonRpcProvider(ChainId.POLYGON),
78+
[ChainId.ARBITRUM_ONE]: new AppJsonRpcProvider(ChainId.ARBITRUM_ONE),
7879
[ChainId_POLYGON_AMOY]: new AppJsonRpcProvider(ChainId_POLYGON_AMOY),
7980
[ChainId.BASE]: new AppJsonRpcProvider(ChainId.BASE),
8081
[ChainId_BASE_SEPOLIA]: new AppJsonRpcProvider(ChainId_BASE_SEPOLIA),
81-
[ChainId.OPTIMISM_SEPOLIA]: new AppJsonRpcProvider(ChainId.OPTIMISM_SEPOLIA)
82+
[ChainId.OPTIMISM_SEPOLIA]: new AppJsonRpcProvider(ChainId.OPTIMISM_SEPOLIA),
83+
[ChainId.ARBITRUM_SEPOLIA]: new AppJsonRpcProvider(ChainId.ARBITRUM_SEPOLIA)
8284
};

src/lib/constants/routing.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ export const COMMON_BASES: ChainCurrencyList = {
9595
WRAPPED_NATIVE_CURRENCY[ChainId.ARBITRUM_GOERLI] as Token,
9696
USDC_ARBITRUM_GOERLI
9797
],
98+
[ChainId.ARBITRUM_SEPOLIA]: [
99+
nativeOnChain(ChainId.ARBITRUM_SEPOLIA),
100+
WRAPPED_NATIVE_CURRENCY[ChainId.ARBITRUM_SEPOLIA] as Token
101+
],
98102
[ChainId.OPTIMISM]: [
99103
nativeOnChain(ChainId.OPTIMISM),
100104
OP,

src/lib/constants/tokens.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,13 @@ export const WRAPPED_NATIVE_CURRENCY: { [chainId: number]: Token | undefined } =
418418
"WETH",
419419
"Wrapped Ether"
420420
),
421+
[ChainId.ARBITRUM_SEPOLIA]: new Token(
422+
ChainId.ARBITRUM_SEPOLIA,
423+
"0x980B62Da83eFf3D4576C647993b0c1D7faf17c73",
424+
18,
425+
"WETH",
426+
"Wrapped Ether"
427+
),
421428
[ChainId.SEPOLIA]: new Token(
422429
ChainId.SEPOLIA,
423430
"0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14",

0 commit comments

Comments
 (0)