parent
e7c077b99c
commit
9860aaa256
@ -0,0 +1,38 @@ |
||||
import * as packageJson from '../../../../../package.json' |
||||
import React from 'react' // eslint-disable-line
|
||||
import { ExternalHttpProvider } from './external-http-provider' |
||||
import { ethers } from 'ethers' |
||||
|
||||
const profile = { |
||||
name: 'basic-http-provider', |
||||
displayName: 'External Http Provider', |
||||
kind: 'provider', |
||||
description: 'External Http Provider', |
||||
methods: ['sendAsync', 'displayName'], |
||||
version: packageJson.version |
||||
} |
||||
|
||||
export class BasicHttpProvider extends ExternalHttpProvider { |
||||
constructor (blockchain) { |
||||
super(profile, blockchain) |
||||
} |
||||
|
||||
displayName () { return profile.displayName } |
||||
|
||||
body (): JSX.Element { |
||||
return ( |
||||
<div> Note: To run Anvil on your system, run: |
||||
<div className="p-1 pl-3"><b>curl -L https://foundry.paradigm.xyz | bash</b></div>
|
||||
<div className="p-1 pl-3"><b>anvil</b></div> |
||||
<div className="pt-2 pb-4"> |
||||
For more info, visit: <a href="https://github.com/foundry-rs/foundry" target="_blank">Foundry Documentation</a> |
||||
</div> |
||||
<div>Anvil JSON-RPC Endpoint:</div> |
||||
</div> |
||||
) |
||||
} |
||||
|
||||
instanciateProvider (value): any { |
||||
return new ethers.providers.JsonRpcProvider(value) |
||||
} |
||||
} |
@ -0,0 +1,48 @@ |
||||
import * as packageJson from '../../../../../package.json' |
||||
import React from 'react' // eslint-disable-line
|
||||
import { AppModal, AlertModal, ModalTypes } from '@remix-ui/app' |
||||
import { ethers } from 'ethers' |
||||
import { AbstractProvider } from './abstract-provider' |
||||
|
||||
const profile = { |
||||
name: 'vm-mainnet-fork', |
||||
displayName: 'Mainnet fork - Remix VM', |
||||
kind: 'provider', |
||||
description: 'Mainnet fork - Remix VM', |
||||
methods: ['sendAsync'], |
||||
version: packageJson.version |
||||
} |
||||
|
||||
export class VMMainnetFork extends AbstractProvider { |
||||
urlInput: JSX.Element |
||||
blockInput: JSX.Element |
||||
forkInput: JSX.Element |
||||
constructor (blockchain) { |
||||
super(profile, blockchain) |
||||
} |
||||
|
||||
displayName () { return profile.displayName } |
||||
|
||||
nodeUrl () { |
||||
return 'https://rpc.archivenode.io/e50zmkroshle2e2e50zm0044i7ao04ym' |
||||
} |
||||
|
||||
blockNumber () { |
||||
return 'latest' |
||||
} |
||||
|
||||
async init() { |
||||
this.provider = this.blockchain.providers.vm.provider |
||||
} |
||||
|
||||
body (): JSX.Element { |
||||
return ( |
||||
<> |
||||
</> |
||||
) |
||||
} |
||||
|
||||
instanciateProvider (value): any { |
||||
return this.provider |
||||
} |
||||
} |
Loading…
Reference in new issue