@wagmi/core 0.3.4 → 0.3.5

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.
@@ -8,9 +8,9 @@ export declare type FetchFeeDataArgs = {
8
8
  };
9
9
  export declare type FetchFeeDataResult = providers.FeeData & {
10
10
  formatted: {
11
- gasPrice: string;
12
- maxFeePerGas: string;
13
- maxPriorityFeePerGas: string;
11
+ gasPrice: string | null;
12
+ maxFeePerGas: string | null;
13
+ maxPriorityFeePerGas: string | null;
14
14
  };
15
15
  };
16
16
  export declare function fetchFeeData({ chainId, formatUnits: units, }?: FetchFeeDataArgs): Promise<FetchFeeDataResult>;
@@ -627,9 +627,9 @@ async function fetchFeeData() {
627
627
  });
628
628
  const feeData = await provider.getFeeData();
629
629
  const formatted = {
630
- gasPrice: utils.formatUnits(feeData.gasPrice, units),
631
- maxFeePerGas: utils.formatUnits(feeData.maxFeePerGas, units),
632
- maxPriorityFeePerGas: utils.formatUnits(feeData.maxPriorityFeePerGas, units)
630
+ gasPrice: feeData.gasPrice ? utils.formatUnits(feeData.gasPrice, units) : null,
631
+ maxFeePerGas: feeData.maxFeePerGas ? utils.formatUnits(feeData.maxFeePerGas, units) : null,
632
+ maxPriorityFeePerGas: feeData.maxPriorityFeePerGas ? utils.formatUnits(feeData.maxPriorityFeePerGas, units) : null
633
633
  };
634
634
  return { ...feeData,
635
635
  formatted
@@ -627,9 +627,9 @@ async function fetchFeeData() {
627
627
  });
628
628
  const feeData = await provider.getFeeData();
629
629
  const formatted = {
630
- gasPrice: utils.formatUnits(feeData.gasPrice, units),
631
- maxFeePerGas: utils.formatUnits(feeData.maxFeePerGas, units),
632
- maxPriorityFeePerGas: utils.formatUnits(feeData.maxPriorityFeePerGas, units)
630
+ gasPrice: feeData.gasPrice ? utils.formatUnits(feeData.gasPrice, units) : null,
631
+ maxFeePerGas: feeData.maxFeePerGas ? utils.formatUnits(feeData.maxFeePerGas, units) : null,
632
+ maxPriorityFeePerGas: feeData.maxPriorityFeePerGas ? utils.formatUnits(feeData.maxPriorityFeePerGas, units) : null
633
633
  };
634
634
  return { ...feeData,
635
635
  formatted
@@ -626,9 +626,9 @@ async function fetchFeeData() {
626
626
  });
627
627
  const feeData = await provider.getFeeData();
628
628
  const formatted = {
629
- gasPrice: formatUnits(feeData.gasPrice, units),
630
- maxFeePerGas: formatUnits(feeData.maxFeePerGas, units),
631
- maxPriorityFeePerGas: formatUnits(feeData.maxPriorityFeePerGas, units)
629
+ gasPrice: feeData.gasPrice ? formatUnits(feeData.gasPrice, units) : null,
630
+ maxFeePerGas: feeData.maxFeePerGas ? formatUnits(feeData.maxFeePerGas, units) : null,
631
+ maxPriorityFeePerGas: feeData.maxPriorityFeePerGas ? formatUnits(feeData.maxPriorityFeePerGas, units) : null
632
632
  };
633
633
  return { ...feeData,
634
634
  formatted
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@wagmi/core",
3
3
  "description": "Vanilla JS library for Ethereum",
4
4
  "license": "WAGMIT",
5
- "version": "0.3.4",
5
+ "version": "0.3.5",
6
6
  "repository": "tmm/wagmi",
7
7
  "author": "awkweb.eth",
8
8
  "ethereum": "awkweb.eth",