@metamask-previews/transaction-controller 59.2.0-preview-332b557 → 59.2.0-preview-a89812f5

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/CHANGELOG.md CHANGED
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ### Added
11
+
12
+ - Add `isGasFeeSponsored` property to `TransactionMeta` type ([#6244](https://github.com/MetaMask/core/pull/6244))
13
+
10
14
  ### Changed
11
15
 
12
16
  - Bump `@metamask/controller-utils` from `^11.11.0` to `^11.12.0` ([#6303](https://github.com/MetaMask/core/pull/6303))
@@ -2100,6 +2100,7 @@ async function _TransactionController_approveTransaction(transactionId, traceCon
2100
2100
  tokenBalanceChanges: [],
2101
2101
  };
2102
2102
  let gasFeeTokens = [];
2103
+ let isGasFeeSponsored = false;
2103
2104
  const isBalanceChangesSkipped = __classPrivateFieldGet(this, _TransactionController_skipSimulationTransactionIds, "f").has(transactionId);
2104
2105
  if (__classPrivateFieldGet(this, _TransactionController_isSimulationEnabled, "f").call(this) && !isBalanceChangesSkipped) {
2105
2106
  simulationData = await __classPrivateFieldGet(this, _TransactionController_trace, "f").call(this, { name: 'Simulate', parentContext: traceContext }, () => (0, balance_changes_1.getBalanceChanges)({
@@ -2117,13 +2118,15 @@ async function _TransactionController_approveTransaction(transactionId, traceCon
2117
2118
  isUpdatedAfterSecurityCheck: true,
2118
2119
  };
2119
2120
  }
2120
- gasFeeTokens = await (0, gas_fee_tokens_1.getGasFeeTokens)({
2121
+ const gasFeeTokensResponse = await (0, gas_fee_tokens_1.getGasFeeTokens)({
2121
2122
  chainId,
2122
2123
  isEIP7702GasFeeTokensEnabled: __classPrivateFieldGet(this, _TransactionController_isEIP7702GasFeeTokensEnabled, "f"),
2123
2124
  messenger: this.messagingSystem,
2124
2125
  publicKeyEIP7702: __classPrivateFieldGet(this, _TransactionController_publicKeyEIP7702, "f"),
2125
2126
  transactionMeta,
2126
2127
  });
2128
+ gasFeeTokens = gasFeeTokensResponse?.gasFeeTokens ?? [];
2129
+ isGasFeeSponsored = gasFeeTokensResponse?.isGasFeeSponsored ?? false;
2127
2130
  }
2128
2131
  const latestTransactionMeta = __classPrivateFieldGet(this, _TransactionController_instances, "m", _TransactionController_getTransaction).call(this, transactionId);
2129
2132
  /* istanbul ignore if */
@@ -2137,6 +2140,7 @@ async function _TransactionController_approveTransaction(transactionId, traceCon
2137
2140
  skipResimulateCheck: Boolean(blockTime),
2138
2141
  }, (txMeta) => {
2139
2142
  txMeta.gasFeeTokens = gasFeeTokens;
2143
+ txMeta.isGasFeeSponsored = isGasFeeSponsored;
2140
2144
  if (!isBalanceChangesSkipped) {
2141
2145
  txMeta.simulationData = simulationData;
2142
2146
  }