@metamask-previews/transaction-controller 59.0.0-preview-7509efdb → 59.0.0-preview-bd86fa14

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
@@ -9,7 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ### Added
11
11
 
12
- - Add `fiatValue` property on `addTransaction` options ([#6178](https://github.com/MetaMask/core/pull/6178))
12
+ - Add `assetsFiatValues` property on `addTransaction` options ([#6178](https://github.com/MetaMask/core/pull/6178))
13
+ - `assetsFiatValues.sending` is total fiat value of sent assets
14
+ - `assetsFiatValues.receiving` is total fiat value of recieved assets
13
15
 
14
16
  ### Fixed
15
17
 
@@ -360,10 +360,10 @@ class TransactionController extends base_controller_1.BaseController {
360
360
  * @param txParams - Standard parameters for an Ethereum transaction.
361
361
  * @param options - Additional options to control how the transaction is added.
362
362
  * @param options.actionId - Unique ID to prevent duplicate requests.
363
+ * @param options.assetsFiatValues - The fiat values of the assets in the transaction.
363
364
  * @param options.batchId - A custom ID for the batch this transaction belongs to.
364
365
  * @param options.deviceConfirmedOn - An enum to indicate what device confirmed the transaction.
365
366
  * @param options.disableGasBuffer - Whether to disable the gas estimation buffer.
366
- * @param options.fiatValue - The fiat value of the transaction to be used to passed metrics.
367
367
  * @param options.method - RPC method that requested the transaction.
368
368
  * @param options.nestedTransactions - Params for any nested transactions encoded in the data.
369
369
  * @param options.origin - The origin of the transaction request, such as a dApp hostname.
@@ -381,7 +381,7 @@ class TransactionController extends base_controller_1.BaseController {
381
381
  */
382
382
  async addTransaction(txParams, options) {
383
383
  (0, logger_1.projectLogger)('Adding transaction', txParams, options);
384
- const { actionId, batchId, deviceConfirmedOn, disableGasBuffer, fiatValue, method, nestedTransactions, networkClientId, origin, publishHook, requireApproval, securityAlertResponse, sendFlowHistory, swaps = {}, traceContext, type, } = options;
384
+ const { actionId, assetsFiatValues, batchId, deviceConfirmedOn, disableGasBuffer, method, nestedTransactions, networkClientId, origin, publishHook, requireApproval, securityAlertResponse, sendFlowHistory, swaps = {}, traceContext, type, } = options;
385
385
  txParams = (0, utils_2.normalizeTransactionParams)(txParams);
386
386
  if (!__classPrivateFieldGet(this, _TransactionController_multichainTrackingHelper, "f").has(networkClientId)) {
387
387
  throw new Error(`Network client not found - ${networkClientId}`);
@@ -425,13 +425,13 @@ class TransactionController extends base_controller_1.BaseController {
425
425
  : {
426
426
  // Add actionId to txMeta to check if same actionId is seen again
427
427
  actionId,
428
+ assetsFiatValues,
428
429
  batchId,
429
430
  chainId,
430
431
  dappSuggestedGasFees,
431
432
  delegationAddress,
432
433
  deviceConfirmedOn,
433
434
  disableGasBuffer,
434
- fiatValue,
435
435
  id: (0, uuid_1.v1)(),
436
436
  isFirstTimeInteraction: undefined,
437
437
  nestedTransactions,