|
1 | 1 | # ethereum-api
|
2 | 2 |
|
3 | 3 | 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 | +``` |
0 commit comments