diff --git a/package.json b/package.json index 648eebd..21f8041 100644 --- a/package.json +++ b/package.json @@ -55,11 +55,11 @@ "@babel/cli": "^7.23.0", "@babel/core": "^7.23.0", "@babel/preset-env": "^7.23.2", + "@metamask/ethjs": "^0.6.0", "babelify": "^10.0.0", "browserify": "^17.0.0", "eslint": "^6.2.0", "ethereum-cryptography": "^2.1.2", - "ethjs": "^0.3.6", "ganache-core": "^2.13.2", "tape": "^5.7.1" }, diff --git a/yarn.lock b/yarn.lock index 008e52f..82d7e5f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1583,6 +1583,89 @@ tweetnacl "^1.0.3" tweetnacl-util "^0.15.1" +"@metamask/ethjs-contract@^0.4.1": + version "0.4.1" + resolved "https://registry.yarnpkg.com/@metamask/ethjs-contract/-/ethjs-contract-0.4.1.tgz#afdbc4c75c4c8ca5cbe11cffbafada999abe30e8" + integrity sha512-QU/SQ6ZUZYzxNo81VzHtyJoFb11gZCHk6tnMSNv1OgPCJui2DKsfgk+VIJHaarL9gUohYNDYkjnAvwafyKiJSA== + dependencies: + "@metamask/ethjs-filter" "^0.3.0" + "@metamask/ethjs-util" "^0.3.0" + ethjs-abi "^0.2.0" + js-sha3 "^0.9.2" + promise-to-callback "^1.0.0" + +"@metamask/ethjs-filter@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@metamask/ethjs-filter/-/ethjs-filter-0.3.0.tgz#25340e00ec1bc7b04302b3cb5907d327316c7ca5" + integrity sha512-uXTIsJXQhMylX/cs2Z5J4hVVLTajoWOw+dVwLjWt221HO/pwWATJSjpMYsdWQul0slLSLQMIYlFUGOtDxZkh+Q== + +"@metamask/ethjs-format@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@metamask/ethjs-format/-/ethjs-format-0.3.0.tgz#d63642a0a9fa4ff41717e3a92f6cfc35b72b2cd3" + integrity sha512-Q0FhY/e7XYmP4y7qMhM3Fv86Z0kO+mont8BqBogDMOMvSa8bzjPy94XRKHarIcYICyCL9Kp2zGHVTuQR2J+JtA== + dependencies: + "@metamask/ethjs-util" "^0.3.0" + "@metamask/number-to-bn" "^1.7.1" + bn.js "^5.2.1" + ethjs-schema "0.2.1" + is-hex-prefixed "1.0.0" + strip-hex-prefix "1.0.0" + +"@metamask/ethjs-provider-http@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@metamask/ethjs-provider-http/-/ethjs-provider-http-0.3.0.tgz#7b86ccc5220e8c0c29cceef4172450da880699aa" + integrity sha512-t4dHYDSXMJZc46SwTgbcXYWs4uzb311dzHe730ZKR0BiPbos8oc9+toMw43w+ziqymhAdIbYIXo3hXX3dw7tOw== + dependencies: + xhr2 "0.2.1" + +"@metamask/ethjs-query@^0.7.1": + version "0.7.1" + resolved "https://registry.yarnpkg.com/@metamask/ethjs-query/-/ethjs-query-0.7.1.tgz#fd4e6afd3b42258ad073906c7303b14ae9cf9ba2" + integrity sha512-ctyFom36AHq/6TW1CECOB0m/ESxVD24szkeLXFOnJ/5mlICA5bUEC62AUedAEF8pqVgbxhDkr1gwEwXn6W/j0Q== + dependencies: + "@metamask/ethjs-format" "^0.3.0" + "@metamask/ethjs-rpc" "^0.4.0" + promise-to-callback "^1.0.0" + +"@metamask/ethjs-rpc@^0.4.0": + version "0.4.0" + resolved "https://registry.yarnpkg.com/@metamask/ethjs-rpc/-/ethjs-rpc-0.4.0.tgz#de4d4c74b6fb6c5d32d3cb55c645dd5bc3ada65a" + integrity sha512-lKTQfIXOyWsbGf9QqGaA6RnLcyvEeBPk5kAs1dXfWDpWL8+9TE0PbhPDQGjfn5Z9MFWEelJ2HD251wk0jAxD2A== + dependencies: + promise-to-callback "^1.0.0" + +"@metamask/ethjs-unit@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@metamask/ethjs-unit/-/ethjs-unit-0.3.0.tgz#d44d21d3b4ad443fb0cdd0362ea07c6f51e68ec4" + integrity sha512-HZtg69ODXYS9+ovKUYofZuIAwq4fc2/MGazD4vBQRKWMhPu4ySdmgR0EuzbxEK4uhr18KA4pbL+mCYjyjGxY7w== + dependencies: + "@metamask/number-to-bn" "^1.7.1" + bn.js "^5.2.1" + +"@metamask/ethjs-util@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@metamask/ethjs-util/-/ethjs-util-0.3.0.tgz#dcb56c85ea29e951a70ebf4213fb091a41c975fd" + integrity sha512-BXOEPmzDAzbsizZSW/wRW+58FBfj3K/1/jd7pZ9mKCOwlUCqhv8nyiiGTXQItRo+PH+GeuRGiR/IxuvSfw3CnQ== + dependencies: + is-hex-prefixed "1.0.0" + strip-hex-prefix "1.0.0" + +"@metamask/ethjs@^0.6.0": + version "0.6.0" + resolved "https://registry.yarnpkg.com/@metamask/ethjs/-/ethjs-0.6.0.tgz#41cf561cbfa9d516da803cd67793107ac32452ba" + integrity sha512-CNG3vsj3ArhEhpkEK6+yUDbSgOJCtaALf+XEZXFhYbgVHPsVkhj9hSd+LInhUMrq4ViHAR7MZVt2RCb2npqppg== + dependencies: + "@metamask/ethjs-contract" "^0.4.1" + "@metamask/ethjs-filter" "^0.3.0" + "@metamask/ethjs-provider-http" "^0.3.0" + "@metamask/ethjs-query" "^0.7.1" + "@metamask/ethjs-unit" "^0.3.0" + "@metamask/ethjs-util" "^0.3.0" + "@metamask/number-to-bn" "1.7.1" + bn.js "5.2.1" + ethjs-abi "0.2.1" + js-sha3 "^0.9.2" + "@metamask/json-rpc-engine@^7.1.0", "@metamask/json-rpc-engine@^7.1.1": version "7.1.1" resolved "https://registry.yarnpkg.com/@metamask/json-rpc-engine/-/json-rpc-engine-7.1.1.tgz#90d4c1e1fe3bcfc983563f6e07715319b8857190" @@ -1592,6 +1675,14 @@ "@metamask/safe-event-emitter" "^3.0.0" "@metamask/utils" "^8.1.0" +"@metamask/number-to-bn@1.7.1", "@metamask/number-to-bn@^1.7.1": + version "1.7.1" + resolved "https://registry.yarnpkg.com/@metamask/number-to-bn/-/number-to-bn-1.7.1.tgz#a449ec8b2edba211e0dc3e1e0428ff2cc2bf7ab4" + integrity sha512-qCN+Au4amvcVii2LdOJNndYhdmk5Lk9tlStJhKpZ8tGeYQDJTghqYXJuSUVPHvfl6FUfKY1i1Or2j2EbnEerSQ== + dependencies: + bn.js "5.2.1" + strip-hex-prefix "1.0.0" + "@metamask/rpc-errors@^6.0.0": version "6.1.0" resolved "https://registry.yarnpkg.com/@metamask/rpc-errors/-/rpc-errors-6.1.0.tgz#dfdef7cba4b9ad01ca3f99e990b5980575b89b4f" @@ -2748,16 +2839,16 @@ bn.js@4.11.6: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.6.tgz#53344adb14617a13f6e8dd2ce28905d1c0ba3215" integrity sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA== +bn.js@5.2.1, bn.js@^5.0.0, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.10.0, bn.js@^4.11.0, bn.js@^4.11.6, bn.js@^4.11.8, bn.js@^4.11.9, bn.js@^4.8.0: version "4.12.0" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== -bn.js@^5.0.0, bn.js@^5.1.2, bn.js@^5.2.0, bn.js@^5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" - integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== - body-parser@1.20.1, body-parser@^1.16.0: version "1.20.1" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" @@ -4546,16 +4637,7 @@ ethers@^5.7.1: "@ethersproject/web" "5.7.1" "@ethersproject/wordlists" "5.7.0" -ethjs-abi@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/ethjs-abi/-/ethjs-abi-0.2.0.tgz#d3e2c221011520fc499b71682036c14fcc2f5b25" - integrity sha1-0+LCIQEVIPxJm3FoIDbBT8wvWyU= - dependencies: - bn.js "4.11.6" - js-sha3 "0.5.5" - number-to-bn "1.7.0" - -ethjs-abi@0.2.1: +ethjs-abi@0.2.1, ethjs-abi@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/ethjs-abi/-/ethjs-abi-0.2.1.tgz#e0a7a93a7e81163a94477bad56ede524ab6de533" integrity sha1-4KepOn6BFjqUR3utVu3lJKtt5TM= @@ -4564,56 +4646,6 @@ ethjs-abi@0.2.1: js-sha3 "0.5.5" number-to-bn "1.7.0" -ethjs-contract@0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/ethjs-contract/-/ethjs-contract-0.2.2.tgz#2ed71254cbb4f2b6fafa1db0d4a83870c887b472" - integrity sha512-xxPqEjsULQ/QNWuvX6Ako0PGs5RxALA8N/H3+boLvnaXDFZVGpD7H63H1gBCRTZyYqCldPpVlVHuw/rD45vazw== - dependencies: - ethjs-abi "0.2.0" - ethjs-filter "0.1.8" - ethjs-util "0.1.3" - js-sha3 "0.5.5" - -ethjs-filter@0.1.8: - version "0.1.8" - resolved "https://registry.yarnpkg.com/ethjs-filter/-/ethjs-filter-0.1.8.tgz#2b02726b820ed4dd3860614d185c0c0f7ed1747f" - integrity sha512-qTDPskDL2UadHwjvM8A+WG9HwM4/FoSY3p3rMJORkHltYcAuiQZd2otzOYKcL5w2Q3sbAkW/E3yt/FPFL/AVXA== - -ethjs-format@0.2.7: - version "0.2.7" - resolved "https://registry.yarnpkg.com/ethjs-format/-/ethjs-format-0.2.7.tgz#20c92f31c259a381588d069830d838b489774b86" - integrity sha512-uNYAi+r3/mvR3xYu2AfSXx5teP4ovy9z2FrRsblU+h2logsaIKZPi9V3bn3V7wuRcnG0HZ3QydgZuVaRo06C4Q== - dependencies: - bn.js "4.11.6" - ethjs-schema "0.2.1" - ethjs-util "0.1.3" - is-hex-prefixed "1.0.0" - number-to-bn "1.7.0" - strip-hex-prefix "1.0.0" - -ethjs-provider-http@0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/ethjs-provider-http/-/ethjs-provider-http-0.1.6.tgz#1ec5d9b4be257ef1d56a500b22a741985e889420" - integrity sha1-HsXZtL4lfvHValALIqdBmF6IlCA= - dependencies: - xhr2 "0.1.3" - -ethjs-query@0.3.7: - version "0.3.7" - resolved "https://registry.yarnpkg.com/ethjs-query/-/ethjs-query-0.3.7.tgz#597884664e7769c5e314a8f2f7ac6b44aceaff5e" - integrity sha512-TZnKUwfkWjy0SowFdPLtmsytCorHi0i4vvkQn7Jg8rZt33cRzKhuzOwKr/G3vdigCc+ePXOhUGMcJSAPlOG44A== - dependencies: - ethjs-format "0.2.7" - ethjs-rpc "0.2.0" - promise-to-callback "^1.0.0" - -ethjs-rpc@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/ethjs-rpc/-/ethjs-rpc-0.2.0.tgz#3d0011e32cfff156ed6147818c6fb8f801701b4c" - integrity sha512-RINulkNZTKnj4R/cjYYtYMnFFaBcVALzbtEJEONrrka8IeoarNB9Jbzn+2rT00Cv8y/CxAI+GgY1d0/i2iQeOg== - dependencies: - promise-to-callback "^1.0.0" - ethjs-schema@0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/ethjs-schema/-/ethjs-schema-0.2.1.tgz#47e138920421453617069034684642e26bb310f4" @@ -4627,14 +4659,6 @@ ethjs-unit@0.1.6: bn.js "4.11.6" number-to-bn "1.7.0" -ethjs-util@0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.3.tgz#dfd5ea4a400dc5e421a889caf47e081ada78bb55" - integrity sha1-39XqSkANxeQhqInK9H4IGtp4u1U= - dependencies: - is-hex-prefixed "1.0.0" - strip-hex-prefix "1.0.0" - ethjs-util@0.1.6, ethjs-util@^0.1.3, ethjs-util@^0.1.6: version "0.1.6" resolved "https://registry.yarnpkg.com/ethjs-util/-/ethjs-util-0.1.6.tgz#f308b62f185f9fe6237132fb2a9818866a5cd536" @@ -4643,22 +4667,6 @@ ethjs-util@0.1.6, ethjs-util@^0.1.3, ethjs-util@^0.1.6: is-hex-prefixed "1.0.0" strip-hex-prefix "1.0.0" -ethjs@^0.3.6: - version "0.3.9" - resolved "https://registry.yarnpkg.com/ethjs/-/ethjs-0.3.9.tgz#287e1fe75de8ee1fb73ae2cf6218395398e8f84c" - integrity sha512-gOQzA3tDUjoLpNONSOALJ/rUFtHi5tXl2mholHasF1cvXhoddqi06yU4OJFJu9AGd6n9v9ywzHlYeIKg1t1hdw== - dependencies: - bn.js "4.11.6" - ethjs-abi "0.2.1" - ethjs-contract "0.2.2" - ethjs-filter "0.1.8" - ethjs-provider-http "0.1.6" - ethjs-query "0.3.7" - ethjs-unit "0.1.6" - ethjs-util "0.1.3" - js-sha3 "0.5.5" - number-to-bn "1.7.0" - event-emitter@^0.3.5: version "0.3.5" resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" @@ -5898,6 +5906,11 @@ js-sha3@^0.5.7: resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.5.7.tgz#0d4ffd8002d5333aabaf4a23eed2f6374c9f28e7" integrity sha512-GII20kjaPX0zJ8wzkTbNDYMY7msuZcTWk8S5UOh6806Jq/wz1J8/bnr8uGU0DAUmYDjj2Mr4X1cW8v/GLYnR+g== +js-sha3@^0.9.2: + version "0.9.3" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.9.3.tgz#f0209432b23a66a0f6c7af592c26802291a75c2a" + integrity sha512-BcJPCQeLg6WjEx3FE591wVAevlli8lxsxm9/FzV4HXkV49TmBH38Yvrpce6fjbADGMKFrBMGTqrVz3qPIZ88Gg== + "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -9234,10 +9247,10 @@ xhr2-cookies@1.1.0: dependencies: cookiejar "^2.1.1" -xhr2@0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/xhr2/-/xhr2-0.1.3.tgz#cbfc4759a69b4a888e78cf4f20b051038757bd11" - integrity sha1-y/xHWaabSoiOeM9PILBRA4dXvRE= +xhr2@0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/xhr2/-/xhr2-0.2.1.tgz#4e73adc4f9cfec9cbd2157f73efdce3a5f108a93" + integrity sha512-sID0rrVCqkVNUn8t6xuv9+6FViXjUVXq8H5rWOH2rz9fDNQEd4g0EA2XlcEdJXRz5BMEn4O1pJFdT+z4YHhoWw== xhr@^2.0.4, xhr@^2.2.0, xhr@^2.3.3: version "2.6.0"