Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
4ce72288
Commit
4ce72288
authored
May 19, 2021
by
aniket-engg
Committed by
Aniket
May 26, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hardhat provider plugin
parent
fe168997
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
1 deletion
+39
-1
app.js
apps/remix-ide/src/app.js
+4
-1
hardhat-provider.js
apps/remix-ide/src/app/tabs/hardhat-provider.js
+35
-0
No files found.
apps/remix-ide/src/app.js
View file @
4ce72288
...
...
@@ -29,6 +29,7 @@ const { OffsetToLineColumnConverter } = require('./lib/offsetToLineColumnConvert
const
QueryParams
=
require
(
'./lib/query-params'
)
const
Storage
=
remixLib
.
Storage
const
RemixDProvider
=
require
(
'./app/files/remixDProvider'
)
const
HardhatProvider
=
require
(
'./app/tabs/hardhat-provider'
)
const
Config
=
require
(
'./config'
)
const
modalDialogCustom
=
require
(
'./app/ui/modal-dialog-custom'
)
const
modalDialog
=
require
(
'./app/ui/modaldialog'
)
...
...
@@ -296,6 +297,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
makeUdapp
(
blockchain
,
compilersArtefacts
,
(
domEl
)
=>
terminal
.
logHtml
(
domEl
))
const
contextualListener
=
new
ContextualListener
({
editor
})
const
hardhatProvider
=
new
HardhatProvider
()
engine
.
register
([
contentImport
,
...
...
@@ -309,7 +311,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
contextualListener
,
terminal
,
web3Provider
,
fetchAndCompile
fetchAndCompile
,
hardhatProvider
])
// LAYOUT & SYSTEM VIEWS
...
...
apps/remix-ide/src/app/tabs/hardhat-provider.js
0 → 100644
View file @
4ce72288
import
*
as
packageJson
from
'../../../../../package.json'
import
{
Plugin
}
from
'@remixproject/engine'
import
Web3
from
'web3'
const
profile
=
{
name
:
'hardhat-provider'
,
displayName
:
'Hardhat Provider'
,
kind
:
'provider'
,
description
:
'Hardhat provider'
,
methods
:
[
'sendAsync'
],
version
:
packageJson
.
version
}
export
default
class
HardhatProvider
extends
Plugin
{
constructor
()
{
super
(
profile
)
this
.
provider
=
new
Web3
.
providers
.
HttpProvider
(
'http://127.0.0.1:8545'
)
}
sendAsync
(
data
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
if
(
this
.
provider
)
{
this
.
provider
[
this
.
provider
.
sendAsync
?
'sendAsync'
:
'send'
](
data
,
(
error
,
message
)
=>
{
if
(
error
)
return
reject
(
error
)
resolve
(
message
)
})
}
else
{
resolve
({
"jsonrpc"
:
"2.0"
,
"result"
:
[],
"id"
:
data
.
id
})
}
})
}
}
module
.
exports
=
HardhatProvider
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment