251 Commits

Author SHA1 Message Date
dependabot[bot]
254a66cf5f Bump @metamask/eth-sig-util from 5.0.0 to 5.0.2 (#161)
Bumps [@metamask/eth-sig-util](https://github.com/MetaMask/eth-sig-util) from 5.0.0 to 5.0.2.
- [Release notes](https://github.com/MetaMask/eth-sig-util/releases)
- [Changelog](https://github.com/MetaMask/eth-sig-util/blob/main/CHANGELOG.md)
- [Commits](https://github.com/MetaMask/eth-sig-util/compare/v5.0.0...v5.0.2)

---
updated-dependencies:
- dependency-name: "@metamask/eth-sig-util"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-21 10:08:08 -03:30
Todd
db769bdb5f Update README.md (#158)
Fix link to https://github.com/MetaMask/eth-json-rpc-infura
2022-10-25 18:27:10 -02:30
github-actions[bot]
c4d0bf8e09 9.0.1 (#155)
* 9.0.1

* Update changelog

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2022-10-05 14:31:01 -02:30
Elliot Winkler
7060750d50 Bump @metamask/eth-sig-util to 5.0.0 (#150)
It seems that we only use `recoverPersonalSignature` from
`eth-sig-util`, so the recent changes around `@ethereumjs/util` do not
seem to affect this library.

Co-authored-by: Mark Stacey <markjstacey@gmail.com>
2022-10-05 10:33:43 -02:30
Elliot Winkler
34c0d73cd4 Align/refactor retryOnEmpty & block-ref tests (#154)
These tests share similar test helpers and are written in similar
styles, so this commit extracts and consolidates those helpers and
tweaks the tests so they look more similar.
2022-10-05 10:30:17 -02:30
Elliot Winkler
0c31e01605 Update block-ref to not make duplicate request (#151)
The goal of the `block-ref` middleware is to look for instances in
request parameters where "latest" is being used as a block parameter and
replace it with the actual latest block number (as reported by the block
tracker). The middleware will then make a child request through the
provider using the resolved parameters and copy the child response onto
the final response object.

That is fine; however, this middleware then calls the next middleware in
the stack, which in practice will make another request, and that will
end up overwriting the child response set in this middleware. That makes
this middleware ineffective.

So, this commit removes the `next()` call from the `block-ref`
middleware so that when it takes effect it stops the chain and prevents
an extra request.

In addition, this fills in missing tests for the middleware.
2022-10-03 10:45:03 -06:00
Elliot Winkler
c969a6f678 Apply standardizations from module template (#145)
* Upgrade to Yarn 3.x
* Move test files into `src/` instead of keeping them in `test/`
* Convert Jest config file back to JavaScript
* Add `eslint-plugin-jest` to lint pipeline, and correct issues
* Extract build-only config from `tsconfig.json`
* Standardize `package.json`
  * Don't add `jest-it-up` to the `test` command because there is
    currently an inconsistency between different Node versions (14.x and
    16.x) which may have to do with global `fetch`
* Upgrade `@metamask/allow-scripts` to 2.x
* Upgrade `@metamask/utils` to ^3.0.3
2022-09-29 11:07:10 -06:00
Elliot Winkler
13d055e567 Fix bugs in retryOnEmpty middleware (#147)
When this package was converted to TypeScript, two bugs were introduced
in the `retryOnEmpty` middleware.

* The goal of this middleware is to retry requests to the network that
return responses whose `result` property is empty in some way, but after
the TypeScript conversion, we were checking whether the whole *response*
object was empty rather than just the `result`. This never happens in
practice, so it ended up making the middleware ineffective.
* Additionally, after retrying the request, the middleware fell through
to the next middleware, which in practice is the middleware that makes a
request to Infura. This meant that later middleware overwrote the
results of the `retryOnEmpty` middleware, also making it ineffective.

This commit restores the functionality prior to the TypeScript
conversion and adds tests to confirm.
2022-09-29 10:01:57 -06:00
Kevin Ji
53c7361944 Upgrade to @metamask/eth-sig-util v4 and remove unused deps (#133) 2022-08-23 14:23:01 -06:00
github-actions[bot]
41c54f94e3 9.0.0 (#141) 2022-08-22 16:46:01 -06:00
Elliot Winkler
147090e597 Add logging (#140)
We want to add logging to the RPC layer in the extension to help with
debugging while writing tests. This helps us achieve that.
2022-08-22 15:54:55 -06:00
Bowen Sanders
9e305fe466 Bump Node to v14 (#137)
* bump to node v14
2022-08-16 13:37:31 -07:00
github-actions[bot]
25a7c4bcb0 8.1.0 (#129) 2022-04-29 15:14:16 -06:00
Elliot Winkler
1f8f2648a8 Expose SafeEventEmitterProvider type (#127)
Not all of the types within `./src/utils/cache.ts` seemed to be solely
related to caching. These have been extracted to a separate file, and
the main file has been updated to export `SafeEventEmitterProvider` from
this file.
2022-04-28 11:59:57 -06:00
Elliot Winkler
75b4aef623 Move eth-block-tracker to dependencies (#125)
We are attempting to convert `eth-json-rpc-infura`, which relies on this
package, to TypeScript, and TypeScript is reporting errors resolving the
definition file for this package due to the types for
`eth-block-tracker` not being properly available. Moving it to
`dependencies` addresses this.
2022-04-27 13:55:44 -06:00
Erik Marks
27a93271ed Fix prepublishOnly script (#124)
The `prepublishOnly` script was referencing a package script that no longer exists and, judging by its name, would be unnecessary anyway.
2022-04-27 11:11:00 -07:00
github-actions[bot]
fa67ae68ac 8.0.2 (#122)
* 8.0.2

* Update CHANGELOG.md

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Shane <jonas.shane@gmail.com>
Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
2022-04-27 11:02:32 -07:00
Shane
86915dc1a2 Added getAccounts suppressUnauthorized param (#116)
* Added getAccounts suppressUnauthorized param

* Fixed linting

* Update src/wallet.ts

Co-authored-by: Shane <jonas.shane@gmail.com>

* Added unauthorized error when account is provided but is not returned from getAccounts

* Added tests for unauthorized

* Update test/wallet.test.ts

Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>

* Update test/wallet.test.ts

Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>

* Update test/wallet.test.ts

Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>

* Update test/wallet.test.ts

Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>

* Fixed linting

* Fixed signTransaction test

* Changed param to object

Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
2022-04-27 09:07:18 -07:00
dependabot[bot]
daa426dc65 Bump async from 2.6.0 to 2.6.4 (#121)
Bumps [async](https://github.com/caolan/async) from 2.6.0 to 2.6.4.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/v2.6.4/CHANGELOG.md)
- [Commits](https://github.com/caolan/async/compare/v2.6.0...v2.6.4)

---
updated-dependencies:
- dependency-name: async
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-19 13:47:40 -06:00
Shane
946ebc4085 Changed tests to jest + ts (#118)
* Changed tests to ts

* Fixed yarn.lock

* Fixed yarn.lock again

* Fixed minimum coverage threshold

* Update test/block-ref.test.ts

* Update test/block-ref.test.ts

* Update test/block-ref.test.ts

* Fixed types and unused variables

* Fixed types for provider

* Removed polling interval for BlockTracker

* Fixed type with PayloadWithOrigin

* Removed test:nobuild npm script

* Fixed up jest commands

* Fixed test naming to be behavioural

* Fixed coverage thresholds

* Fixed types
2022-04-19 08:30:24 -07:00
dependabot[bot]
4ed0deb21e Bump ajv from 6.10.2 to 6.12.6 (#114)
Bumps [ajv](https://github.com/ajv-validator/ajv) from 6.10.2 to 6.12.6.
- [Release notes](https://github.com/ajv-validator/ajv/releases)
- [Commits](https://github.com/ajv-validator/ajv/compare/v6.10.2...v6.12.6)

---
updated-dependencies:
- dependency-name: ajv
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-06 11:53:49 -06:00
dependabot[bot]
aaeccc4916 Bump simple-get from 2.8.1 to 2.8.2 (#120)
Bumps [simple-get](https://github.com/feross/simple-get) from 2.8.1 to 2.8.2.
- [Release notes](https://github.com/feross/simple-get/releases)
- [Commits](https://github.com/feross/simple-get/compare/v2.8.1...v2.8.2)

---
updated-dependencies:
- dependency-name: simple-get
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-06 11:50:53 -06:00
dependabot[bot]
f4ad893530 Bump minimist from 1.2.5 to 1.2.6 (#117)
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-06 11:45:23 -06:00
wbt
9c24f60191 Update node-fetch minimum (#115)
Per GHSA-r683-j2x4-v87g
2022-04-06 11:42:36 -06:00
github-actions[bot]
eb649a8d3f 8.0.1 (#110) 2021-12-07 14:03:53 -03:30
Shude Li
ce69943d43 fix: add query parameters to normalized url (#109) 2021-12-07 13:15:40 -03:30
github-actions[bot]
09290a74aa 8.0.0 (#107)
* 8.0.0

* Update CHANGELOG.md

Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
2021-11-05 11:22:09 -07:00
Erik Marks
7edef2fd6e Add release automation, fix repo standardization issues (#105)
Standardizes the repo per the MetaMask module template and adds release automation and CI via GitHub Actions.
2021-11-04 16:12:40 -07:00
dependabot[bot]
04e86d9353 Bump path-parse from 1.0.6 to 1.0.7 (#100)
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-02 12:01:22 -02:30
dependabot[bot]
ce974249d1 Bump tar from 4.4.15 to 4.4.19 (#101)
Bumps [tar](https://github.com/npm/node-tar) from 4.4.15 to 4.4.19.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-tar/compare/v4.4.15...v4.4.19)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-02 11:53:34 -02:30
dependabot[bot]
3ce2653a5e Bump tar from 4.4.10 to 4.4.15 (#98)
Bumps [tar](https://github.com/npm/node-tar) from 4.4.10 to 4.4.15.
- [Release notes](https://github.com/npm/node-tar/releases)
- [Changelog](https://github.com/npm/node-tar/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-tar/compare/v4.4.10...v4.4.15)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-05 14:07:11 -02:30
Prem Ratan Baranwal
5c4950fd22 added support for send call with callback so that Web3 Providers can be used (#97)
Co-authored-by: Prem Baranwal <premb@talentica.com>
2021-07-29 14:48:04 -02:30
Prem Ratan Baranwal
a0668c2b95 Add support for eth_signTransaction so that external key stores can be used for signing (#96)
* added support for sendAsync call so that a Web3.Providers.HttpProvider or Web3.Providers.WebsocketProvider can be used.

* Revert "added support for sendAsync call so that a Web3.Providers.HttpProvider or Web3.Providers.WebsocketProvider can be used."

This reverts commit 12b5dd89ffb57a15a709bac18985bc7b9cda43ce so that two separate commits can be done and one can be merged to upstream repo.

* Add support for eth_signTransaction

* 1. renamed processEthSignTransactionMessage to processSignTransaction and moved it after processTransaction as its very similar to that. 2. Added some signTransactionTest testcases

Co-authored-by: Prem Baranwal <premb@talentica.com>
2021-07-29 11:25:31 -02:30
dependabot[bot]
8981749903 Bump glob-parent from 5.1.1 to 5.1.2 (#95)
Bumps [glob-parent](https://github.com/gulpjs/glob-parent) from 5.1.1 to 5.1.2.
- [Release notes](https://github.com/gulpjs/glob-parent/releases)
- [Changelog](https://github.com/gulpjs/glob-parent/blob/main/CHANGELOG.md)
- [Commits](https://github.com/gulpjs/glob-parent/compare/v5.1.1...v5.1.2)

---
updated-dependencies:
- dependency-name: glob-parent
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-11 03:35:10 -02:30
dependabot[bot]
669f83074d Bump normalize-url from 4.3.0 to 4.5.1 (#94)
Bumps [normalize-url](https://github.com/sindresorhus/normalize-url) from 4.3.0 to 4.5.1.
- [Release notes](https://github.com/sindresorhus/normalize-url/releases)
- [Commits](https://github.com/sindresorhus/normalize-url/commits)

---
updated-dependencies:
- dependency-name: normalize-url
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-06-10 21:59:09 -07:00
dependabot[bot]
09edfb047b Bump hosted-git-info from 2.8.4 to 2.8.9 (#93)
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.4 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.4...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-11 13:50:31 -02:30
ryanml
cdd03a1a4b Repo standardization (#90)
* Enforcing minimum node version 12 via .nvmrc, circleci, and package file
* Adding basic .gitattributes file
* Adding entry about running tests to the readme
2021-04-05 14:32:40 -07:00
Erik Marks
3a8929970f 7.0.1 (#89)
* 7.0.1

* Update changelog
2021-03-26 14:51:05 -07:00
Erik Marks
5dfa661262 Fix blockTrackerInspectorMiddleware (#88)
The final line of this middleware should be `return undefined;`, not `return await next();`, as `next()` is already called earlier in the function.
2021-03-26 14:48:38 -07:00
Erik Marks
c7a5602e55 Add missing changelog entry (#87) 2021-03-26 14:46:05 -07:00
Erik Marks
ad210bda85 Add prepublishOnly script (#86) 2021-03-25 17:41:25 -07:00
Erik Marks
4bf56fc926 7.0.0 (#85)
* 7.0.0

* Update package.json

* Update README.md

* Update CHANGELOG.md
2021-03-25 17:36:14 -07:00
Erik Marks
fc1fd5dba0 Use named exports, add index.ts (#81)
* Move cache-utils to separate folder
2021-03-25 16:53:03 -07:00
Erik Marks
423da2b8aa Add config to ignore btoa dependency in browser environments (#84) 2021-03-25 16:37:04 -07:00
Erik Marks
e373a787f9 Fix DOM TypeScript library usage (#83)
* Fix DOM lib usage

* Remove triple-slash directive exception from eslint config
2021-03-25 16:34:42 -07:00
Erik Marks
7bcba43f9e Update eslint, CI, TypeScript configs (#82)
* Update eslint and TypeScript configs, lint

* Update CI config

* Add test:nobuild command
2021-03-25 15:49:59 -07:00
Brad Decker
59f8af65f7 remove unused dependencies (#80) 2021-03-25 15:55:21 -05:00
Erik Marks
db83918f01 eth-block-tracker@5.0.1 (#79)
- `eth-block-tracker@5.0.1`
  - New major version
  - Updates imports
  - No behavioral changes
2021-03-25 11:02:49 -07:00
Erik Marks
a40713e5df Add config to exclude node-fetch in browser builds (#78) 2021-03-23 14:07:22 -07:00
Niranjana Binoy
222c95db7b Add interfaces for msgParams in wallet middleware (#77)
Co-authored-by: Erik Marks <25517051+rekmarks@users.noreply.github.com>
2021-03-23 13:44:27 -07:00