essential-eth 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.umd.js +1 -1
- package/dist/cjs/index.umd.js.map +1 -1
- package/dist/cjs/logger/package-version.d.ts +1 -1
- package/dist/cjs/logger/package-version.js +1 -1
- package/dist/cjs/providers/BaseProvider.d.ts +2 -0
- package/dist/cjs/providers/BaseProvider.js +59 -0
- package/dist/cjs/providers/test/json-rpc-provider/get-fee-data.test.js +212 -0
- package/dist/cjs/types/FeeData.types.d.ts +7 -0
- package/dist/cjs/types/FeeData.types.js +1 -0
- package/dist/esm/logger/package-version.d.ts +1 -1
- package/dist/esm/logger/package-version.js +1 -1
- package/dist/esm/providers/BaseProvider.d.ts +2 -0
- package/dist/esm/providers/BaseProvider.js +15 -0
- package/dist/esm/types/FeeData.types.d.ts +7 -0
- package/dist/esm/types/FeeData.types.js +1 -0
- package/package.json +3 -3
- package/readme.md +30 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.
|
|
1
|
+
export declare const version = "0.8.0";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export var version = "0.
|
|
2
|
+
export var version = "0.8.0";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TinyBig } from '../shared/tiny-big/tiny-big';
|
|
2
2
|
import type { BlockResponse, BlockTag } from '../types/Block.types';
|
|
3
|
+
import type { FeeData } from '../types/FeeData.types';
|
|
3
4
|
import type { Filter, FilterByBlockHash } from '../types/Filter.types';
|
|
4
5
|
import type { Network } from '../types/Network.types';
|
|
5
6
|
import type { Log, TransactionReceipt, TransactionRequest, TransactionResponse } from '../types/Transaction.types';
|
|
@@ -19,6 +20,7 @@ export declare abstract class BaseProvider {
|
|
|
19
20
|
getBalance(address: string, blockTag?: BlockTag): Promise<TinyBig>;
|
|
20
21
|
getCode(address: string, blockTag?: BlockTag): Promise<string>;
|
|
21
22
|
estimateGas(transaction: TransactionRequest): Promise<TinyBig>;
|
|
23
|
+
getFeeData(): Promise<FeeData>;
|
|
22
24
|
getLogs(filter: Filter | FilterByBlockHash): Promise<Array<Log>>;
|
|
23
25
|
call(transaction: TransactionRequest, blockTag?: BlockTag): Promise<string>;
|
|
24
26
|
}
|
|
@@ -735,6 +735,65 @@ export var BaseProvider = /*#__PURE__*/ function() {
|
|
|
735
735
|
})();
|
|
736
736
|
};
|
|
737
737
|
/**
|
|
738
|
+
* Returns the current recommended FeeData to use in a transaction.
|
|
739
|
+
* For an EIP-1559 transaction, the maxFeePerGas and maxPriorityFeePerGas should be used.
|
|
740
|
+
* For legacy transactions and networks which do not support EIP-1559, the gasPrice should be used.Returns an estimate of the amount of gas that would be required to submit transaction to the network.
|
|
741
|
+
*
|
|
742
|
+
* * [Identical](/docs/api#isd) to [`ethers.provider.getFeeData`](https://docs.ethers.org/v5/api/providers/provider/#Provider-getFeeData) in ethers.js
|
|
743
|
+
*
|
|
744
|
+
* @returns an object with gas estimates for the network currently
|
|
745
|
+
* @example
|
|
746
|
+
* ```javascript
|
|
747
|
+
* await provider.getFeeData();
|
|
748
|
+
* // {
|
|
749
|
+
* // gasPrice: { TinyBig: "14184772639" },
|
|
750
|
+
* // lastBaseFeePerGas: { TinyBig: "14038523098" },
|
|
751
|
+
* // maxFeePerGas: { TinyBig: "29577046196" },
|
|
752
|
+
* // maxPriorityFeePerGas: { TinyBig: "1500000000" }
|
|
753
|
+
* // }
|
|
754
|
+
* ```
|
|
755
|
+
*/ _proto.getFeeData = function getFeeData() {
|
|
756
|
+
var _this = this;
|
|
757
|
+
return _asyncToGenerator(function() {
|
|
758
|
+
var _ref, block, gasPrice, lastBaseFeePerGas, maxFeePerGas, maxPriorityFeePerGas;
|
|
759
|
+
return __generator(this, function(_state) {
|
|
760
|
+
switch(_state.label){
|
|
761
|
+
case 0:
|
|
762
|
+
return [
|
|
763
|
+
4,
|
|
764
|
+
Promise.all([
|
|
765
|
+
_this.getBlock("latest"),
|
|
766
|
+
_this.getGasPrice()
|
|
767
|
+
])
|
|
768
|
+
];
|
|
769
|
+
case 1:
|
|
770
|
+
_ref = _slicedToArray.apply(void 0, [
|
|
771
|
+
_state.sent(),
|
|
772
|
+
2
|
|
773
|
+
]), block = _ref[0], gasPrice = _ref[1];
|
|
774
|
+
lastBaseFeePerGas = null, maxFeePerGas = null, maxPriorityFeePerGas = null;
|
|
775
|
+
if (block && block.baseFeePerGas) {
|
|
776
|
+
// We may want to compute this more accurately in the future,
|
|
777
|
+
// using the formula "check if the base fee is correct".
|
|
778
|
+
// See: https://eips.ethereum.org/EIPS/eip-1559
|
|
779
|
+
lastBaseFeePerGas = block.baseFeePerGas;
|
|
780
|
+
maxPriorityFeePerGas = tinyBig("1500000000");
|
|
781
|
+
maxFeePerGas = tinyBig(block.baseFeePerGas.mul(2).add(maxPriorityFeePerGas));
|
|
782
|
+
}
|
|
783
|
+
return [
|
|
784
|
+
2,
|
|
785
|
+
{
|
|
786
|
+
lastBaseFeePerGas: lastBaseFeePerGas,
|
|
787
|
+
maxFeePerGas: maxFeePerGas,
|
|
788
|
+
maxPriorityFeePerGas: maxPriorityFeePerGas,
|
|
789
|
+
gasPrice: gasPrice
|
|
790
|
+
}
|
|
791
|
+
];
|
|
792
|
+
}
|
|
793
|
+
});
|
|
794
|
+
})();
|
|
795
|
+
};
|
|
796
|
+
/**
|
|
738
797
|
* Returns transaction receipt event logs that match a specified filter.
|
|
739
798
|
* May return `[]` if parameters are too broad, even if logs exist.
|
|
740
799
|
*
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
function _arrayLikeToArray(arr, len) {
|
|
2
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
|
+
return arr2;
|
|
5
|
+
}
|
|
6
|
+
function _arrayWithHoles(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return arr;
|
|
8
|
+
}
|
|
9
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
10
|
+
try {
|
|
11
|
+
var info = gen[key](arg);
|
|
12
|
+
var value = info.value;
|
|
13
|
+
} catch (error) {
|
|
14
|
+
reject(error);
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (info.done) {
|
|
18
|
+
resolve(value);
|
|
19
|
+
} else {
|
|
20
|
+
Promise.resolve(value).then(_next, _throw);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function _asyncToGenerator(fn) {
|
|
24
|
+
return function() {
|
|
25
|
+
var self = this, args = arguments;
|
|
26
|
+
return new Promise(function(resolve, reject) {
|
|
27
|
+
var gen = fn.apply(self, args);
|
|
28
|
+
function _next(value) {
|
|
29
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
30
|
+
}
|
|
31
|
+
function _throw(err) {
|
|
32
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
33
|
+
}
|
|
34
|
+
_next(undefined);
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function _iterableToArrayLimit(arr, i) {
|
|
39
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
40
|
+
if (_i == null) return;
|
|
41
|
+
var _arr = [];
|
|
42
|
+
var _n = true;
|
|
43
|
+
var _d = false;
|
|
44
|
+
var _s, _e;
|
|
45
|
+
try {
|
|
46
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
47
|
+
_arr.push(_s.value);
|
|
48
|
+
if (i && _arr.length === i) break;
|
|
49
|
+
}
|
|
50
|
+
} catch (err) {
|
|
51
|
+
_d = true;
|
|
52
|
+
_e = err;
|
|
53
|
+
} finally{
|
|
54
|
+
try {
|
|
55
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
56
|
+
} finally{
|
|
57
|
+
if (_d) throw _e;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return _arr;
|
|
61
|
+
}
|
|
62
|
+
function _nonIterableRest() {
|
|
63
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
64
|
+
}
|
|
65
|
+
function _slicedToArray(arr, i) {
|
|
66
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
67
|
+
}
|
|
68
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
69
|
+
if (!o) return;
|
|
70
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
71
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
72
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
73
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
74
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
75
|
+
}
|
|
76
|
+
var __generator = this && this.__generator || function(thisArg, body) {
|
|
77
|
+
var f, y, t, g, _ = {
|
|
78
|
+
label: 0,
|
|
79
|
+
sent: function() {
|
|
80
|
+
if (t[0] & 1) throw t[1];
|
|
81
|
+
return t[1];
|
|
82
|
+
},
|
|
83
|
+
trys: [],
|
|
84
|
+
ops: []
|
|
85
|
+
};
|
|
86
|
+
return g = {
|
|
87
|
+
next: verb(0),
|
|
88
|
+
"throw": verb(1),
|
|
89
|
+
"return": verb(2)
|
|
90
|
+
}, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
91
|
+
return this;
|
|
92
|
+
}), g;
|
|
93
|
+
function verb(n) {
|
|
94
|
+
return function(v) {
|
|
95
|
+
return step([
|
|
96
|
+
n,
|
|
97
|
+
v
|
|
98
|
+
]);
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function step(op) {
|
|
102
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
103
|
+
while(_)try {
|
|
104
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
105
|
+
if (y = 0, t) op = [
|
|
106
|
+
op[0] & 2,
|
|
107
|
+
t.value
|
|
108
|
+
];
|
|
109
|
+
switch(op[0]){
|
|
110
|
+
case 0:
|
|
111
|
+
case 1:
|
|
112
|
+
t = op;
|
|
113
|
+
break;
|
|
114
|
+
case 4:
|
|
115
|
+
_.label++;
|
|
116
|
+
return {
|
|
117
|
+
value: op[1],
|
|
118
|
+
done: false
|
|
119
|
+
};
|
|
120
|
+
case 5:
|
|
121
|
+
_.label++;
|
|
122
|
+
y = op[1];
|
|
123
|
+
op = [
|
|
124
|
+
0
|
|
125
|
+
];
|
|
126
|
+
continue;
|
|
127
|
+
case 7:
|
|
128
|
+
op = _.ops.pop();
|
|
129
|
+
_.trys.pop();
|
|
130
|
+
continue;
|
|
131
|
+
default:
|
|
132
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
|
|
133
|
+
_ = 0;
|
|
134
|
+
continue;
|
|
135
|
+
}
|
|
136
|
+
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
|
|
137
|
+
_.label = op[1];
|
|
138
|
+
break;
|
|
139
|
+
}
|
|
140
|
+
if (op[0] === 6 && _.label < t[1]) {
|
|
141
|
+
_.label = t[1];
|
|
142
|
+
t = op;
|
|
143
|
+
break;
|
|
144
|
+
}
|
|
145
|
+
if (t && _.label < t[2]) {
|
|
146
|
+
_.label = t[2];
|
|
147
|
+
_.ops.push(op);
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
if (t[2]) _.ops.pop();
|
|
151
|
+
_.trys.pop();
|
|
152
|
+
continue;
|
|
153
|
+
}
|
|
154
|
+
op = body.call(thisArg, _);
|
|
155
|
+
} catch (e) {
|
|
156
|
+
op = [
|
|
157
|
+
6,
|
|
158
|
+
e
|
|
159
|
+
];
|
|
160
|
+
y = 0;
|
|
161
|
+
} finally{
|
|
162
|
+
f = t = 0;
|
|
163
|
+
}
|
|
164
|
+
if (op[0] & 5) throw op[1];
|
|
165
|
+
return {
|
|
166
|
+
value: op[0] ? op[1] : void 0,
|
|
167
|
+
done: true
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
import { StaticJsonRpcProvider } from "@ethersproject/providers";
|
|
172
|
+
import { JsonRpcProvider } from "../../JsonRpcProvider";
|
|
173
|
+
import { rpcUrls } from "./../rpc-urls";
|
|
174
|
+
var rpcUrl = rpcUrls.mainnet;
|
|
175
|
+
var essentialEthProvider = new JsonRpcProvider(rpcUrl);
|
|
176
|
+
var ethersProvider = new StaticJsonRpcProvider(rpcUrl);
|
|
177
|
+
describe("provider.getFeeData", function() {
|
|
178
|
+
it("should match ethers.js", /*#__PURE__*/ _asyncToGenerator(function() {
|
|
179
|
+
var _ref, ethersFeeData, eeFeeData;
|
|
180
|
+
return __generator(this, function(_state) {
|
|
181
|
+
switch(_state.label){
|
|
182
|
+
case 0:
|
|
183
|
+
return [
|
|
184
|
+
4,
|
|
185
|
+
Promise.all([
|
|
186
|
+
ethersProvider.getFeeData(),
|
|
187
|
+
essentialEthProvider.getFeeData()
|
|
188
|
+
])
|
|
189
|
+
];
|
|
190
|
+
case 1:
|
|
191
|
+
_ref = _slicedToArray.apply(void 0, [
|
|
192
|
+
_state.sent(),
|
|
193
|
+
2
|
|
194
|
+
]), ethersFeeData = _ref[0], eeFeeData = _ref[1];
|
|
195
|
+
expect(eeFeeData.gasPrice.toString()).toBe(// @ts-ignore
|
|
196
|
+
ethersFeeData === null || ethersFeeData === void 0 ? void 0 : ethersFeeData.gasPrice.toString());
|
|
197
|
+
// @ts-ignore
|
|
198
|
+
expect(eeFeeData.lastBaseFeePerGas.toString()).toBe(// @ts-ignore
|
|
199
|
+
ethersFeeData === null || ethersFeeData === void 0 ? void 0 : ethersFeeData.lastBaseFeePerGas.toString());
|
|
200
|
+
// @ts-ignore
|
|
201
|
+
expect(eeFeeData.maxFeePerGas.toString()).toBe(// @ts-ignore
|
|
202
|
+
ethersFeeData === null || ethersFeeData === void 0 ? void 0 : ethersFeeData.maxFeePerGas.toString());
|
|
203
|
+
// @ts-ignore
|
|
204
|
+
expect(eeFeeData.maxPriorityFeePerGas.toString()).toBe(// @ts-ignore
|
|
205
|
+
ethersFeeData === null || ethersFeeData === void 0 ? void 0 : ethersFeeData.maxPriorityFeePerGas.toString());
|
|
206
|
+
return [
|
|
207
|
+
2
|
|
208
|
+
];
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
}));
|
|
212
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.
|
|
1
|
+
export declare const version = "0.8.0";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '0.
|
|
1
|
+
export const version = '0.8.0';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { TinyBig } from '../shared/tiny-big/tiny-big';
|
|
2
2
|
import type { BlockResponse, BlockTag } from '../types/Block.types';
|
|
3
|
+
import type { FeeData } from '../types/FeeData.types';
|
|
3
4
|
import type { Filter, FilterByBlockHash } from '../types/Filter.types';
|
|
4
5
|
import type { Network } from '../types/Network.types';
|
|
5
6
|
import type { Log, TransactionReceipt, TransactionRequest, TransactionResponse } from '../types/Transaction.types';
|
|
@@ -19,6 +20,7 @@ export declare abstract class BaseProvider {
|
|
|
19
20
|
getBalance(address: string, blockTag?: BlockTag): Promise<TinyBig>;
|
|
20
21
|
getCode(address: string, blockTag?: BlockTag): Promise<string>;
|
|
21
22
|
estimateGas(transaction: TransactionRequest): Promise<TinyBig>;
|
|
23
|
+
getFeeData(): Promise<FeeData>;
|
|
22
24
|
getLogs(filter: Filter | FilterByBlockHash): Promise<Array<Log>>;
|
|
23
25
|
call(transaction: TransactionRequest, blockTag?: BlockTag): Promise<string>;
|
|
24
26
|
}
|
|
@@ -120,6 +120,21 @@ export class BaseProvider {
|
|
|
120
120
|
return tinyBig(hexToDecimal(gasUsed));
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
|
+
getFeeData() {
|
|
124
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
125
|
+
const [block, gasPrice] = yield Promise.all([
|
|
126
|
+
this.getBlock('latest'),
|
|
127
|
+
this.getGasPrice(),
|
|
128
|
+
]);
|
|
129
|
+
let lastBaseFeePerGas = null, maxFeePerGas = null, maxPriorityFeePerGas = null;
|
|
130
|
+
if (block && block.baseFeePerGas) {
|
|
131
|
+
lastBaseFeePerGas = block.baseFeePerGas;
|
|
132
|
+
maxPriorityFeePerGas = tinyBig('1500000000');
|
|
133
|
+
maxFeePerGas = tinyBig(block.baseFeePerGas.mul(2).add(maxPriorityFeePerGas));
|
|
134
|
+
}
|
|
135
|
+
return { lastBaseFeePerGas, maxFeePerGas, maxPriorityFeePerGas, gasPrice };
|
|
136
|
+
});
|
|
137
|
+
}
|
|
123
138
|
getLogs(filter) {
|
|
124
139
|
return __awaiter(this, void 0, void 0, function* () {
|
|
125
140
|
const filterByRange = filter;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "essential-eth",
|
|
3
3
|
"description": "Ultralight JS for Ethereum",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.8.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"private": false,
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
"name": "JsonRpcProvider",
|
|
31
31
|
"path": "src/index.ts",
|
|
32
32
|
"import": "{ JsonRpcProvider }",
|
|
33
|
-
"limit": "20.
|
|
33
|
+
"limit": "20.32kb"
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
"name": "Contract",
|
|
37
37
|
"path": "src/index.ts",
|
|
38
38
|
"import": "{ Contract }",
|
|
39
|
-
"limit": "15.
|
|
39
|
+
"limit": "15.38kb"
|
|
40
40
|
}
|
|
41
41
|
],
|
|
42
42
|
"scripts": {
|
package/readme.md
CHANGED
|
@@ -91,6 +91,7 @@
|
|
|
91
91
|
- [`getBlock`](#getblock)
|
|
92
92
|
- [`getBlockNumber`](#getblocknumber)
|
|
93
93
|
- [`getCode`](#getcode)
|
|
94
|
+
- [`getFeeData`](#getfeedata)
|
|
94
95
|
- [`getGasPrice`](#getgasprice)
|
|
95
96
|
- [`getLogs`](#getlogs)
|
|
96
97
|
- [`getNetwork`](#getnetwork)
|
|
@@ -128,7 +129,7 @@ Browsers:
|
|
|
128
129
|
|
|
129
130
|
```html
|
|
130
131
|
<!-- index.html -->
|
|
131
|
-
<script src="https://unpkg.com/essential-eth@0.
|
|
132
|
+
<script src="https://unpkg.com/essential-eth@0.8.0"></script>
|
|
132
133
|
```
|
|
133
134
|
|
|
134
135
|
<!-- ⛔️ AUTO-GENERATED-CONTENT:END (UNPKG_SCRIPT_TAG) -->
|
|
@@ -1195,6 +1196,34 @@ await jsonRpcProvider().getCode(
|
|
|
1195
1196
|
|
|
1196
1197
|
<br/>
|
|
1197
1198
|
|
|
1199
|
+
#### [`getFeeData`](https://eeth.dev/docs/api/classes/JsonRpcProvider#getfeedata)
|
|
1200
|
+
|
|
1201
|
+
```typescript
|
|
1202
|
+
provider.getFeeData(): Promise<FeeData>
|
|
1203
|
+
```
|
|
1204
|
+
|
|
1205
|
+
<details>
|
|
1206
|
+
<summary>View Example</summary>
|
|
1207
|
+
|
|
1208
|
+
```js
|
|
1209
|
+
import { JsonRpcProvider } from 'essential-eth';
|
|
1210
|
+
const provider = new JsonRpcProvider('RPC URL HERE' /* Try Infura or POKT */);
|
|
1211
|
+
```
|
|
1212
|
+
|
|
1213
|
+
```javascript
|
|
1214
|
+
await provider.getFeeData();
|
|
1215
|
+
// {
|
|
1216
|
+
// gasPrice: { TinyBig: "14184772639" },
|
|
1217
|
+
// lastBaseFeePerGas: { TinyBig: "14038523098" },
|
|
1218
|
+
// maxFeePerGas: { TinyBig: "29577046196" },
|
|
1219
|
+
// maxPriorityFeePerGas: { TinyBig: "1500000000" }
|
|
1220
|
+
// }
|
|
1221
|
+
```
|
|
1222
|
+
|
|
1223
|
+
</details>
|
|
1224
|
+
|
|
1225
|
+
<br/>
|
|
1226
|
+
|
|
1198
1227
|
#### [`getGasPrice`](https://eeth.dev/docs/api/classes/JsonRpcProvider#getgasprice)
|
|
1199
1228
|
|
|
1200
1229
|
```typescript
|