@huma-finance/sdk 0.0.21 → 0.0.22
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.
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getDefaultGasOptions = exports.getPolygonGasOptions = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
4
|
const ethers_1 = require("ethers");
|
|
6
|
-
const
|
|
5
|
+
const shared_1 = require("@huma-finance/shared");
|
|
7
6
|
const chain_1 = require("./chain");
|
|
8
7
|
async function getPolygonGasOptions(network) {
|
|
9
8
|
let maxFeePerGas = ethers_1.ethers.BigNumber.from(40000000000); // fallback to 40 gwei
|
|
10
9
|
let maxPriorityFeePerGas = ethers_1.ethers.BigNumber.from(40000000000); // fallback to 40 gwei
|
|
11
10
|
try {
|
|
12
|
-
const url = network ===
|
|
13
|
-
? 'https://gasstation
|
|
14
|
-
: 'https://gasstation-
|
|
15
|
-
|
|
11
|
+
const url = network === shared_1.ChainEnum.Polygon
|
|
12
|
+
? 'https://gasstation.polygon.technology/v2'
|
|
13
|
+
: 'https://gasstation-testnet.polygon.technology/v2';
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
|
+
const data = await (0, shared_1.requestGet)(url);
|
|
16
16
|
maxFeePerGas = ethers_1.ethers.utils.parseUnits(`${Math.ceil(data.fast.maxFee)}`, 'gwei');
|
|
17
17
|
maxPriorityFeePerGas = ethers_1.ethers.utils.parseUnits(`${Math.ceil(data.fast.maxPriorityFee)}`, 'gwei');
|
|
18
18
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maticGasStation.js","sourceRoot":"","sources":["../../../src/utils/maticGasStation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"maticGasStation.js","sourceRoot":"","sources":["../../../src/utils/maticGasStation.ts"],"names":[],"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