Add to docs, that getTxGasParams returns value in WEI & bump lib version

This commit is contained in:
Theo 2023-07-06 13:48:52 -07:00
parent 8637327994
commit 05d758a01e
2 changed files with 8 additions and 4 deletions

@ -252,7 +252,9 @@ type GetTxGasParamsRes =
} }
const gasParams: GetTxGasParamsRes = await oracle.getTxGasParams({ legacySpeed: 'fast', bumpPercent: 30 }) const gasParams: GetTxGasParamsRes = await oracle.getTxGasParams({ legacySpeed: 'fast', bumpPercent: 30 })
console.log(gasParams) // { maxFeePerGas: 17, maxPriorityFeePerGas: 3 } || { gasPrice: 19 } console.log(gasParams)
// { maxFeePerGas: '3f5476a00', maxPriorityFeePerGas: 'b2d05e00' } || { gasPrice: '46c7cfe00' }
// equal to: { maxFeePerGas: 17 gwei, maxPriorityFeePerGas: 3 gwei } || { gasPrice: 19 gwei }
web3.eth.sendTransaction({ web3.eth.sendTransaction({
from: '0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8', from: '0xEA674fdDe714fd979de3EdF0F56AA9716B898ec8',
@ -267,6 +269,8 @@ web3.eth.sendTransaction({
`bumpPercent` argument (`0` by default) - response data will increase by `bumpPercent`%. `bumpPercent` argument (`0` by default) - response data will increase by `bumpPercent`%.
`legacySpeed` argument (`fast` by default) - select the speed of legacy gasPrice. `legacySpeed` argument (`fast` by default) - select the speed of legacy gasPrice.
Returns gas info in `wei`, hex-format.
### Offchain oracles only ### Offchain oracles only
```typescript ```typescript

@ -1,14 +1,14 @@
{ {
"name": "gas-price-oracle", "name": "gas-price-oracle",
"version": "0.5.2", "version": "0.5.3",
"description": "Gas Price Oracle library for Ethereum dApps.", "description": "Gas Price Oracle library for Ethereum dApps.",
"homepage": "https://github.com/peppersec/gas-price-oracle", "homepage": "https://git.tornado.ws/tornado-packages/gas-price-oracle",
"main": "./lib/index.js", "main": "./lib/index.js",
"module": "./lib/esm/index.js", "module": "./lib/esm/index.js",
"types": "./lib/index.d.ts", "types": "./lib/index.d.ts",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://github.com/peppersec/gas-price-oracle.git" "url": "https://git.tornado.ws/tornado-packages/gas-price-oracle"
}, },
"scripts": { "scripts": {
"test": "ts-mocha --timeout 30000 --paths 'src/tests/*.test.ts'", "test": "ts-mocha --timeout 30000 --paths 'src/tests/*.test.ts'",