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: b217ca1
Choose a base ref
...
head repository: MetaMask/utils
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4cffdd4
Choose a head ref
  • 19 commits
  • 47 files changed
  • 15 contributors

Commits on Apr 26, 2023

  1. Standardise repo per module template as of April 2023 (#102)

    * Standardise repo per module template as of April 2023
    
    * Fix test script
    
    * Fix test workflow
    
    * Add further standardisation
    Mrtenz authored Apr 26, 2023
    Configuration menu
    Copy the full SHA
    d4a9d2e View commit details
    Browse the repository at this point in the history

Commits on May 30, 2023

  1. First part of a solution for fixing JSON validation security issue (#103

    )
    
    * Add changes as part of a solution for fixing JSON validation security issue
    
    * Remove unused fixtures
    
    * Refactor solution according to review comments
    
    * Add generic types
    
    * Refactor code (1)
    
    * Refactor code (2 - update function name)
    
    * Refactor code (3 - update test)
    
    * Fix docstring
    
    * Add Json type extension for getSafeJson
    david0xd authored May 30, 2023
    Configuration menu
    Copy the full SHA
    68ef1a9 View commit details
    Browse the repository at this point in the history

Commits on May 31, 2023

  1. 6.0.0 (#104)

    * 5.0.3
    
    * Update CHANGELOG.md
    
    * Update CHANGELOG.md and change to major version
    
    ---------
    
    Co-authored-by: github-actions <github-actions@github.com>
    Co-authored-by: david0xd <david@timechaser.org>
    3 people authored May 31, 2023
    Configuration menu
    Copy the full SHA
    719854b View commit details
    Browse the repository at this point in the history

Commits on Jun 14, 2023

  1. Strip __proto__ and constructor JSON properties in getSafeJson (#…

    …105)
    
    Strip __proto__ and constructor JSON properties
    FrederikBolding authored Jun 14, 2023
    Configuration menu
    Copy the full SHA
    2148af4 View commit details
    Browse the repository at this point in the history
  2. 6.0.1 (#106)

    * 6.0.1
    
    * Update CHANGELOG
    
    ---------
    
    Co-authored-by: github-actions <github-actions@github.com>
    Co-authored-by: Frederik Bolding <frederik.bolding@gmail.com>
    3 people authored Jun 14, 2023
    Configuration menu
    Copy the full SHA
    b59adde View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2023

  1. Add optional destroy method to Keyring type (#108)

    feat: add optional destroy method to keyring
    mikesposito authored Jun 20, 2023
    Configuration menu
    Copy the full SHA
    e263d07 View commit details
    Browse the repository at this point in the history
  2. 6.1.0 (#109)

    * 6.1.0
    
    * docs: add change category
    
    ---------
    
    Co-authored-by: github-actions <github-actions@github.com>
    Co-authored-by: Michele Esposito <michele.esposito@consensys.net>
    3 people authored Jun 20, 2023
    Configuration menu
    Copy the full SHA
    1daaa37 View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2023

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

Commits on Jul 11, 2023

  1. Add address related utils (#112)

    * feat: add isValidHexAddress function
    
    * fix: accept only prefixed addresses
    
    * fix: remove case insensitive flag
    
    * test: add test case for 0X
    
    * feat: validate checksum addresses
    
    * feat: break out address checksum encoding to erc55EncodeAddress function (#113)
    
    * feat: break out address checksum encoding to erc55EncodeAddress function
    
    * deps: ethereum-cryptography@2.0.0->2.1.0; dedupe @noble/hashes
    
    * Update jsdoc
    
    Co-authored-by: Maarten Zuidhoorn <maarten@zuidhoorn.com>
    
    * refactor: rename erc55EncodeAddress function
    
    * test: add test cases for getChecksumAddress
    
    ---------
    
    Co-authored-by: Maarten Zuidhoorn <maarten@zuidhoorn.com>
    Co-authored-by: Michele Esposito <michele@esposito.codes>
    
    * docs: edit isValidHexAddress jsdoc description
    
    * Update src/hex.ts
    
    Co-authored-by: Mark Stacey <markjstacey@gmail.com>
    
    * fix: add validation assertions
    
    ---------
    
    Co-authored-by: legobeat <109787230+legobeat@users.noreply.github.com>
    Co-authored-by: Maarten Zuidhoorn <maarten@zuidhoorn.com>
    Co-authored-by: Mark Stacey <markjstacey@gmail.com>
    4 people authored Jul 11, 2023
    Configuration menu
    Copy the full SHA
    f1024ca View commit details
    Browse the repository at this point in the history
  2. 6.2.0 (#114)

    github-actions[bot] authored Jul 11, 2023
    Configuration menu
    Copy the full SHA
    68384c6 View commit details
    Browse the repository at this point in the history
  3. 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
Loading