Skip to content

Commit

Permalink
fix rpc endpoint properties
Browse files Browse the repository at this point in the history
  • Loading branch information
yann300 committed Oct 22, 2024
1 parent 440e248 commit e4f9dda
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 138 deletions.

This file was deleted.

10 changes: 6 additions & 4 deletions apps/remix-ide/src/app/providers/injected-custom-provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import { InjectedProviderDefault } from './injected-provider-default'
export class InjectedCustomProvider extends InjectedProviderDefault {
chainName: string
chainId: string
pluginName: string
rpcUrls: Array<string>
nativeCurrency: Record<string, any>
blockExplorerUrls: Array<string>

constructor(provider: any, chainName: string, chainId: string, rpcUrls: Array<string>, nativeCurrency?: Record<string, any>, blockExplorerUrls?: Array<string>) {
super(provider, chainName)
constructor(provider: any, pluginName: string, chainName: string, chainId: string, rpcUrls: Array<string>, nativeCurrency?: Record<string, any>, blockExplorerUrls?: Array<string>) {
super(provider, pluginName)
this.pluginName = pluginName
this.chainName = chainName
this.chainId = chainId
this.rpcUrls = rpcUrls
Expand Down Expand Up @@ -44,8 +46,8 @@ export const setCustomNetwork = async (chainName: string, chainId: string, rpcUr
chainName: chainName,
rpcUrls: rpcUrls,
}
if (nativeCurrency) paramsObj.nativeCurrency = nativeCurrency
if (blockExplorerUrls) paramsObj.blockExplorerUrls = blockExplorerUrls
paramsObj.nativeCurrency = nativeCurrency ? nativeCurrency : null
paramsObj.blockExplorerUrls = blockExplorerUrls ? blockExplorerUrls : null
await (window as any).ethereum.request({
method: 'wallet_addEthereumChain',
params: [paramsObj]
Expand Down

This file was deleted.

17 changes: 0 additions & 17 deletions apps/remix-ide/src/app/providers/injected-optimism-provider.tsx

This file was deleted.

26 changes: 0 additions & 26 deletions apps/remix-ide/src/app/providers/injected-provider-trustwallet.tsx

This file was deleted.

This file was deleted.

14 changes: 7 additions & 7 deletions apps/remix-ide/src/app/udapp/run-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ export class RunTab extends ViewPlugin {

const addCustomInjectedProvider = async (position, event, name, displayName, networkId, urls, nativeCurrency?) => {
// name = `${name} through ${event.detail.info.name}`
await this.engine.register([new InjectedCustomProvider(event.detail.provider, name, networkId, urls, nativeCurrency)])
await addProvider(position, name, displayName, true, false)
await this.engine.register([new InjectedCustomProvider(event.detail.provider, name, displayName, networkId, urls, nativeCurrency)])
await addProvider(position, name, displayName + ' - ' + event.detail.info.name, true, false)
}
const registerInjectedProvider = async (event) => {
const name = 'injected-' + event.detail.info.name
Expand All @@ -225,21 +225,21 @@ export class RunTab extends ViewPlugin {
await addProvider(0, name, displayName, true, false)

if (event.detail.info.name === 'MetaMask') {
await addCustomInjectedProvider(7, event, 'injected-metamask-optimism', 'L2 - Optimism - ' + event.detail.info.name, '0xa', ['https://mainnet.optimism.io'])
await addCustomInjectedProvider(8, event, 'injected-metamask-arbitrum', 'L2 - Arbitrum - ' + event.detail.info.name, '0xa4b1', ['https://arb1.arbitrum.io/rpc'])
await addCustomInjectedProvider(5, event, 'injected-metamask-sepolia', 'Sepolia Testnet - ' + event.detail.info.name, '0xaa36a7', [],
await addCustomInjectedProvider(7, event, 'injected-metamask-optimism', 'L2 - Optimism', '0xa', ['https://mainnet.optimism.io'])
await addCustomInjectedProvider(8, event, 'injected-metamask-arbitrum', 'L2 - Arbitrum', '0xa4b1', ['https://arb1.arbitrum.io/rpc'])
await addCustomInjectedProvider(5, event, 'injected-metamask-sepolia', 'Sepolia Testnet', '0xaa36a7', [],
{
"name": "Sepolia ETH",
"symbol": "ETH",
"decimals": 18
})
await addCustomInjectedProvider(9, event, 'injected-metamask-ephemery', 'Ephemery Testnet - ' + event.detail.info.name, '', ['https://otter.bordel.wtf/erigon', 'https://eth.ephemeral.zeus.fyi'],
await addCustomInjectedProvider(9, event, 'injected-metamask-ephemery', 'Ephemery Testnet', '', ['https://otter.bordel.wtf/erigon', 'https://eth.ephemeral.zeus.fyi'],
{
"name": "Ephemery ETH",
"symbol": "ETH",
"decimals": 18
})
await addCustomInjectedProvider(10, event, 'injected-metamask-gnosis', 'Gnosis Mainnet - ' + event.detail.info.name, '', ['https://rpc.ankr.com/gnosis', 'https://1rpc.io/gnosis'],
await addCustomInjectedProvider(10, event, 'injected-metamask-gnosis', 'Gnosis Mainnet', '', ['https://rpc.ankr.com/gnosis', 'https://1rpc.io/gnosis'],
{
"name": "XDAI",
"symbol": "XDAI",
Expand Down

0 comments on commit e4f9dda

Please sign in to comment.