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

Feature/ankr rpcs #387

Closed
wants to merge 4 commits into from
Closed
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
12 changes: 12 additions & 0 deletions docs/pages/docs/constants/rpcs.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ import { alchemyRpcUrls } from 'wagmi'
// alchemyRpcUrls.polygon
```

## ankrRpcUrls

RPC URLs supported by [Ankr](https://ankr.com).

```ts
import { ankrRpcUrls } from 'wagmi'

// ankrRpcUrls.mainnet
// ankrRpcUrls.arbitrum
// ankrRpcUrls.polygon
```

## infuraRpcUrls

RPC URLs supported by [Infura](https://infura.io).
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export {
defaultL2Chains,
} from './chains'

export { alchemyRpcUrls, infuraRpcUrls } from './rpcs'
export { alchemyRpcUrls, ankrRpcUrls, infuraRpcUrls } from './rpcs'
export type { RpcProviderName } from './rpcs'

export { units } from './units'
15 changes: 14 additions & 1 deletion packages/core/src/constants/rpcs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ChainName } from './chains'
export const defaultAlchemyId = '_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC'
export const defaultInfuraId = '84842078b09946638c03157f83405213'

export type RpcProviderName = 'alchemy' | 'infura'
export type RpcProviderName = 'alchemy' | 'ankr' | 'infura'

type AlchemyChains = Extract<
ChainName,
Expand Down Expand Up @@ -60,3 +60,16 @@ export const infuraRpcUrls: Record<InfuraChains, string> = {
arbitrum: 'https://arbitrum-mainnet.infura.io/v3',
arbitrumRinkeby: 'https://arbitrum-rinkeby.infura.io/v3',
} as const

type AnkrChains = Extract<
ChainName,
'mainnet' | 'ropsten' | 'rinkeby' | 'goerli' | 'polygon' | 'arbitrum'
>
export const ankrRpcUrls: Record<AnkrChains, string> = {
mainnet: 'https://rpc.ankr.com/eth',
ropsten: 'htps://rpc.ankr.com/eth_ropsten',
rinkeby: 'https://rpc.ankr.com/eth_rinkeby',
goerli: 'https://rpc.ankr.com/eth_goerli',
polygon: 'https://rpc.ankr.com/polygon',
arbitrum: 'https://rpc.ankr.com/arbitrum',
} as const
1 change: 1 addition & 0 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export type { ConnectorData, ConnectorEvents } from './connectors'
export {
alchemyRpcUrls,
allChains,
ankrRpcUrls,
chain,
chainId,
defaultChains,
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export {
WagmiClient,
alchemyRpcUrls,
allChains,
ankrRpcUrls,
chain,
chainId,
createStorage,
Expand Down