Skip to content

Conversation

MajorLift
Copy link
Contributor

@MajorLift MajorLift commented Jun 24, 2024

Explanation

The changes introduced in superstruct v2.0.0-0 don't enable us to go back to using superstruct.

To demonstrate, I created a repro branch where all dependencies and nested dependencies are forced to use superstruct v2.0.0-0 via yarn resolutions.

In the ci build run results, we still see a large number of the following error for type imports when Node{16,Next} is enabled:

error TS1479: The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'.

https://github.com/MetaMask/core/actions/runs/9654219968/job/26628058963?pr=4458

The reason for this is that our libraries are CJS and superstruct is ESM, and with Node{16,Next} enabled, a CJS project can only import types from an ESM project if it exports type declarations files that are unambiguously specified as .d.cts. Ambiguous .ts and .d.ts files that are interoperable between CJS/ESM are no longer supported in Node{16,Next}.

References

@MajorLift MajorLift self-assigned this Jul 17, 2024
@MajorLift MajorLift added the team-wallet-framework Deprecated: Please use `team-core-platform` instead. label Jul 17, 2024
@MajorLift MajorLift closed this Jul 19, 2024
@MajorLift MajorLift reopened this Jul 27, 2024

This comment was marked as resolved.

Copy link

socket-security bot commented Jul 27, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: npm/@aashutoshrathi/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@babel/[email protected], npm/@eslint-community/[email protected], npm/@jridgewell/[email protected], npm/@lavamoat/[email protected], npm/@lavamoat/[email protected], npm/@metamask/[email protected], npm/@noble/[email protected], npm/@npmcli/[email protected], npm/@npmcli/[email protected], npm/@npmcli/[email protected], npm/@npmcli/[email protected], npm/@scure/[email protected], npm/@scure/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@types/[email protected], npm/@vue/[email protected], npm/@vue/[email protected], npm/@vue/[email protected], npm/@vue/[email protected], npm/@vue/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected], npm/[email protected]

View full report↗︎

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/[email protected] or ignore all packages with @SocketSecurity ignore-all

@MajorLift
Copy link
Contributor Author

@SocketSecurity ignore-all

@MajorLift MajorLift closed this Aug 14, 2024
matthewwalsh0 added a commit that referenced this pull request Mar 25, 2025
## Explanation

Retrieve the available gas fee tokens from the simulation API when
adding a transaction, and save them in the transaction metadata.

Specifically:

- Add `gasFeeTokens` to `TransactionMetadata`.
- Add `selectedGasFeeToken` to `TransactionMetadata`.
- Add additional request and response properties to types in
`utils/simulation-api.ts`.
- Update `utils/simulation.ts` to parse the gas fee tokens from the
response.

## References

Fixes [#4458](MetaMask/MetaMask-planning#4458)

## Changelog

See `CHANGELOG.md`.

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've highlighted breaking changes using the "BREAKING" category
above as appropriate
- [x] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-wallet-framework Deprecated: Please use `team-core-platform` instead.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant