diff --git a/.github/workflows/ci_passkey_example.yml b/.github/workflows/ci_passkey_example.yml index 30f371c5..9bd7f05c 100644 --- a/.github/workflows/ci_passkey_example.yml +++ b/.github/workflows/ci_passkey_example.yml @@ -4,7 +4,7 @@ on: paths: - 'modules/4337/**' - 'modules/passkey/**' - - 'examples/safe-4337-passkeys/**' + - 'examples/4337-passkeys/**' jobs: checks: @@ -22,8 +22,8 @@ jobs: npm run build -w modules/4337 # Reinstall the dependencies so the 4337 dependency includes artifacts npm ci - npm run lint -w examples/safe-4337-passkeys - npm run build -w examples/safe-4337-passkeys + npm run lint -w examples/4337-passkeys + npm run build -w examples/4337-passkeys env: VITE_WC_CLOUD_PROJECT_ID: ${{ secrets.VITE_WC_CLOUD_PROJECT_ID }} VITE_WC_4337_BUNDLER_URL: ${{ secrets.VITE_WC_4337_BUNDLER_URL }} diff --git a/README.md b/README.md index 567ffbb7..4888cc17 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,8 @@ This repository contains a collection of modules for the [Safe Smart Account](ht ## Examples -- [Safe + 4337 + Passkeys](./examples/safe-4337-passkeys) +- [Safe + 4337 + Passkeys](./examples/4337-passkeys) +- [4337 Gas Metering](./examples/4337-gas-metering) ## Security and Liability diff --git a/examples/4337-gas-metering/package.json b/examples/4337-gas-metering/package.json index 5093e6be..822429fe 100644 --- a/examples/4337-gas-metering/package.json +++ b/examples/4337-gas-metering/package.json @@ -1,5 +1,5 @@ { - "name": "@safe-global/4337-gas-metering", + "name": "@safe-global/safe-modules-example-4337-gas-metering", "version": "1.0.0", "description": "Gas Metering Analysis for Safe with 4337 Module", "homepage": "https://github.com/safe-global/safe-modules/4337-gas-metering", diff --git a/examples/safe-4337-passkeys/.env.example b/examples/4337-passkeys/.env.example similarity index 100% rename from examples/safe-4337-passkeys/.env.example rename to examples/4337-passkeys/.env.example diff --git a/examples/safe-4337-passkeys/.eslintrc.cjs b/examples/4337-passkeys/.eslintrc.cjs similarity index 100% rename from examples/safe-4337-passkeys/.eslintrc.cjs rename to examples/4337-passkeys/.eslintrc.cjs diff --git a/examples/safe-4337-passkeys/.gitignore b/examples/4337-passkeys/.gitignore similarity index 100% rename from examples/safe-4337-passkeys/.gitignore rename to examples/4337-passkeys/.gitignore diff --git a/examples/safe-4337-passkeys/README.md b/examples/4337-passkeys/README.md similarity index 96% rename from examples/safe-4337-passkeys/README.md rename to examples/4337-passkeys/README.md index 3145e63b..fbe5dcbb 100644 --- a/examples/safe-4337-passkeys/README.md +++ b/examples/4337-passkeys/README.md @@ -33,7 +33,7 @@ Helpful links: ### Run the app in development mode ```bash -npm run dev -w examples/safe-4337-passkeys +npm run dev -w examples/4337-passkeys ``` ## Config adjustments diff --git a/examples/safe-4337-passkeys/index.html b/examples/4337-passkeys/index.html similarity index 100% rename from examples/safe-4337-passkeys/index.html rename to examples/4337-passkeys/index.html diff --git a/examples/safe-4337-passkeys/package.json b/examples/4337-passkeys/package.json similarity index 85% rename from examples/safe-4337-passkeys/package.json rename to examples/4337-passkeys/package.json index f6a0b3ad..c8b236ec 100644 --- a/examples/safe-4337-passkeys/package.json +++ b/examples/4337-passkeys/package.json @@ -1,5 +1,5 @@ { - "name": "safe-4337-passkeys", + "name": "@safe-global/safe-modules-example-4337-passkeys", "private": true, "version": "0.0.0", "type": "module", @@ -11,7 +11,7 @@ }, "dependencies": { "@web3modal/ethers": "^4.0.5", - "@safe-global/safe-erc4337": "^0.3.0", + "@safe-global/safe-4337": "^0.3.0", "ethers": "^6.11.1", "react": "^18.2.0", "react-dom": "^18.2.0" diff --git a/examples/safe-4337-passkeys/public/safe-logo.svg b/examples/4337-passkeys/public/safe-logo.svg similarity index 100% rename from examples/safe-4337-passkeys/public/safe-logo.svg rename to examples/4337-passkeys/public/safe-logo.svg diff --git a/examples/safe-4337-passkeys/src/App.css b/examples/4337-passkeys/src/App.css similarity index 100% rename from examples/safe-4337-passkeys/src/App.css rename to examples/4337-passkeys/src/App.css diff --git a/examples/safe-4337-passkeys/src/App.tsx b/examples/4337-passkeys/src/App.tsx similarity index 100% rename from examples/safe-4337-passkeys/src/App.tsx rename to examples/4337-passkeys/src/App.tsx diff --git a/examples/safe-4337-passkeys/src/components/ConnectButton.tsx b/examples/4337-passkeys/src/components/ConnectButton.tsx similarity index 100% rename from examples/safe-4337-passkeys/src/components/ConnectButton.tsx rename to examples/4337-passkeys/src/components/ConnectButton.tsx diff --git a/examples/safe-4337-passkeys/src/components/OpPrefundCard.tsx b/examples/4337-passkeys/src/components/OpPrefundCard.tsx similarity index 100% rename from examples/safe-4337-passkeys/src/components/OpPrefundCard.tsx rename to examples/4337-passkeys/src/components/OpPrefundCard.tsx diff --git a/examples/safe-4337-passkeys/src/components/PasskeyCard.tsx b/examples/4337-passkeys/src/components/PasskeyCard.tsx similarity index 100% rename from examples/safe-4337-passkeys/src/components/PasskeyCard.tsx rename to examples/4337-passkeys/src/components/PasskeyCard.tsx diff --git a/examples/safe-4337-passkeys/src/components/SafeCard.tsx b/examples/4337-passkeys/src/components/SafeCard.tsx similarity index 100% rename from examples/safe-4337-passkeys/src/components/SafeCard.tsx rename to examples/4337-passkeys/src/components/SafeCard.tsx diff --git a/examples/safe-4337-passkeys/src/config.ts b/examples/4337-passkeys/src/config.ts similarity index 100% rename from examples/safe-4337-passkeys/src/config.ts rename to examples/4337-passkeys/src/config.ts diff --git a/examples/safe-4337-passkeys/src/hooks/useCodeAtAddress.ts b/examples/4337-passkeys/src/hooks/useCodeAtAddress.ts similarity index 100% rename from examples/safe-4337-passkeys/src/hooks/useCodeAtAddress.ts rename to examples/4337-passkeys/src/hooks/useCodeAtAddress.ts diff --git a/examples/safe-4337-passkeys/src/hooks/useFeeData.ts b/examples/4337-passkeys/src/hooks/useFeeData.ts similarity index 100% rename from examples/safe-4337-passkeys/src/hooks/useFeeData.ts rename to examples/4337-passkeys/src/hooks/useFeeData.ts diff --git a/examples/safe-4337-passkeys/src/hooks/useLocalStorageState.ts b/examples/4337-passkeys/src/hooks/useLocalStorageState.ts similarity index 100% rename from examples/safe-4337-passkeys/src/hooks/useLocalStorageState.ts rename to examples/4337-passkeys/src/hooks/useLocalStorageState.ts diff --git a/examples/safe-4337-passkeys/src/hooks/useNativeTokenBalance.ts b/examples/4337-passkeys/src/hooks/useNativeTokenBalance.ts similarity index 100% rename from examples/safe-4337-passkeys/src/hooks/useNativeTokenBalance.ts rename to examples/4337-passkeys/src/hooks/useNativeTokenBalance.ts diff --git a/examples/safe-4337-passkeys/src/hooks/useUserOpGasEstimation.ts b/examples/4337-passkeys/src/hooks/useUserOpGasEstimation.ts similarity index 100% rename from examples/safe-4337-passkeys/src/hooks/useUserOpGasEstimation.ts rename to examples/4337-passkeys/src/hooks/useUserOpGasEstimation.ts diff --git a/examples/safe-4337-passkeys/src/index.css b/examples/4337-passkeys/src/index.css similarity index 100% rename from examples/safe-4337-passkeys/src/index.css rename to examples/4337-passkeys/src/index.css diff --git a/examples/safe-4337-passkeys/src/logic/erc721.ts b/examples/4337-passkeys/src/logic/erc721.ts similarity index 100% rename from examples/safe-4337-passkeys/src/logic/erc721.ts rename to examples/4337-passkeys/src/logic/erc721.ts diff --git a/examples/safe-4337-passkeys/src/logic/passkeys.ts b/examples/4337-passkeys/src/logic/passkeys.ts similarity index 100% rename from examples/safe-4337-passkeys/src/logic/passkeys.ts rename to examples/4337-passkeys/src/logic/passkeys.ts diff --git a/examples/safe-4337-passkeys/src/logic/safe.ts b/examples/4337-passkeys/src/logic/safe.ts similarity index 92% rename from examples/safe-4337-passkeys/src/logic/safe.ts rename to examples/4337-passkeys/src/logic/safe.ts index 72eb315c..88e5eb2a 100644 --- a/examples/safe-4337-passkeys/src/logic/safe.ts +++ b/examples/4337-passkeys/src/logic/safe.ts @@ -1,13 +1,13 @@ import { ethers } from 'ethers' -import { abi as SafeSignerLaunchpadAbi } from '@safe-global/safe-erc4337/build/artifacts/contracts/experimental/SafeSignerLaunchpad.sol/SafeSignerLaunchpad.json' -import { abi as WebAuthnSignerFactoryAbi } from '@safe-global/safe-erc4337/build/artifacts/contracts/experimental/WebAuthnSigner.sol/WebAuthnSignerFactory.json' -import { abi as SetupModuleSetupAbi } from '@safe-global/safe-erc4337/build/artifacts/contracts/SafeModuleSetup.sol/SafeModuleSetup.json' +import { abi as SafeSignerLaunchpadAbi } from '@safe-global/safe-4337/build/artifacts/contracts/experimental/SafeSignerLaunchpad.sol/SafeSignerLaunchpad.json' +import { abi as WebAuthnSignerFactoryAbi } from '@safe-global/safe-4337/build/artifacts/contracts/experimental/WebAuthnSigner.sol/WebAuthnSignerFactory.json' +import { abi as SetupModuleSetupAbi } from '@safe-global/safe-4337/build/artifacts/contracts/SafeModuleSetup.sol/SafeModuleSetup.json' import { abi as WebAuthnSignerAbi, bytecode as WebAuthSignerBytecode, -} from '@safe-global/safe-erc4337/build/artifacts/contracts/experimental/WebAuthnSigner.sol/WebAuthnSigner.json' -import { abi as Safe4337ModuleAbi } from '@safe-global/safe-erc4337/build/artifacts/contracts/Safe4337Module.sol/Safe4337Module.json' -import { abi as SafeProxyFactoryAbi } from '@safe-global/safe-erc4337/build/artifacts/@safe-global/safe-contracts/contracts/proxies/SafeProxyFactory.sol/SafeProxyFactory.json' +} from '@safe-global/safe-4337/build/artifacts/contracts/experimental/WebAuthnSigner.sol/WebAuthnSigner.json' +import { abi as Safe4337ModuleAbi } from '@safe-global/safe-4337/build/artifacts/contracts/Safe4337Module.sol/Safe4337Module.json' +import { abi as SafeProxyFactoryAbi } from '@safe-global/safe-4337/build/artifacts/@safe-global/safe-contracts/contracts/proxies/SafeProxyFactory.sol/SafeProxyFactory.json' import type { SafeSignerLaunchpad, Safe4337Module, @@ -15,7 +15,7 @@ import type { WebAuthnSigner, WebAuthnSignerFactory, SafeModuleSetup, -} from '@safe-global/safe-erc4337/typechain-types/' +} from '@safe-global/safe-4337/typechain-types/' import { SAFE_SIGNER_LAUNCHPAD_ADDRESS, diff --git a/examples/safe-4337-passkeys/src/logic/storage.ts b/examples/4337-passkeys/src/logic/storage.ts similarity index 100% rename from examples/safe-4337-passkeys/src/logic/storage.ts rename to examples/4337-passkeys/src/logic/storage.ts diff --git a/examples/safe-4337-passkeys/src/logic/userOp.ts b/examples/4337-passkeys/src/logic/userOp.ts similarity index 100% rename from examples/safe-4337-passkeys/src/logic/userOp.ts rename to examples/4337-passkeys/src/logic/userOp.ts diff --git a/examples/safe-4337-passkeys/src/logic/wallets.ts b/examples/4337-passkeys/src/logic/wallets.ts similarity index 100% rename from examples/safe-4337-passkeys/src/logic/wallets.ts rename to examples/4337-passkeys/src/logic/wallets.ts diff --git a/examples/safe-4337-passkeys/src/main.tsx b/examples/4337-passkeys/src/main.tsx similarity index 100% rename from examples/safe-4337-passkeys/src/main.tsx rename to examples/4337-passkeys/src/main.tsx diff --git a/examples/safe-4337-passkeys/src/utils.ts b/examples/4337-passkeys/src/utils.ts similarity index 100% rename from examples/safe-4337-passkeys/src/utils.ts rename to examples/4337-passkeys/src/utils.ts diff --git a/examples/safe-4337-passkeys/src/vite-env.d.ts b/examples/4337-passkeys/src/vite-env.d.ts similarity index 100% rename from examples/safe-4337-passkeys/src/vite-env.d.ts rename to examples/4337-passkeys/src/vite-env.d.ts diff --git a/examples/safe-4337-passkeys/tsconfig.json b/examples/4337-passkeys/tsconfig.json similarity index 100% rename from examples/safe-4337-passkeys/tsconfig.json rename to examples/4337-passkeys/tsconfig.json diff --git a/examples/safe-4337-passkeys/tsconfig.node.json b/examples/4337-passkeys/tsconfig.node.json similarity index 100% rename from examples/safe-4337-passkeys/tsconfig.node.json rename to examples/4337-passkeys/tsconfig.node.json diff --git a/examples/safe-4337-passkeys/vite.config.ts b/examples/4337-passkeys/vite.config.ts similarity index 100% rename from examples/safe-4337-passkeys/vite.config.ts rename to examples/4337-passkeys/vite.config.ts diff --git a/modules/4337/package.json b/modules/4337/package.json index 8b4cf7b4..0212efa0 100644 --- a/modules/4337/package.json +++ b/modules/4337/package.json @@ -1,5 +1,5 @@ { - "name": "@safe-global/safe-erc4337", + "name": "@safe-global/safe-4337", "version": "0.3.0", "description": "Safe Module for ERC-4337 support", "homepage": "https://github.com/safe-global/safe-modules/tree/main/modules/4337", diff --git a/modules/passkey/package.json b/modules/passkey/package.json index ef86ba9a..a52477ed 100644 --- a/modules/passkey/package.json +++ b/modules/passkey/package.json @@ -43,7 +43,7 @@ "@account-abstraction/contracts": "^0.7.0", "@noble/curves": "^1.3.0", "@nomicfoundation/hardhat-toolbox": "^4.0.0", - "@safe-global/safe-erc4337": "^0.3.0", + "@safe-global/safe-4337": "^0.3.0", "@simplewebauthn/server": "^9.0.3", "cbor": "^9.0.2", "dotenv": "^16.4.5", diff --git a/modules/passkey/src/deploy/safe.ts b/modules/passkey/src/deploy/safe.ts index 67e023af..5137033a 100644 --- a/modules/passkey/src/deploy/safe.ts +++ b/modules/passkey/src/deploy/safe.ts @@ -1,8 +1,8 @@ import MultiSend from '@safe-global/safe-contracts/build/artifacts/contracts/libraries/MultiSend.sol/MultiSend.json' import SafeProxyFactory from '@safe-global/safe-contracts/build/artifacts/contracts/proxies/SafeProxyFactory.sol/SafeProxyFactory.json' import SafeL2 from '@safe-global/safe-contracts/build/artifacts/contracts/SafeL2.sol/SafeL2.json' -import Safe4337Module from '@safe-global/safe-erc4337/build/artifacts/contracts/Safe4337Module.sol/Safe4337Module.json' -import SafeModuleSetup from '@safe-global/safe-erc4337/build/artifacts/contracts/SafeModuleSetup.sol/SafeModuleSetup.json' +import Safe4337Module from '@safe-global/safe-4337/build/artifacts/contracts/Safe4337Module.sol/Safe4337Module.json' +import SafeModuleSetup from '@safe-global/safe-4337/build/artifacts/contracts/SafeModuleSetup.sol/SafeModuleSetup.json' import { DeployFunction } from 'hardhat-deploy/types' const deploy: DeployFunction = async ({ deployments, getNamedAccounts, network }) => { diff --git a/modules/passkey/test/4337/WebAuthnSigner.spec.ts b/modules/passkey/test/4337/WebAuthnSigner.spec.ts index 86045220..0ce600fe 100644 --- a/modules/passkey/test/4337/WebAuthnSigner.spec.ts +++ b/modules/passkey/test/4337/WebAuthnSigner.spec.ts @@ -1,6 +1,6 @@ import { expect } from 'chai' import { deployments, ethers, network } from 'hardhat' -import { packGasParameters, unpackUserOperation } from '@safe-global/safe-erc4337/dist/src/utils/userOp' +import { packGasParameters, unpackUserOperation } from '@safe-global/safe-4337/dist/src/utils/userOp' import { bundlerRpc, prepareAccounts, waitForUserOp } from '../utils/e2e' import { chainId } from '../utils/encoding' import { WebAuthnCredentials, decodePublicKey, encodeWebAuthnSignature } from '../utils/webauthn' diff --git a/modules/passkey/test/utils/e2e.ts b/modules/passkey/test/utils/e2e.ts index 5fe57b58..8906b9d6 100644 --- a/modules/passkey/test/utils/e2e.ts +++ b/modules/passkey/test/utils/e2e.ts @@ -1,5 +1,5 @@ import { deployments, ethers } from 'hardhat' -import { MultiProvider4337 } from '@safe-global/safe-erc4337/dist/src/utils/safe' +import { MultiProvider4337 } from '@safe-global/safe-4337/dist/src/utils/safe' import { AddressLike, BigNumberish, BytesLike, HDNodeWallet } from 'ethers' import { PackedUserOperationStruct } from '../../typechain-types/@account-abstraction/contracts/interfaces/IAccount' diff --git a/package-lock.json b/package-lock.json index f872e4ac..fbc5a035 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "license": "GPL-3.0", "workspaces": [ "modules/*", + "packages/*", "examples/*" ], "devDependencies": { @@ -27,7 +28,7 @@ } }, "examples/4337-gas-metering": { - "name": "@safe-global/4337-gas-metering", + "name": "@safe-global/safe-modules-example-4337-gas-metering", "version": "1.0.0", "license": "GPL-3.0", "dependencies": { @@ -222,10 +223,11 @@ } } }, - "examples/safe-4337-passkeys": { + "examples/4337-passkeys": { + "name": "@safe-global/safe-modules-example-4337-passkeys", "version": "0.0.0", "dependencies": { - "@safe-global/safe-erc4337": "^0.3.0", + "@safe-global/safe-4337": "^0.3.0", "@web3modal/ethers": "^4.0.5", "ethers": "^6.11.1", "react": "^18.2.0", @@ -239,13 +241,23 @@ "vite": "^5.1.3" } }, - "examples/safe-4337-passkeys/node_modules/@adraffy/ens-normalize": { + "examples/4337-passkeys/node_modules/@adraffy/ens-normalize": { "version": "1.10.1", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz", + "integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==" }, - "examples/safe-4337-passkeys/node_modules/@noble/curves": { + "examples/4337-passkeys/node_modules/@lit/reactive-element": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-2.0.4.tgz", + "integrity": "sha512-GFn91inaUa2oHLak8awSIigYz0cU0Payr1rcFsrkf5OJ5eSPxElyZfKh0f2p9FsTiZWXQdWGJeXZICEfXXYSXQ==", + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.2.0" + } + }, + "examples/4337-passkeys/node_modules/@noble/curves": { "version": "1.2.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", + "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", "dependencies": { "@noble/hashes": "1.3.2" }, @@ -253,9 +265,10 @@ "url": "https://paulmillr.com/funding/" } }, - "examples/safe-4337-passkeys/node_modules/@noble/hashes": { + "examples/4337-passkeys/node_modules/@noble/hashes": { "version": "1.3.2", - "license": "MIT", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", "engines": { "node": ">= 16" }, @@ -263,31 +276,51 @@ "url": "https://paulmillr.com/funding/" } }, - "examples/safe-4337-passkeys/node_modules/@types/node": { + "examples/4337-passkeys/node_modules/@types/node": { "version": "18.15.13", - "license": "MIT" + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz", + "integrity": "sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==" }, - "examples/safe-4337-passkeys/node_modules/@web3modal/ethers": { - "version": "4.0.5", - "license": "Apache-2.0", + "examples/4337-passkeys/node_modules/@web3modal/common": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@web3modal/common/-/common-4.0.13.tgz", + "integrity": "sha512-71fVfEy9k7B6xVgswY220Xy4Tl4iCINc1E4mr2P5NfEPkSwhmXm/oO2QBIpefml/cJ7Zt4oFbta8NzyN+V5bQw==", + "dependencies": { + "dayjs": "1.11.10" + } + }, + "examples/4337-passkeys/node_modules/@web3modal/core": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@web3modal/core/-/core-4.0.13.tgz", + "integrity": "sha512-8zCu+oZ3xwCQtUevjP09BPCkvJo2tRnBcOzMDhkFzqty2nTE4GBuaI2Bgp/gcrLJNN/RLPQ8BcEdrV2k95MOIg==", + "dependencies": { + "@web3modal/common": "4.0.13", + "@web3modal/wallet": "4.0.13", + "valtio": "1.11.2" + } + }, + "examples/4337-passkeys/node_modules/@web3modal/ethers": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@web3modal/ethers/-/ethers-4.0.13.tgz", + "integrity": "sha512-K0GOrJNOB9CPCay5JLlsS+QQDpIVgd2NC9RSWSML/OMwE+klZQaWvkI7WJlWXjXY3wg2uvJRRxE7rarllSlPkA==", "dependencies": { "@coinbase/wallet-sdk": "3.9.1", "@walletconnect/ethereum-provider": "2.11.1", - "@web3modal/polyfills": "4.0.5", - "@web3modal/scaffold": "4.0.5", - "@web3modal/scaffold-react": "4.0.5", - "@web3modal/scaffold-utils": "4.0.5", - "@web3modal/scaffold-vue": "4.0.5", + "@web3modal/polyfills": "4.0.13", + "@web3modal/scaffold": "4.0.13", + "@web3modal/scaffold-react": "4.0.13", + "@web3modal/scaffold-utils": "4.0.13", + "@web3modal/scaffold-vue": "4.0.13", "valtio": "1.11.2" }, "optionalDependencies": { - "@web3modal/siwe": "4.0.5", + "@web3modal/siwe": "4.0.13", "react": ">=17", "react-dom": ">=17", "vue": ">=3" }, "peerDependencies": { - "@web3modal/siwe": "*", + "@web3modal/siwe": "4.0.13", "ethers": ">=6.0.0", "react": ">=17", "react-dom": ">=17", @@ -308,8 +341,124 @@ } } }, - "examples/safe-4337-passkeys/node_modules/ethers": { + "examples/4337-passkeys/node_modules/@web3modal/polyfills": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@web3modal/polyfills/-/polyfills-4.0.13.tgz", + "integrity": "sha512-Pvb2uF18+h3r+kKa6ELn5Vg7lQRNoBmZ9GuH//AY1lX6AII75hPH78hKh78EscZctVFInbVxx8RBTFwfbXUzQA==", + "dependencies": { + "buffer": "6.0.3" + } + }, + "examples/4337-passkeys/node_modules/@web3modal/scaffold": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@web3modal/scaffold/-/scaffold-4.0.13.tgz", + "integrity": "sha512-ur543j3KunFUIoSAT4GGwAX0GxVPHNkuCEUGJL52KSfXG6rqHlPoVMeGyZKN4Mo2FyQCh76vFgm9Vv2GribuDQ==", + "dependencies": { + "@web3modal/common": "4.0.13", + "@web3modal/core": "4.0.13", + "@web3modal/ui": "4.0.13", + "lit": "3.1.0" + }, + "optionalDependencies": { + "@web3modal/siwe": "4.0.13" + }, + "peerDependencies": { + "@web3modal/siwe": ">=4.0.13" + }, + "peerDependenciesMeta": { + "@web3modal/siwe": { + "optional": true + } + } + }, + "examples/4337-passkeys/node_modules/@web3modal/scaffold-react": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@web3modal/scaffold-react/-/scaffold-react-4.0.13.tgz", + "integrity": "sha512-275GNgj7sYYdhP1V3u5xaoxirIgumvAORkSguj2qahrc911NTfWP1foXaCE1cMj4TolV8r2esok8Jmh5r4SETg==", + "dependencies": { + "@web3modal/scaffold": "4.0.13" + }, + "peerDependencies": { + "react": ">=17", + "react-dom": ">=17" + } + }, + "examples/4337-passkeys/node_modules/@web3modal/scaffold-utils": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@web3modal/scaffold-utils/-/scaffold-utils-4.0.13.tgz", + "integrity": "sha512-V/iJ0ec92oZSBopxWaPpy8k2HZ4kUihhGDXfV11A9GQVIg7+JY2m+Q8vUBrgHExmb38GZWgqAGUeG/YlTdLmQw==", + "dependencies": { + "@web3modal/core": "4.0.13", + "@web3modal/polyfills": "4.0.13", + "valtio": "1.11.2" + } + }, + "examples/4337-passkeys/node_modules/@web3modal/scaffold-vue": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@web3modal/scaffold-vue/-/scaffold-vue-4.0.13.tgz", + "integrity": "sha512-G50zVC4vqd//bNDc8+K08EmAUs9pXSgmWj8CarPu4X5x69p0dMPXzDuTMQJ/Lw2WZ2WBvycwY8dyvvzI6Ff1Xw==", + "dependencies": { + "@web3modal/scaffold": "4.0.13" + }, + "peerDependencies": { + "vue": ">=3" + } + }, + "examples/4337-passkeys/node_modules/@web3modal/scaffold/node_modules/lit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lit/-/lit-3.1.0.tgz", + "integrity": "sha512-rzo/hmUqX8zmOdamDAeydfjsGXbbdtAFqMhmocnh2j9aDYqbu0fjXygjCa0T99Od9VQ/2itwaGrjZz/ZELVl7w==", + "dependencies": { + "@lit/reactive-element": "^2.0.0", + "lit-element": "^4.0.0", + "lit-html": "^3.1.0" + } + }, + "examples/4337-passkeys/node_modules/@web3modal/siwe": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@web3modal/siwe/-/siwe-4.0.13.tgz", + "integrity": "sha512-wMEOJxgWQK97mdI5IWAR4uA8NHLOjOM3PabiQYEw7hKACwK4C2bJTS1Lp6ddO3a3P2WU4GxrtoqBnpbc6Z+XgQ==", + "optional": true, + "dependencies": { + "@web3modal/core": "4.0.13", + "@web3modal/scaffold-utils": "4.0.13" + }, + "peerDependencies": { + "lit": ">=3", + "valtio": ">=1 <2" + } + }, + "examples/4337-passkeys/node_modules/@web3modal/ui": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@web3modal/ui/-/ui-4.0.13.tgz", + "integrity": "sha512-G2SBYI1e7jIOjtbk5E/CoN0TyHj4mFG0L0FAsqJWGDONbwq+rYEA7pjyIY5Tobh7vgadQZvrANb5KUJfI6tCZQ==", + "dependencies": { + "lit": "3.1.0", + "qrcode": "1.5.3" + } + }, + "examples/4337-passkeys/node_modules/@web3modal/ui/node_modules/lit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lit/-/lit-3.1.0.tgz", + "integrity": "sha512-rzo/hmUqX8zmOdamDAeydfjsGXbbdtAFqMhmocnh2j9aDYqbu0fjXygjCa0T99Od9VQ/2itwaGrjZz/ZELVl7w==", + "dependencies": { + "@lit/reactive-element": "^2.0.0", + "lit-element": "^4.0.0", + "lit-html": "^3.1.0" + } + }, + "examples/4337-passkeys/node_modules/@web3modal/wallet": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/@web3modal/wallet/-/wallet-4.0.13.tgz", + "integrity": "sha512-Luqnu/zYWruBk4w5cQM6I8fxKvVJ8b5TiMm7r0PNTyKuS5MNIeVE6BBtT5PR/S1q5XM5BKh/nQ8DBky8GhuSPA==", + "dependencies": { + "zod": "3.22.4" + } + }, + "examples/4337-passkeys/node_modules/ethers": { "version": "6.11.1", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.11.1.tgz", + "integrity": "sha512-mxTAE6wqJQAbp5QAe/+o+rXOID7Nw91OZXvgpjDa1r4fAbq2Nu314oEZSbjoRLacuCzs7kUC3clEvkCQowffGg==", "funding": [ { "type": "individual", @@ -320,7 +469,6 @@ "url": "https://www.buymeacoffee.com/ricmoo" } ], - "license": "MIT", "dependencies": { "@adraffy/ens-normalize": "1.10.1", "@noble/curves": "1.2.0", @@ -334,13 +482,45 @@ "node": ">=14.0.0" } }, - "examples/safe-4337-passkeys/node_modules/tslib": { + "examples/4337-passkeys/node_modules/lit": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lit/-/lit-3.1.2.tgz", + "integrity": "sha512-VZx5iAyMtX7CV4K8iTLdCkMaYZ7ipjJZ0JcSdJ0zIdGxxyurjIn7yuuSxNBD7QmjvcNJwr0JS4cAdAtsy7gZ6w==", + "optional": true, + "peer": true, + "dependencies": { + "@lit/reactive-element": "^2.0.4", + "lit-element": "^4.0.4", + "lit-html": "^3.1.2" + } + }, + "examples/4337-passkeys/node_modules/lit-element": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/lit-element/-/lit-element-4.0.4.tgz", + "integrity": "sha512-98CvgulX6eCPs6TyAIQoJZBCQPo80rgXR+dVBs61cstJXqtI+USQZAbA4gFHh6L/mxBx9MrgPLHLsUgDUHAcCQ==", + "dependencies": { + "@lit-labs/ssr-dom-shim": "^1.2.0", + "@lit/reactive-element": "^2.0.4", + "lit-html": "^3.1.2" + } + }, + "examples/4337-passkeys/node_modules/lit-html": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-3.1.2.tgz", + "integrity": "sha512-3OBZSUrPnAHoKJ9AMjRL/m01YJxQMf+TMHanNtTHG68ubjnZxK0RFl102DPzsw4mWnHibfZIBJm3LWCZ/LmMvg==", + "dependencies": { + "@types/trusted-types": "^2.0.2" + } + }, + "examples/4337-passkeys/node_modules/tslib": { "version": "2.4.0", - "license": "0BSD" + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" }, - "examples/safe-4337-passkeys/node_modules/ws": { + "examples/4337-passkeys/node_modules/ws": { "version": "8.5.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", + "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", "engines": { "node": ">=10.0.0" }, @@ -357,8 +537,26 @@ } } }, + "examples/safe-4337-passkeys": { + "version": "0.0.0", + "extraneous": true, + "dependencies": { + "@safe-global/safe-erc4337": "^0.3.0", + "@web3modal/ethers": "^4.0.5", + "ethers": "^6.11.1", + "react": "^18.2.0", + "react-dom": "^18.2.0" + }, + "devDependencies": { + "@types/react": "^18.2.55", + "@types/react-dom": "^18.2.19", + "@vitejs/plugin-react-swc": "^3.6.0", + "typescript": "^5.3.3", + "vite": "^5.1.3" + } + }, "modules/4337": { - "name": "@safe-global/safe-erc4337", + "name": "@safe-global/safe-4337", "version": "0.3.0", "hasInstallScript": true, "license": "GPL-3.0", @@ -991,7 +1189,7 @@ "@account-abstraction/contracts": "^0.7.0", "@noble/curves": "^1.3.0", "@nomicfoundation/hardhat-toolbox": "^4.0.0", - "@safe-global/safe-erc4337": "^0.3.0", + "@safe-global/safe-4337": "^0.3.0", "@simplewebauthn/server": "^9.0.3", "cbor": "^9.0.2", "dotenv": "^16.4.5", @@ -3684,8 +3882,8 @@ "linux" ] }, - "node_modules/@safe-global/4337-gas-metering": { - "resolved": "examples/4337-gas-metering", + "node_modules/@safe-global/safe-4337": { + "resolved": "modules/4337", "link": true }, "node_modules/@safe-global/safe-allowance-module": { @@ -3732,8 +3930,12 @@ "node": ">=10" } }, - "node_modules/@safe-global/safe-erc4337": { - "resolved": "modules/4337", + "node_modules/@safe-global/safe-modules-example-4337-gas-metering": { + "resolved": "examples/4337-gas-metering", + "link": true + }, + "node_modules/@safe-global/safe-modules-example-4337-passkeys": { + "resolved": "examples/4337-passkeys", "link": true }, "node_modules/@safe-global/safe-passkey": { @@ -5031,178 +5233,6 @@ "tslib": "1.14.1" } }, - "node_modules/@web3modal/common": { - "version": "4.0.5", - "license": "Apache-2.0", - "dependencies": { - "dayjs": "1.11.10" - } - }, - "node_modules/@web3modal/core": { - "version": "4.0.5", - "license": "Apache-2.0", - "dependencies": { - "@web3modal/common": "4.0.5", - "@web3modal/wallet": "4.0.5", - "valtio": "1.11.2" - } - }, - "node_modules/@web3modal/polyfills": { - "version": "4.0.5", - "license": "Apache-2.0", - "dependencies": { - "buffer": "6.0.3" - } - }, - "node_modules/@web3modal/scaffold": { - "version": "4.0.5", - "license": "Apache-2.0", - "dependencies": { - "@web3modal/common": "4.0.5", - "@web3modal/core": "4.0.5", - "@web3modal/ui": "4.0.5", - "lit": "3.1.0" - } - }, - "node_modules/@web3modal/scaffold-react": { - "version": "4.0.5", - "license": "Apache-2.0", - "dependencies": { - "@web3modal/scaffold": "4.0.5" - }, - "peerDependencies": { - "react": ">=17", - "react-dom": ">=17" - } - }, - "node_modules/@web3modal/scaffold-utils": { - "version": "4.0.5", - "license": "Apache-2.0", - "dependencies": { - "@web3modal/polyfills": "4.0.5", - "@web3modal/scaffold": "4.0.5", - "valtio": "1.11.2" - } - }, - "node_modules/@web3modal/scaffold-vue": { - "version": "4.0.5", - "license": "Apache-2.0", - "dependencies": { - "@web3modal/scaffold": "4.0.5" - }, - "peerDependencies": { - "vue": ">=3" - } - }, - "node_modules/@web3modal/scaffold/node_modules/@lit/reactive-element": { - "version": "2.0.4", - "license": "BSD-3-Clause", - "dependencies": { - "@lit-labs/ssr-dom-shim": "^1.2.0" - } - }, - "node_modules/@web3modal/scaffold/node_modules/lit": { - "version": "3.1.0", - "license": "BSD-3-Clause", - "dependencies": { - "@lit/reactive-element": "^2.0.0", - "lit-element": "^4.0.0", - "lit-html": "^3.1.0" - } - }, - "node_modules/@web3modal/scaffold/node_modules/lit-element": { - "version": "4.0.4", - "license": "BSD-3-Clause", - "dependencies": { - "@lit-labs/ssr-dom-shim": "^1.2.0", - "@lit/reactive-element": "^2.0.4", - "lit-html": "^3.1.2" - } - }, - "node_modules/@web3modal/scaffold/node_modules/lit-html": { - "version": "3.1.2", - "license": "BSD-3-Clause", - "dependencies": { - "@types/trusted-types": "^2.0.2" - } - }, - "node_modules/@web3modal/siwe": { - "version": "4.0.5", - "license": "Apache-2.0", - "optional": true, - "dependencies": { - "@web3modal/core": "4.0.5", - "@web3modal/scaffold-utils": "4.0.5" - }, - "optionalDependencies": { - "react": ">=17", - "react-dom": ">=17", - "vue": ">=3" - }, - "peerDependencies": { - "react": ">=17", - "react-dom": ">=17", - "vue": ">=3" - }, - "peerDependenciesMeta": { - "react": { - "optional": true - }, - "react-dom": { - "optional": true - }, - "vue": { - "optional": true - } - } - }, - "node_modules/@web3modal/ui": { - "version": "4.0.5", - "license": "Apache-2.0", - "dependencies": { - "lit": "3.1.0", - "qrcode": "1.5.3" - } - }, - "node_modules/@web3modal/ui/node_modules/@lit/reactive-element": { - "version": "2.0.4", - "license": "BSD-3-Clause", - "dependencies": { - "@lit-labs/ssr-dom-shim": "^1.2.0" - } - }, - "node_modules/@web3modal/ui/node_modules/lit": { - "version": "3.1.0", - "license": "BSD-3-Clause", - "dependencies": { - "@lit/reactive-element": "^2.0.0", - "lit-element": "^4.0.0", - "lit-html": "^3.1.0" - } - }, - "node_modules/@web3modal/ui/node_modules/lit-element": { - "version": "4.0.4", - "license": "BSD-3-Clause", - "dependencies": { - "@lit-labs/ssr-dom-shim": "^1.2.0", - "@lit/reactive-element": "^2.0.4", - "lit-html": "^3.1.2" - } - }, - "node_modules/@web3modal/ui/node_modules/lit-html": { - "version": "3.1.2", - "license": "BSD-3-Clause", - "dependencies": { - "@types/trusted-types": "^2.0.2" - } - }, - "node_modules/@web3modal/wallet": { - "version": "4.0.5", - "license": "Apache-2.0", - "dependencies": { - "zod": "3.22.4" - } - }, "node_modules/abbrev": { "version": "1.0.9", "dev": true, @@ -12812,10 +12842,6 @@ "queue-microtask": "^1.2.2" } }, - "node_modules/safe-4337-passkeys": { - "resolved": "examples/safe-4337-passkeys", - "link": true - }, "node_modules/safe-array-concat": { "version": "1.0.1", "dev": true, diff --git a/package.json b/package.json index 4f17026d..2dd1df5d 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "dist/index.js", "workspaces": [ "modules/*", + "packages/*", "examples/*" ], "scripts": {