Closed theding0x closed 2 years ago
thanks for the PR!
seems to work for ETH but not for binance-smart-chain or polygon:
INFO[0009] Watching gas price for binance-smart-chain
ERRO[0012] Error getting rates: json: cannot unmarshal number into Go struct field ZapperData.standard of type struct { BaseFeePerGas int64 "json:\"baseFeePerGas\""; MaxPriorityFeePerGas int64 "json:\"maxPriorityFeePerGas\""; MaxFeePerGas int64 "json:\"maxFeePerGas\"" }
INFO[0008] Watching gas price for polygon
ERRO[0011] Error getting rates: json: cannot unmarshal number into Go struct field ZapperData.standard of type struct { BaseFeePerGas int64 "json:\"baseFeePerGas\""; MaxPriorityFeePerGas int64 "json:\"maxPriorityFeePerGas\""; MaxFeePerGas int64 "json:\"maxFeePerGas\"" }
it looks like the data format for the other chains is different than ETH's:
{
"eip1559": false,
"standard": 78,
"fast": 115,
"instant": 129
}
you will need to add some logic for this.
I had some time to work on this today so I recreated your work over in https://github.com/rssnyder/discord-stock-ticker/pull/158 and tagged you as co-author so I could push it out while I'm online. Thanks for the contribution!
I noticed an issue with the gas price bot failing to get data from the API endpoints. I updated the code to use Zapper's v2 endpoints and removed the ethgaswatch.go file because that endpoint doesn't seem to be live anymore. ETH gas just gets the price from Zapper in this version.