Skip to content

Commit

Permalink
feat: add sepolia testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
solidovic committed Jul 30, 2024
1 parent 781a472 commit 0d74355
Show file tree
Hide file tree
Showing 14 changed files with 90 additions and 38 deletions.
5 changes: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ RESEARCH_ORIGIN=https://research.lido.fi
# EL_RPC_URLS_{CHAIN_ID} list or URLs delimeted by commas, first entry is primary, else are fallbacks
EL_RPC_URLS_1=
EL_RPC_URLS_17000=
EL_RPC_URLS_11155111=

# IPFS prefill RPC URLs - list of URLs delimited by commas
PREFILL_UNSAFE_EL_RPC_URLS_1=
PREFILL_UNSAFE_EL_RPC_URLS_17000=
PREFILL_UNSAFE_EL_RPC_URLS_11155111=

# supported networks for connecting wallet
SUPPORTED_CHAINS=1,17000
SUPPORTED_CHAINS=1,17000,11155111

# this chain uses when a wallet is not connected
DEFAULT_CHAIN=1
Expand All @@ -35,6 +37,7 @@ CSP_REPORT_URI=https://stake.lido.fi/api/csp-report
# Subgraph endpoint
SUBGRAPH_MAINNET=https://gateway-arbitrum.network.thegraph.com/api/[api-key]/subgraphs/id/Sxx812XgeKyzQPaBpR5YZWmGV5fZuBaPdh7DFhzSwiQ
SUBGRAPH_HOLESKY=
SUBGRAPH_SEPOLIA=

SUBGRAPH_REQUEST_TIMEOUT=5000

Expand Down
3 changes: 3 additions & 0 deletions config/get-secret-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export type SecretConfigType = Modify<

rpcUrls_1: [string, ...string[]];
rpcUrls_17000: [string, ...string[]];
rpcUrls_11155111: [string, ...string[]];

cspReportOnly: boolean;

Expand Down Expand Up @@ -41,6 +42,8 @@ export const getSecretConfig = (): SecretConfigType => {
string,
...string[],
],
rpcUrls_11155111: (serverRuntimeConfig.rpcUrls_11155111?.split(',') ??
[]) as [string, ...string[]],

cspReportOnly: toBoolean(serverRuntimeConfig.cspReportOnly),

Expand Down
1 change: 1 addition & 0 deletions config/user-config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export type UserConfigDefaultType = {
prefillUnsafeElRpcUrls: {
[CHAINS.Mainnet]: string[];
[CHAINS.Holesky]: string[];
[CHAINS.Sepolia]: string[];
};
walletconnectProjectId: string | undefined;
};
1 change: 1 addition & 0 deletions config/user-config/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export const getUserConfigDefault = (): UserConfigDefaultType => {
prefillUnsafeElRpcUrls: {
[CHAINS.Mainnet]: config.prefillUnsafeElRpcUrls1,
[CHAINS.Holesky]: config.prefillUnsafeElRpcUrls17000,
[CHAINS.Sepolia]: config.prefillUnsafeElRpcUrls11155111,
},
walletconnectProjectId: config.walletconnectProjectId,
};
Expand Down
1 change: 1 addition & 0 deletions consts/chains.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export enum CHAINS {
Mainnet = 1,
Holesky = 17000,
Sepolia = 11155111,
}

export enum L2_CHAINS {
Expand Down
1 change: 1 addition & 0 deletions consts/staking-router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const STAKING_ROUTER_BY_NETWORK: {
} = {
[CHAINS.Mainnet]: '0xFdDf38947aFB03C621C71b06C9C70bce73f12999',
[CHAINS.Holesky]: '0xd6EbF043D30A7fe46D1Db32BA90a0A51207FE229',
[CHAINS.Sepolia]: '0x4F36aAEb18Ab56A4e380241bea6ebF215b9cb12c',
};

export const getStakingRouterAddress = (chainId: CHAINS): string => {
Expand Down
2 changes: 2 additions & 0 deletions env-dynamics.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ export const supportedChains = process.env?.SUPPORTED_CHAINS?.split(',').map(
export const prefillUnsafeElRpcUrls1 = process.env.PREFILL_UNSAFE_EL_RPC_URLS_1?.split(',') ?? [];
/** @type string[] */
export const prefillUnsafeElRpcUrls17000 = process.env.PREFILL_UNSAFE_EL_RPC_URLS_17000?.split(',') ?? [];
/** @type string[] */
export const prefillUnsafeElRpcUrls11155111 = process.env.PREFILL_UNSAFE_EL_RPC_URLS_11155111?.split(',') ?? [];

/** @type boolean */
export const enableQaHelpers = toBoolean(process.env.ENABLE_QA_HELPERS);
Expand Down
2 changes: 2 additions & 0 deletions global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ declare module 'next/config' {
defaultChain: string;
rpcUrls_1: string | undefined;
rpcUrls_17000: string | undefined;
rpcUrls_11155111: string | undefined;
ethplorerApiKey: string | undefined;

oneInchApiKey: string | undefined;
Expand All @@ -37,6 +38,7 @@ declare module 'next/config' {

subgraphMainnet: string | undefined;
subgraphHolesky: string | undefined;
subgraphSepolia: string | undefined;
subgraphRequestTimeout: string | undefined;

rateLimit: string;
Expand Down
2 changes: 2 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ export default withBundleAnalyzer({
defaultChain: process.env.DEFAULT_CHAIN,
rpcUrls_1: process.env.EL_RPC_URLS_1,
rpcUrls_17000: process.env.EL_RPC_URLS_17000,
rpcUrls_11155111: process.env.EL_RPC_URLS_11155111,
ethplorerApiKey: process.env.ETHPLORER_API_KEY,

oneInchApiKey: process.env.ONE_INCH_API_KEY,
Expand All @@ -155,6 +156,7 @@ export default withBundleAnalyzer({

subgraphMainnet: process.env.SUBGRAPH_MAINNET,
subgraphHolesky: process.env.SUBGRAPH_HOLESKY,
subgraphSepolia: process.env.SUBGRAPH_SEPOLIA,
subgraphRequestTimeout: process.env.SUBGRAPH_REQUEST_TIMEOUT,

rateLimit: process.env.RATE_LIMIT,
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
"@ethersproject/contracts": "^5.7.0",
"@ethersproject/providers": "^5.7.0",
"@ethersproject/units": "^5.7.0",
"@lido-sdk/constants": "^3.2.1",
"@lido-sdk/contracts": "^3.0.4",
"@lido-sdk/fetch": "^2.1.12",
"@lido-sdk/helpers": "^1.5.1",
"@lido-sdk/providers": "^1.4.14",
"@lido-sdk/react": "^2.0.5",
"@lido-sdk/constants": "^3.3.0",
"@lido-sdk/contracts": "^3.0.5",
"@lido-sdk/fetch": "^2.2.0",
"@lido-sdk/helpers": "^1.6.0",
"@lido-sdk/providers": "^1.4.15",
"@lido-sdk/react": "^2.0.6",
"@lidofinance/analytics-matomo": "^0.41.0",
"@lidofinance/api-metrics": "^0.41.0",
"@lidofinance/api-rpc": "^0.41.0",
Expand Down
2 changes: 2 additions & 0 deletions utils/getNFTUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export const NFT_URL_PREFIX_BY_NETWORK: {
`https://etherscan.io/nft/${contract}/${nftId}`,
[CHAINS.Holesky]: (nftId, contract) =>
`https://holesky.etherscan.io/nft/${contract}/${nftId}`,
[CHAINS.Sepolia]: (nftId, contract) =>
`https://sepolia.etherscan.io/nft/${contract}/${nftId}`,
};

export const getNFTUrl = (tokenId: string, chainId?: CHAINS) => {
Expand Down
1 change: 1 addition & 0 deletions utilsApi/getSubgraphUrl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { SubgraphChains } from 'types';
export const SUBGRAPH_URL = {
[CHAINS.Mainnet]: secretConfig.subgraphMainnet,
[CHAINS.Holesky]: secretConfig.subgraphHolesky,
[CHAINS.Sepolia]: secretConfig.subgraphSepolia,
} as const;

export const getSubgraphUrl = (chainId: SubgraphChains): string | undefined => {
Expand Down
1 change: 1 addition & 0 deletions utilsApi/rpcUrls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ import { secretConfig } from 'config';
export const rpcUrls: Record<CHAINS, [string, ...string[]]> = {
[CHAINS.Mainnet]: secretConfig.rpcUrls_1,
[CHAINS.Holesky]: secretConfig.rpcUrls_17000,
[CHAINS.Sepolia]: secretConfig.rpcUrls_11155111,
};
94 changes: 63 additions & 31 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2110,53 +2110,53 @@
bignumber.js "^9.1.2"
rxjs "^7.8.1"

"@lido-sdk/constants@3.2.1", "@lido-sdk/constants@^3.2.1":
version "3.2.1"
resolved "https://registry.yarnpkg.com/@lido-sdk/constants/-/constants-3.2.1.tgz#0c4582d7e76e4f8bc42e8f3c0d14dc0fbe481d77"
integrity sha512-zes0Mw0r1nEQYBNHV5fxK2H9Byowejy4haFy9LYDh1nL72aNJzzdh5S5iM+pKlEuLHQJHV5lVO/k9tunNJIKqQ==
"@lido-sdk/constants@3.3.0", "@lido-sdk/constants@^3.3.0":
version "3.3.0"
resolved "https://registry.yarnpkg.com/@lido-sdk/constants/-/constants-3.3.0.tgz#044b652a000a067b9ee0ae9f58814434779bb108"
integrity sha512-R5XINgj/EQvyBfPF+Zv9B/ycFCqARD8rbWDp3J4luAMDbSUP3ncGw0x7Aj836k96eVnrh+jfd2tz/c99Dm6IaA==
dependencies:
tiny-invariant "^1.1.0"

"@lido-sdk/[email protected].4", "@lido-sdk/contracts@^3.0.4":
version "3.0.4"
resolved "https://registry.yarnpkg.com/@lido-sdk/contracts/-/contracts-3.0.4.tgz#85e3b203aa0a38841ecf22d7ac4e5f8d70848920"
integrity sha512-oW7gyHKcrss77sEPMmYm38M0CQ5+3GGlNewu9D+UJhtxRpLa+Jh3nWEd5tq/hMdMSN9cGoerVKFfBAhw6zKajg==
"@lido-sdk/[email protected].5", "@lido-sdk/contracts@^3.0.5":
version "3.0.5"
resolved "https://registry.yarnpkg.com/@lido-sdk/contracts/-/contracts-3.0.5.tgz#9778e83258de241e26bcd5c76589ff010856afbb"
integrity sha512-piu5wKqxs9QS85qG9OrwXfdg5ZCg+xlggj6Q8PMo9qbAk0UzBVuU7CcXUalpKeJpTQMV4SnvcJ0dwZNR2weK8g==
dependencies:
"@lido-sdk/constants" "3.2.1"
"@lido-sdk/constants" "3.3.0"
tiny-invariant "^1.1.0"

"@lido-sdk/fetch@^2.1.12":
version "2.1.12"
resolved "https://registry.yarnpkg.com/@lido-sdk/fetch/-/fetch-2.1.12.tgz#aa0ef16212f4bad7ffed68928143e7cbdab94973"
integrity sha512-kFBrzCVxYnD3Q68cM4KY9E7w/4TAJk1BW2wAcPpJyWm1yQSRL1urhEZ6NGbwkp23QvayVStbNrQiezVOdDnzYw==
"@lido-sdk/fetch@^2.2.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@lido-sdk/fetch/-/fetch-2.2.0.tgz#e0034083edaed471f29163ebfdccc9b10cd58ea7"
integrity sha512-Jwi2W5azP4uuhmsWexkk4al0Y+pMx5PpB74klIBzgX/eoVnK+NOTxLemJa6GDq4KTIlriAM79jscY0TJvJJWQA==
dependencies:
"@lido-sdk/constants" "3.2.1"
"@lido-sdk/constants" "3.3.0"
node-fetch "^2.6.7"
tiny-invariant "^1.1.0"

"@lido-sdk/helpers@1.5.1", "@lido-sdk/helpers@^1.5.1":
version "1.5.1"
resolved "https://registry.yarnpkg.com/@lido-sdk/helpers/-/helpers-1.5.1.tgz#ced13f1df6e34a1d4ad551fde299524dc237b694"
integrity sha512-n8sTliverpxOy7PeTCUyG+bQPIJdg57AOON+6X2tZ19JxU3r6ZhHzo33x/9022aKu0A/Ya7edREDB6MadymdRg==
"@lido-sdk/helpers@1.6.0", "@lido-sdk/helpers@^1.6.0":
version "1.6.0"
resolved "https://registry.yarnpkg.com/@lido-sdk/helpers/-/helpers-1.6.0.tgz#551cde8aa1251b310d4e1f93f7ec12680992c639"
integrity sha512-rg8sV7l3SWebx8tiagaDf+Q1F+UfgZ2FS31NDPzBUtG++QKP+9V1hTOrpwLNsmJhqQ0zbNhm84+ykHbCmEO+Cw==
dependencies:
"@lido-sdk/constants" "3.2.1"
"@lido-sdk/constants" "3.3.0"
tiny-invariant "^1.1.0"

"@lido-sdk/providers@^1.4.14":
version "1.4.14"
resolved "https://registry.yarnpkg.com/@lido-sdk/providers/-/providers-1.4.14.tgz#b7c714aa753d662c0d51f71ee4990b3cb78ce790"
integrity sha512-m422uXuaGoXoUlF8oyFTIQsj8ljVet/x7nK0xF8UoURm/iuaAhTbEXpcxhmkx8JSSDli1928apJRAwxG0McgnQ==
"@lido-sdk/providers@^1.4.15":
version "1.4.15"
resolved "https://registry.yarnpkg.com/@lido-sdk/providers/-/providers-1.4.15.tgz#2640afbd247cff90952d6710888d8b6a3c2ad0cd"
integrity sha512-155BlcEgKWFlC17itMAeflhfRnF+ejrRUOONfexgIzjcOtam+PB1WNLzpXj8zkhcLbuMW11zYJ0cfIc4QsToag==
dependencies:
"@lido-sdk/constants" "3.2.1"
"@lido-sdk/constants" "3.3.0"

"@lido-sdk/react@^2.0.5":
version "2.0.5"
resolved "https://registry.yarnpkg.com/@lido-sdk/react/-/react-2.0.5.tgz#13496354863bcd98f78cf223ac65254e9620419a"
integrity sha512-XRrO1Zg13IJO0TKhqT/TBJYTWuZg+2+8T+FPmegxwe7mfJSrg025lhtRPW8cjLHvPvVsW6RVgV/vW9iIeHvYpA==
"@lido-sdk/react@^2.0.6":
version "2.0.6"
resolved "https://registry.yarnpkg.com/@lido-sdk/react/-/react-2.0.6.tgz#f1a245803eb7136f396ceff695a598b0c92056dd"
integrity sha512-4Gwnl+6v/3JS6yyfbyyJj4P/r6slcfW8GESSl5XvPQcK3T/Jt54MN3vIv1tmFyPr1RM/vxtiR4doR+jKEItadA==
dependencies:
"@lido-sdk/constants" "3.2.1"
"@lido-sdk/contracts" "3.0.4"
"@lido-sdk/helpers" "1.5.1"
"@lido-sdk/constants" "3.3.0"
"@lido-sdk/contracts" "3.0.5"
"@lido-sdk/helpers" "1.6.0"
swr "^1.0.1"
tiny-invariant "^1.1.0"
tiny-warning "^1.0.3"
Expand Down Expand Up @@ -3833,6 +3833,7 @@
eventemitter3 "5.0.1"
mipd "0.0.5"
zustand "4.4.1"

"@walletconnect/[email protected]":
version "2.13.0"
resolved "https://registry.yarnpkg.com/@walletconnect/core/-/core-2.13.0.tgz#6b79b039930643e8ee85a0f512b143a35fdb8b52"
Expand Down Expand Up @@ -4122,6 +4123,11 @@ JSONStream@^1.3.5:
jsonparse "^1.2.0"
through ">=2.2.7 <3"

[email protected]:
version "0.9.8"
resolved "https://registry.yarnpkg.com/abitype/-/abitype-0.9.8.tgz#1f120b6b717459deafd213dfbf3a3dd1bf10ae8c"
integrity sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ==

[email protected]:
version "1.0.0"
resolved "https://registry.yarnpkg.com/abitype/-/abitype-1.0.0.tgz#237176dace81d90d018bebf3a45cb42f2a2d9e97"
Expand Down Expand Up @@ -7252,6 +7258,11 @@ [email protected]:
node-fetch "^2.6.1"
unfetch "^4.2.0"

[email protected]:
version "1.0.3"
resolved "https://registry.yarnpkg.com/isows/-/isows-1.0.3.tgz#93c1cf0575daf56e7120bab5c8c448b0809d0d74"
integrity sha512-2cKei4vlmg2cxEjm3wVSqn8pcoRF/LX/wpifuuNquFO4SQmPwarClT+SUCA2lt+l581tTeZIPIZuIDo2jWN1fg==

[email protected]:
version "1.0.4"
resolved "https://registry.yarnpkg.com/isows/-/isows-1.0.4.tgz#810cd0d90cc4995c26395d2aa4cfa4037ebdf061"
Expand Down Expand Up @@ -8392,6 +8403,13 @@ minimist@^1.2.0, minimist@^1.2.6:
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c"
integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==

[email protected]:
version "0.0.5"
resolved "https://registry.yarnpkg.com/mipd/-/mipd-0.0.5.tgz#367ee796531c23f0631f129038700b1406663aec"
integrity sha512-gbKA784D2WKb5H/GtqEv+Ofd1S9Zj+Z/PGDIl1u1QAbswkxD28BQ5bSXQxkeBzPBABg1iDSbiwGG1XqlOxRspA==
dependencies:
viem "^1.1.4"

[email protected]:
version "0.0.7"
resolved "https://registry.yarnpkg.com/mipd/-/mipd-0.0.7.tgz#bb5559e21fa18dc3d9fe1c08902ef14b7ce32fd9"
Expand Down Expand Up @@ -10937,6 +10955,20 @@ [email protected]:
isows "1.0.4"
ws "8.13.0"

viem@^1.1.4:
version "1.21.4"
resolved "https://registry.yarnpkg.com/viem/-/viem-1.21.4.tgz#883760e9222540a5a7e0339809202b45fe6a842d"
integrity sha512-BNVYdSaUjeS2zKQgPs+49e5JKocfo60Ib2yiXOWBT6LuVxY1I/6fFX3waEtpXvL1Xn4qu+BVitVtMh9lyThyhQ==
dependencies:
"@adraffy/ens-normalize" "1.10.0"
"@noble/curves" "1.2.0"
"@noble/hashes" "1.3.2"
"@scure/bip32" "1.3.2"
"@scure/bip39" "1.2.1"
abitype "0.9.8"
isows "1.0.3"
ws "8.13.0"

viem@^2.1.1:
version "2.17.9"
resolved "https://registry.yarnpkg.com/viem/-/viem-2.17.9.tgz#40ffd00a31621c8efdc4d49a58d5d30dc2d38d83"
Expand Down

0 comments on commit 0d74355

Please sign in to comment.