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
adab5ee4
Unverified
Commit
adab5ee4
authored
Jul 01, 2019
by
yann300
Committed by
GitHub
Jul 01, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2124 from ethereum/removeUneeded
Remove uneeded folder
parents
32ae5681
cec78611
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
152 deletions
+0
-152
index.html
extensions/etherscan-general/index.html
+0
-43
index.js
extensions/etherscan-general/index.js
+0
-109
No files found.
extensions/etherscan-general/index.html
deleted
100644 → 0
View file @
32ae5681
<!DOCTYPE html>
<html>
<head>
<meta
charset=
"utf-8"
>
<!--
The MIT License (MIT)
Copyright (c) 2014, 2015, the individual contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<meta
http-equiv=
"X-UA-Compatible"
content=
"chrome=1"
>
<title></title>
<link
rel=
"stylesheet"
href=
"assets/css/pygment_trac.css"
>
<link
rel=
"stylesheet"
href=
"assets/css/font-awesome.min.css"
>
<script
type=
"text/javascript"
src=
"api.js"
></script>
<script
type=
"text/javascript"
src=
"index.js"
></script>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1, user-scalable=no"
>
</head>
<body>
<div>
Etherscan - Network Status
</div>
<div
id=
"network"
></div>
<button
id=
"updateBtn"
>
Update
</button>
<div
id=
"container"
></div>
</body>
</html>
extensions/etherscan-general/index.js
deleted
100644 → 0
View file @
32ae5681
/* global XMLHttpRequest */
var
remix
=
new
window
.
RemixExtension
()
var
container
var
updateBtn
var
network
var
currentNetWork
=
''
var
networks
=
{
'Main'
:
''
,
'Ropsten'
:
'ropsten'
,
'Kovan'
:
'kovan'
,
'Rinkeby'
:
'rinkeby'
}
function
load
()
{
container
=
document
.
getElementById
(
'container'
)
updateBtn
=
document
.
getElementById
(
'updateBtn'
)
network
=
document
.
getElementById
(
'network'
)
var
log
=
function
(
call
,
msg
)
{
container
.
innerHTML
+=
'<div>'
+
call
+
': '
+
msg
+
'</div>'
}
updateBtn
.
addEventListener
(
'click'
,
function
()
{
container
.
innerHTML
=
''
if
(
networks
[
currentNetWork
]
!==
undefined
)
{
getBlockNumber
(
log
)
getLatestBlockInfo
(
log
)
getGasPrice
(
log
)
}
else
{
container
.
innerHTML
=
'current network not available through etherscan API'
}
})
getToken
(
function
(
error
,
result
)
{
if
(
error
)
console
.
log
(
error
)
if
(
!
result
)
{
remix
.
call
(
'config'
,
'setConfig'
,
[
'config.json'
,
'{ apikey: "" }'
],
function
(
error
,
result
)
{
if
(
error
)
return
console
.
log
(
error
)
})
}
})
setInterval
(
function
()
{
remix
.
call
(
'network'
,
'detectNetWork'
,
[],
function
(
error
,
result
)
{
if
(
error
)
console
.
log
(
error
)
if
(
network
.
innerHTML
!==
result
[
0
].
name
+
' - '
+
result
[
0
].
id
)
{
currentNetWork
=
result
[
0
].
name
container
.
innerHTML
=
''
network
.
innerHTML
=
result
[
0
].
name
+
' - '
+
result
[
0
].
id
}
})
},
1000
)
}
function
getToken
(
callback
)
{
remix
.
call
(
'config'
,
'getConfig'
,
[
'config.json'
],
function
(
error
,
result
)
{
if
(
error
)
return
callback
(
error
)
if
(
result
[
0
])
{
try
{
result
=
JSON
.
parse
(
result
[
0
])
}
catch
(
e
)
{
return
callback
(
e
.
message
)
}
callback
(
null
,
result
.
apikey
)
}
else
{
container
.
innerHTML
=
'no api key found'
callback
(
'no api key found'
)
}
})
}
function
httpGetAsync
(
url
,
callback
)
{
var
xmlHttp
=
new
XMLHttpRequest
()
xmlHttp
.
onreadystatechange
=
function
()
{
if
(
xmlHttp
.
readyState
===
4
&&
xmlHttp
.
status
===
200
)
{
callback
(
xmlHttp
.
responseText
)
}
}
xmlHttp
.
open
(
'GET'
,
url
,
true
)
xmlHttp
.
send
(
null
)
}
function
getBlockNumber
(
callback
)
{
getToken
(
function
(
error
,
apikey
)
{
if
(
error
)
console
.
log
(
error
)
httpGetAsync
(
'https://api-'
+
networks
[
currentNetWork
]
+
'.etherscan.io/api?module=proxy&action=eth_blockNumber&apikey='
+
apikey
,
function
(
result
)
{
callback
(
'latest block number'
,
result
)
})
})
}
function
getLatestBlockInfo
(
callback
)
{
getToken
(
function
(
error
,
apikey
)
{
if
(
error
)
console
.
log
(
error
)
httpGetAsync
(
'https://api-'
+
networks
[
currentNetWork
]
+
'.etherscan.io/api?module=proxy&action=eth_getBlockByNumber&tag=latest&boolean=true&apikey='
+
apikey
,
function
(
result
)
{
callback
(
'latest block'
,
result
)
})
})
}
function
getGasPrice
(
callback
)
{
getToken
(
function
(
error
,
apikey
)
{
if
(
error
)
console
.
log
(
error
)
httpGetAsync
(
'https://api-'
+
networks
[
currentNetWork
]
+
'.etherscan.io/api?module=proxy&action=eth_gasPrice&apikey='
+
apikey
,
function
(
result
)
{
callback
(
'current gas price'
,
result
)
})
})
}
setTimeout
(
load
,
1000
)
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