diff --git a/README.md b/README.md index d126eb4..805d33a 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,12 @@ Current offchain list: - https://bscgas.info/ +### Polygon (Matic) Network + +Current offchain list: + +- https://gasstation-mainnet.matic.network/ + ## Installation `npm i gas-price-oracle` diff --git a/package.json b/package.json index 931ea7c..f251a1a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gas-price-oracle", - "version": "0.3.2", + "version": "0.3.3", "description": "Gas Price Oracle library for Ethereum dApps.", "main": "lib/index.js", "homepage": "https://github.com/peppersec/gas-price-oracle", diff --git a/src/config/index.ts b/src/config/index.ts index 8ec2bee..0724d40 100644 --- a/src/config/index.ts +++ b/src/config/index.ts @@ -1,13 +1,16 @@ import { NetworkConfig } from '../types'; import mainnetOracles from './mainnet'; import binanceOracles from './binance'; +import polygonOracles from './polygon'; export enum ChainId { MAINNET = 1, BINANCE = 56, + POLYGON = 137, } export const networks: NetworkConfig = { [ChainId.MAINNET]: mainnetOracles, [ChainId.BINANCE]: binanceOracles, + [ChainId.POLYGON]: polygonOracles, }; diff --git a/src/config/polygon.ts b/src/config/polygon.ts new file mode 100644 index 0000000..d75240a --- /dev/null +++ b/src/config/polygon.ts @@ -0,0 +1,23 @@ +import { OffChainOracle, OffChainOracles, OnChainOracles } from '../types'; + +const maticGasStation: OffChainOracle = { + name: 'maticGasStation', + url: 'https://gasstation-mainnet.matic.network', + instantPropertyName: 'fastest', + fastPropertyName: 'fast', + standardPropertyName: 'standard', + lowPropertyName: 'safeLow', + denominator: 1, + additionalDataProperty: null, +}; + +export const offChainOracles: OffChainOracles = { + maticGasStation, +}; + +export const onChainOracles: OnChainOracles = {}; + +export default { + offChainOracles, + onChainOracles, +};