Skip to content

Commit

Permalink
consolidates dependencies
Browse files Browse the repository at this point in the history
fixes bytecode check
exposes unhooked function

Signed-off-by: stadolf <[email protected]>
  • Loading branch information
elmariachi111 committed Oct 19, 2023
1 parent 965881b commit 5d89f3f
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 54 deletions.
24 changes: 2 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "safetest",
"name": "wagmi-safe-wait-for-tx",
"version": "0.1.0",
"private": true,
"scripts": {
Expand All @@ -10,28 +10,8 @@
"workspaces": [
"packages/*"
],
"dependencies": {
"@chakra-ui/next-js": "^2.1.5",
"@chakra-ui/react": "^2.8.1",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@privy-io/react-auth": "^1.43.2",
"@privy-io/wagmi-connector": "^0.1.4",
"@wagmi/chains": "^1.8.0",
"framer-motion": "^10.16.4",
"next": "13.5.4",
"react": "^18",
"react-dom": "^18",
"viem": "^1.15.4",
"wagmi": "^1.4.3"
},
"devDependencies": {
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"@wagmi/cli": "^1.5.2",
"eslint": "^8",
"eslint-config-next": "13.5.4",
"typescript": "5.0.4"
"react": ">=18"
}
}
4 changes: 2 additions & 2 deletions packages/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
"wagmi": "^1.4.3"
},
"devDependencies": {
"@types/node": "^20",
"@types/node": "^18",
"@types/react": "^18",
"@types/react-dom": "^18",
"@wagmi/cli": "^1.5.2",
"eslint": "^8",
"eslint-config-next": "13.5.4",
"typescript": "5.0.4"
"typescript": "^5.0.4"
}
}
2 changes: 2 additions & 0 deletions packages/demo/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";

import { ActiveAddress } from "@/components/ActiveAddress";
import {
storageABI,
useStorageRetrieve,
Expand Down Expand Up @@ -108,6 +109,7 @@ export default function Home() {
</Flex>
)}
</form>
<ActiveAddress />
</main>
);
}
16 changes: 16 additions & 0 deletions packages/demo/src/components/ActiveAddress.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Text } from "@chakra-ui/react";
import { useIsContractWallet } from "@moleculexyz/wagmi-safe-wait-for-tx";
import { useAccount, usePublicClient } from "wagmi";

export const ActiveAddress = () => {
const { address } = useAccount();
const { isContract: isContractWallet } = useIsContractWallet(address);
const pc = usePublicClient();

return (
<Text fontSize="sm">
The active address is: {address} and it&apos;s a{" "}
{isContractWallet ? "contract" : "EOA"}
</Text>
);
};
16 changes: 6 additions & 10 deletions packages/wagmi-safe-wait-for-tx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,20 @@
"url": "https://molecule.xyz"
}
],
"dependencies": {
"@wagmi/chains": "^1.8.0",
"react": "^18",
"react-dom": "^18",
"viem": "^1.15.4",
"wagmi": "^1.4.3"
},
"devDependencies": {
"@types/node": "^20",
"@types/node": "^18",
"@types/react": "^18",
"@wagmi/chains": "^1.8.0",
"eslint": "^8",
"fix-esm-import-path": "^1.4.0",
"react": "^18",
"rimraf": "^5.0.5",
"typescript": "5.0.4"
"typescript": "^5.0.4",
"viem": "^1.15.4",
"wagmi": "^1.4.3"
},
"peerDependencies": {
"react": "^18",
"react-dom": "^18",
"typescript": ">=5.0.4",
"viem": ">=1.15.0"
}
Expand Down
1 change: 1 addition & 0 deletions packages/wagmi-safe-wait-for-tx/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { useIsContractWallet } from "./components/hooks/useIsContractWallet";
export { useSafeWaitForTransaction } from "./components/hooks/useSafeWaitForTransaction";
export { safeWaitForTransactionReceipt } from "./utils/safeWaitForTransactionReceipt";
export { isContractWallet } from "./utils/safe";
2 changes: 1 addition & 1 deletion packages/wagmi-safe-wait-for-tx/src/utils/safe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const isContractWallet = async (
}> => {
const bytecode = await publicClient.getBytecode({ address });

if (bytecode?.length == 0) {
if (!bytecode || bytecode.length == 0) {
return {
isContract: false,
isSafe: false,
Expand Down
1 change: 0 additions & 1 deletion packages/wagmi-safe-wait-for-tx/tsconfig.tsbuildinfo

This file was deleted.

41 changes: 23 additions & 18 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2204,7 +2204,7 @@
resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.33.tgz#80bf1da64b15f21fd8c1dc387c31929317d99ee9"
integrity sha512-AuHIyzR5Hea7ij0P9q7vx7xu4z0C28ucwjAZC0ja7JhINyCnOw8/DnvAPQQ9TfOlCtZAmCERKQX9+o1mgQhuOQ==

"@types/node@*", "@types/node@^20":
"@types/node@*":
version "20.8.7"
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.8.7.tgz#ad23827850843de973096edfc5abc9e922492a25"
integrity sha512-21TKHHh3eUHIi2MloeptJWALuCu5H7HQTdTrWIFReA8ad+aggoX+lRes3ex7/FtpC+sVUpFMQ+QTfYr74mruiQ==
Expand All @@ -2216,6 +2216,11 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.20.55.tgz#c329cbd434c42164f846b909bd6f85b5537f6240"
integrity sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==

"@types/node@^18":
version "18.18.6"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.18.6.tgz#26da694f75cdb057750f49d099da5e3f3824cb3e"
integrity sha512-wf3Vz+jCmOQ2HV1YUJuCWdL64adYxumkrxtc+H1VUQlnQI04+5HtH+qZCOE21lBE7gIrt+CwX2Wv8Acrw5Ak6w==

"@types/parse-json@^4.0.0":
version "4.0.1"
resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.1.tgz#27f7559836ad796cea31acb63163b203756a5b4e"
Expand All @@ -2227,9 +2232,9 @@
integrity sha512-n1yyPsugYNSmHgxDFjicaI2+gCNjsBck8UX9kuofAKlc0h1bL+20oSF72KeNaW2DUlesbEVCFgyV2dPGTiY42g==

"@types/react-dom@^18":
version "18.2.13"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.2.13.tgz#89cd7f9ec8b28c8b6f0392b9591671fb4a9e96b7"
integrity sha512-eJIUv7rPP+EC45uNYp/ThhSpE16k22VJUknt5OLoH9tbXoi8bMhwLf5xRuWMywamNbWzhrSmU7IBJfPup1+3fw==
version "18.2.14"
resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.2.14.tgz#c01ba40e5bb57fc1dc41569bb3ccdb19eab1c539"
integrity sha512-V835xgdSVmyQmI1KLV2BEIUgqEuinxp9O4G6g3FqO/SqLac049E53aysv0oEFD2kHfejeKU+ZqL2bcFWj9gLAQ==
dependencies:
"@types/react" "*"

Expand All @@ -2243,14 +2248,14 @@
csstype "^3.0.2"

"@types/scheduler@*":
version "0.16.4"
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.4.tgz#fedc3e5b15c26dc18faae96bf1317487cb3658cf"
integrity sha512-2L9ifAGl7wmXwP4v3pN4p2FLhD0O1qsJpvKmNin5VA8+UvNVb447UDaAEV6UdrkA+m/Xs58U1RFps44x6TFsVQ==
version "0.16.5"
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.5.tgz#4751153abbf8d6199babb345a52e1eb4167d64af"
integrity sha512-s/FPdYRmZR8SjLWGMCuax7r3qCWQw9QKHzXVukAuuIJkXkDRwp+Pu5LMIVFi0Fxbav35WURicYr8u1QsoybnQw==

"@types/trusted-types@^2.0.2":
version "2.0.4"
resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.4.tgz#2b38784cd16957d3782e8e2b31c03bc1d13b4d65"
integrity sha512-IDaobHimLQhjwsQ/NMwRVfa/yL7L/wriQPMhw1ZJall0KX6E1oxk29XMDeilW5qTIg5aoiqf5Udy8U/51aNoQQ==
version "2.0.5"
resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.5.tgz#5cac7e7df3275bb95f79594f192d97da3b4fd5fe"
integrity sha512-I3pkr8j/6tmQtKV/ZzHtuaqYSQvyjGRKH4go60Rr0IDLlFxuRT5V32uvB1mecM5G1EVAUyF/4r4QZ1GHgz+mxA==

"@types/ws@^7.4.4":
version "7.4.7"
Expand Down Expand Up @@ -3363,9 +3368,9 @@ camelize@^1.0.0:
integrity sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==

caniuse-lite@^1.0.30001406:
version "1.0.30001550"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001550.tgz#6ec6a2239eb2a8123cc26cfe0571db5c79eb8669"
integrity sha512-p82WjBYIypO0ukTsd/FG3Xxs+4tFeaY9pfT4amQL8KWtYH7H9nYwReGAbMTJ0hsmRO8IfDtsS6p3ZWj8+1c2RQ==
version "1.0.30001551"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001551.tgz#1f2cfa8820bd97c971a57349d7fd8f6e08664a3e"
integrity sha512-vtBAez47BoGMMzlbYhfXrMV1kvRF2WP/lqiMuDu1Sb4EE4LKEgjopFDSRtZfdVnslNRpOqV/woE+Xgrwj6VQlg==

capital-case@^1.0.4:
version "1.0.4"
Expand Down Expand Up @@ -6323,7 +6328,7 @@ react-style-singleton@^2.2.1:
invariant "^2.2.4"
tslib "^2.0.0"

react@^18:
react@>=18, react@^18:
version "18.2.0"
resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5"
integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==
Expand Down Expand Up @@ -7045,10 +7050,10 @@ [email protected], typedarray-to-buffer@^3.1.5:
dependencies:
is-typedarray "^1.0.0"

[email protected]:
version "5.0.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b"
integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==
typescript@^5.0.4:
version "5.2.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.2.2.tgz#5ebb5e5a5b75f085f22bc3f8460fba308310fa78"
integrity sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==

ua-parser-js@^1.0.33:
version "1.0.36"
Expand Down

0 comments on commit 5d89f3f

Please sign in to comment.