youwallet / wallet

🚀 基于Flutter开发的跨终端数字货币交易所✨
https://youwallet.github.io/
119 stars 55 forks source link

引入第三方接口动态更新交易需要的gas #148

Closed zhaobinglong closed 4 years ago

zhaobinglong commented 4 years ago

API

https://www.gasnow.org/

demo

Request

Mainland China: GET https://gasnow.sparkpool.com/api/v3/gas/price?utm_source=:YourAPPName
Global: GET https://www.gasnow.org/api/v3/gas/price?utm_source=:YourAPPName
Parameters

* utm_source String. Your app name (e.g. imToken)
Response Example

{
  "code": 200,
  "data": {
    "rapid": 180132000000, wei
    "fast": 177000000000,
    "slow": 150000000000,
    "standard": 109000001459,
    "timestamp": 1598434638872,
  }
}
fangmd commented 4 years ago

这个也可以(没用过): https://www.etherchain.org/api/gasPriceOracle

https://www.etherchain.org/tools/gasPriceOracle

{
safeLow: 28,
standard: 34.1,
fast: 50.6,
fastest: 57
}
zhaobinglong commented 4 years ago

@fangmd 目前已经接入了gasnow.org的接口,还可以扩展更多的接口

zhaobinglong commented 4 years ago

done