From 6d4a86970152d1b7929cd0f5a39955341efcd37e Mon Sep 17 00:00:00 2001 From: sam bacha Date: Fri, 3 Jun 2022 01:41:38 -0700 Subject: [PATCH] feat(etherchain): add fake gasnow endpoint (#19) --- README.md | 74 +++++++++++++++++++++++++++++++ test_files/etherchain_gasnow.json | 1 + 2 files changed, 75 insertions(+) create mode 100644 test_files/etherchain_gasnow.json diff --git a/README.md b/README.md index e122610..5940936 100644 --- a/README.md +++ b/README.md @@ -863,6 +863,80 @@ wss://www.gasnow.org/ws { "safeLow": 102, "standard": 105, "fast": 114.6, "fastest": 120 } ``` +### etherchain-gasnow + +[https://etherchain.org/api/gasnow](https://etherchain.org/api/gasnow) + +```js +{code: 200, data: {rapid: 60000000000, fast: 39962373278, standard: 24406984375, slow: 19550000000,…}} +``` +```javascript +code: 200 +data: {rapid: 60000000000, fast: 39962373278, standard: 24406984375, slow: 19550000000,…} +fast: 39962373278 +priceUSD: 1818.52 +rapid: 60000000000 +slow: 19550000000 +standard: 24406984375 +timestamp: 1654245505826 +``` +> Response + +```json +{"code":200,"data":{"rapid":65265049007,"fast":49988581398,"standard":23000000000,"slow":19550000000,"timestamp":1654245243247,"priceUSD":1818.52}} +``` + + +> Schema + +```json +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "$id": "etherchain_gasnow", + "type": "object", + "properties": { + "code": { + "type": "integer" + }, + "data": { + "type": "object", + "properties": { + "rapid": { + "type": "integer" + }, + "fast": { + "type": "integer" + }, + "standard": { + "type": "integer" + }, + "slow": { + "type": "integer" + }, + "timestamp": { + "type": "integer" + }, + "priceUSD": { + "type": "number" + } + }, + "required": [ + "rapid", + "fast", + "standard", + "slow", + "timestamp", + "priceUSD" + ] + } + }, + "required": [ + "code", + "data" + ] +} +``` + ### poanetwork [endpoint url](https://gasprice.poa.network/) diff --git a/test_files/etherchain_gasnow.json b/test_files/etherchain_gasnow.json new file mode 100644 index 0000000..f4676fd --- /dev/null +++ b/test_files/etherchain_gasnow.json @@ -0,0 +1 @@ +{"code":200,"data":{"rapid":65265049007,"fast":49988581398,"standard":23000000000,"slow":19550000000,"timestamp":1654245243247,"priceUSD":1818.52}}