Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: MetaMask/utils
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 68384c6
Choose a base ref
...
head repository: MetaMask/utils
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7f0116d
Choose a head ref
  • 14 commits
  • 37 files changed
  • 12 contributors

Commits on Jul 11, 2023

  1. Standardise repo per module template as of July 2023 (#115)

    * Standardise repo per module template as of July 2023
    
    * Fix some package-specific configs
    
    * Remove pull request template
    
    * Add pull request template again
    
    * Formatting
    Mrtenz authored Jul 11, 2023
    Configuration menu
    Copy the full SHA
    ab071ea View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2023

  1. Add getKnownPropertyNames (#111)

    This function has been copied from various projects, where it is common
    to transform an enum into another data structure. For instance:
    
    ```
    enum InfuraNetworkType {
      mainnet = 'mainnet',
      goerli = 'goerli',
      sepolia = 'sepolia',
    }
    
    const infuraNetworkClientConfigurations =
      Object.keys(InfuraNetworkType).map((network) => {
        const networkClientId = buildInfuraNetworkClientId(network);
        const networkClientConfiguration = {
          type: NetworkClientType.Infura,
          network,
          infuraProjectId: this.#infuraProjectId,
        };
        return [networkClientId, networkClientConfiguration];
      });
    ```
    
    As the above example, one could use `Object.keys()` or even
    `Object.getOwnPropertyNames()` to obtain said properties. A problem
    occurs, however, if the type of the properties of the resulting object
    needs to match the type of the properties in the enum, that means the
    variable inside the loop needs to be of that type, too. Both
    `Object.keys()` and `Object.getOwnPropertyNames()` are intentionally
    generic: they returns the property names of an object, but neither can
    make guarantees about the contents of that object, so the type of the
    property names is merely `string[]`. While this is technically accurate,
    we don't have to be so cautious in these situations, because we own
    the object in question and therefore know exactly which properties it
    has.
    
    This commit adds a `getKnownPropertyNames` function which is like
    `Object.getOwnPropertyNames()` except that the resulting array of
    property names will be typed using the types of the properties of the
    given object. In the above example that would mean that `network` would
    have a type of `InfuraNetworkType` and not `string`.
    
    Co-authored-by: Maarten Zuidhoorn <maarten@zuidhoorn.com>
    mcmire and Mrtenz authored Jul 13, 2023
    Configuration menu
    Copy the full SHA
    a1e5d90 View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2023

  1. Configuration menu
    Copy the full SHA
    614b27c View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2023

  1. Configuration menu
    Copy the full SHA
    942bcd8 View commit details
    Browse the repository at this point in the history

Commits on Jul 24, 2023

  1. BREAKING: Synchronise package with module template to fix ESM build (#…

    …124)
    
    * Synchronise package with module template to fix ESM build
    
    * Dedupe dependencies
    Mrtenz authored Jul 24, 2023
    Configuration menu
    Copy the full SHA
    d94d13c View commit details
    Browse the repository at this point in the history

Commits on Jul 25, 2023

  1. Bump semver to ensure signed provenance, CVE fix (#123)

    Co-authored-by: Craig Scheets <craig.scheets@consensys.io>
    x86NOP and Craig Scheets authored Jul 25, 2023
    Configuration menu
    Copy the full SHA
    a244fa9 View commit details
    Browse the repository at this point in the history
  2. 7.0.0 (#125)

    * 7.0.0
    
    * Update CHANGELOG.md
    
    * Update CHANGELOG.md
    
    ---------
    
    Co-authored-by: github-actions <github-actions@github.com>
    Co-authored-by: Maarten Zuidhoorn <maarten@zuidhoorn.com>
    3 people authored Jul 25, 2023
    Configuration menu
    Copy the full SHA
    e5bc219 View commit details
    Browse the repository at this point in the history

Commits on Aug 1, 2023

  1. Add Caip Types (#116)

    * add caip chain id
    
    * add parsing
    
    * Update parseCaipChainIdString behavior
    
    * lint
    
    * drop string suffix
    
    * Switch to @metamask/snap-utils caip types
    
    * lint
    
    * Separate regex const. Add CaipAccountAddressStruct
    
    * Add CaipAccountAddress specs
    
    * tighten types
    
    * remove unused types. cleanup specs. add fixtures
    
    * last bit
    jiexi authored Aug 1, 2023
    Configuration menu
    Copy the full SHA
    2653a1a View commit details
    Browse the repository at this point in the history
  2. 7.1.0 (#126)

    * 7.1.0
    
    * update changelog
    
    * Update CHANGELOG.md
    
    Co-authored-by: Shane <jonas.shane@gmail.com>
    
    ---------
    
    Co-authored-by: github-actions <github-actions@github.com>
    Co-authored-by: Jiexi Luan <jiexiluan@gmail.com>
    Co-authored-by: Shane <jonas.shane@gmail.com>
    4 people authored Aug 1, 2023
    Configuration menu
    Copy the full SHA
    4cffdd4 View commit details
    Browse the repository at this point in the history
  3. Fix changelog entry (#127)

    Update CHANGELOG.md
    Mrtenz authored Aug 1, 2023
    Configuration menu
    Copy the full SHA
    20bb059 View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2023

  1. Fix JsonRpcRequest to be valid json (#130)

    fix/types: JsonRpcParams should be valid JSON values
    
    `undefined` is not valid JSON.
    
    https://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf
    (Section 5):
    
        A JSON value can be an object, array, number, string, true, false, or null.
    legobeat authored Aug 28, 2023
    Configuration menu
    Copy the full SHA
    2c612ff View commit details
    Browse the repository at this point in the history
  2. 8.0.0 (#132)

    
    ---------
    
    Co-authored-by: github-actions <github-actions@github.com>
    Co-authored-by: legobt <6wbvkn0j@anonaddy.me>
    Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
    Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
    5 people authored Aug 28, 2023
    Configuration menu
    Copy the full SHA
    58b1611 View commit details
    Browse the repository at this point in the history

Commits on Aug 31, 2023

  1. fix(types): Optional JSON params where undefined is not valid (#134)

    * fix(types): Optional JSON params where undefined is not valid
    * Reduce type duplication by excluding `undefined`
    
    ---------
    
    Co-authored-by: Maarten Zuidhoorn <maarten@zuidhoorn.com>
    legobeat and Mrtenz authored Aug 31, 2023
    Configuration menu
    Copy the full SHA
    e8cad2f View commit details
    Browse the repository at this point in the history
  2. 8.1.0 (#137)

    Co-authored-by: Maarten Zuidhoorn <maarten@zuidhoorn.com>
    
    ---------
    
    Co-authored-by: github-actions <github-actions@github.com>
    Co-authored-by: legobt <6wbvkn0j@anonaddy.me>
    Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
    Co-authored-by: Maarten Zuidhoorn <maarten@zuidhoorn.com>
    5 people authored Aug 31, 2023
    Configuration menu
    Copy the full SHA
    7f0116d View commit details
    Browse the repository at this point in the history
Loading