Skip to content

Commit 06e3333

Browse files
committed
update
1 parent d6433f4 commit 06e3333

23 files changed

+5366
-5749
lines changed

.babelrc

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
{
22
"presets": [
3-
"@babel/env",
3+
[
4+
"@babel/preset-env",
5+
{
6+
"useBuiltIns": "usage"
7+
}
8+
],
49
"@babel/typescript"
510
]
611
}

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
build

.gitignore

+44
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,46 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
6+
# Runtime data
7+
pids
8+
*.pid
9+
*.seed
10+
*.pid.lock
11+
12+
# Directory for instrumented libs generated by jscoverage/JSCover
13+
lib-cov
14+
15+
# Coverage directory used by tools like istanbul
16+
coverage
17+
18+
# nyc test coverage
19+
.nyc_output
20+
21+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
22+
.grunt
23+
24+
# node-waf configuration
25+
.lock-wscript
26+
27+
# Dependency directories
128
node_modules
29+
jspm_packages
30+
31+
# Optional npm cache directory
32+
.npm
33+
34+
# Optional eslint cache
35+
.eslintcache
36+
37+
# Optional REPL history
38+
.node_repl_history
39+
40+
# Output of 'npm pack'
41+
*.tgz
42+
43+
dist
44+
build
245

46+
.DS_Store

LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 Pedro Gomes
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+170
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,173 @@
11
# ethereum-api
22

33
Ethereum Blockchain API Aggregator
4+
5+
## API
6+
7+
### Get Account Assets
8+
Required Params: address, chainId
9+
10+
```bash
11+
GET https://ethereum-api.xyz/account-assets?address=0xfeBD6abD30D8E1AD477957C376efb79d1758B8c1&chainId=1
12+
13+
# Response
14+
{
15+
"success": true,
16+
"result": [
17+
{
18+
"symbol": "ETH",
19+
"name": "Ethereum",
20+
"decimals": "18",
21+
"contractAddress": "",
22+
"balance": "0"
23+
},
24+
{
25+
"symbol": "BKC",
26+
"name": "Bankcoin Cash",
27+
"decimals": "8",
28+
"contractAddress": "0xc88be04c809856b75e3dfe19eb4dcf0a3b15317a",
29+
"balance": "158552014464"
30+
}
31+
]
32+
}
33+
```
34+
35+
### Get Account Transactions
36+
Required Params: address, chainId
37+
38+
```bash
39+
GET https://ethereum-api.xyz/account-transactions?address=0xfeBD6abD30D8E1AD477957C376efb79d1758B8c1&chainId=1
40+
41+
# Response
42+
{
43+
"success": true,
44+
"result": [
45+
{
46+
"timestamp": "1549654458000",
47+
"hash": "0x837991f0f72fb1acc63b386dbbd59957a9034476af20264378507d627a9e6569",
48+
"from": "0xfebd6abd30d8e1ad477957c376efb79d1758b8c1",
49+
"to": "0x8b17190217491094d09d7c8ca5ef683ac251c900",
50+
"nonce": "3",
51+
"gasPrice": "1000000000",
52+
"gasUsed": "21000",
53+
"fee": "21000000000000",
54+
"value": "720919600000000",
55+
"input": "0x",
56+
"error": false,
57+
"asset": {
58+
"symbol": "ETH",
59+
"name": "Ethereum",
60+
"decimals": "18",
61+
"contractAddress": ""
62+
},
63+
"operations": []
64+
},
65+
{
66+
"timestamp": "1548329044000",
67+
"hash": "0xf24978e7502e97342a679b7a5d1fe9b41a56d497f4ed17293ba64b4c4bbce757",
68+
"from": "0xfebd6abd30d8e1ad477957c376efb79d1758b8c1",
69+
"to": "0xc88be04c809856b75e3dfe19eb4dcf0a3b15317a",
70+
"nonce": "2",
71+
"gasPrice": "1500000000",
72+
"gasUsed": "24178",
73+
"fee": "36267000000000",
74+
"value": "0",
75+
"input": "0xa9059cbb0000000000000000000000008b17190217491094d09d7c8ca5ef683ac251c900000000000000000000000000000000000000000000000055f3831b1ab52a0000",
76+
"error": true,
77+
"asset": {
78+
"symbol": "ETH",
79+
"name": "Ethereum",
80+
"decimals": "18",
81+
"contractAddress": ""
82+
},
83+
"operations": []
84+
},
85+
{
86+
"timestamp": "1540938002000",
87+
"hash": "0xd9c6e897a164ac0947ba5b005a80f4dbd9cf61544d61ac2d8481c61d60c2d7a0",
88+
"from": "0xfebd6abd30d8e1ad477957c376efb79d1758b8c1",
89+
"to": "0xc88be04c809856b75e3dfe19eb4dcf0a3b15317a",
90+
"nonce": "1",
91+
"gasPrice": "1200000000",
92+
"gasUsed": "24178",
93+
"fee": "29013600000000",
94+
"value": "0",
95+
"input": "0xa9059cbb0000000000000000000000008b17190217491094d09d7c8ca5ef683ac251c900000000000000000000000000000000000000000000000055f3831b1ab52a0000",
96+
"error": true,
97+
"asset": {
98+
"symbol": "ETH",
99+
"name": "Ethereum",
100+
"decimals": "18",
101+
"contractAddress": ""
102+
},
103+
"operations": []
104+
},
105+
{
106+
"timestamp": "1540675507000",
107+
"hash": "0xad42e20f783e4c5a6407e9fea9a0ac26aebc76e45a04d9bb68886b3fe2dd0e1d",
108+
"from": "0xfebd6abd30d8e1ad477957c376efb79d1758b8c1",
109+
"to": "0xc88be04c809856b75e3dfe19eb4dcf0a3b15317a",
110+
"nonce": "0",
111+
"gasPrice": "2300000000",
112+
"gasUsed": "83826",
113+
"fee": "192799800000000",
114+
"value": "0",
115+
"input": "0x",
116+
"error": false,
117+
"asset": {
118+
"symbol": "ETH",
119+
"name": "Ethereum",
120+
"decimals": "18",
121+
"contractAddress": ""
122+
},
123+
"operations": [
124+
{
125+
"asset": {
126+
"symbol": "BKC",
127+
"name": "Bankcoin Cash",
128+
"decimals": "8",
129+
"contractAddress": "0xc88be04c809856b75e3dfe19eb4dcf0a3b15317a"
130+
},
131+
"value": "158552014464",
132+
"from": "0x0000000000000000000000000000000000000000",
133+
"to": "0xfebd6abd30d8e1ad477957c376efb79d1758b8c1",
134+
"functionName": "0x"
135+
}
136+
]
137+
},
138+
{
139+
"timestamp": "1538926843000",
140+
"hash": "0xe8ab634b5e03491b938c011346fa4f2ac37ca64dceb37b5b362b30cf5b6676f1",
141+
"from": "0xc2b082e2efe9abab6f042d15beb46380b1952398",
142+
"to": "0xfebd6abd30d8e1ad477957c376efb79d1758b8c1",
143+
"nonce": "5809",
144+
"gasPrice": "2500000000",
145+
"gasUsed": "21000",
146+
"fee": "52500000000000",
147+
"value": "1000000000000000",
148+
"input": "0x",
149+
"error": false,
150+
"asset": {
151+
"symbol": "ETH",
152+
"name": "Ethereum",
153+
"decimals": "18",
154+
"contractAddress": ""
155+
},
156+
"operations": []
157+
}
158+
]
159+
}
160+
```
161+
162+
### Get Account Nonce
163+
Required Params: address, chainId
164+
165+
```bash
166+
GET https://ethereum-api.xyz/account-nonce?address=0xfeBD6abD30D8E1AD477957C376efb79d1758B8c1&chainId=1
167+
168+
# Response
169+
{
170+
"success": true,
171+
"result": "4"
172+
}
173+
```

index.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
declare module 'eth-method-registry'
2+
declare module 'ethjs'

0 commit comments

Comments
 (0)