From e3960b0f1b68a33b79c309810d59d24a81341350 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 2 Oct 2024 15:33:12 +0000 Subject: [PATCH 1/3] Version Packages --- .changeset/metal-ravens-mate.md | 5 ----- .changeset/proud-rings-march.md | 5 ----- .changeset/stale-roses-compare.md | 5 ----- packages/permissionless/CHANGELOG.md | 8 ++++++++ packages/permissionless/package.json | 10 ++++++++-- 5 files changed, 16 insertions(+), 17 deletions(-) delete mode 100644 .changeset/metal-ravens-mate.md delete mode 100644 .changeset/proud-rings-march.md delete mode 100644 .changeset/stale-roses-compare.md diff --git a/.changeset/metal-ravens-mate.md b/.changeset/metal-ravens-mate.md deleted file mode 100644 index 31c4bc4d..00000000 --- a/.changeset/metal-ravens-mate.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"permissionless": patch ---- - -Added utility functions to encode 7579 function calldata diff --git a/.changeset/proud-rings-march.md b/.changeset/proud-rings-march.md deleted file mode 100644 index bddf6ce9..00000000 --- a/.changeset/proud-rings-march.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"permissionless": patch ---- - -Added support to send calls with 7579 functions and override paymaster props diff --git a/.changeset/stale-roses-compare.md b/.changeset/stale-roses-compare.md deleted file mode 100644 index 8fe8c9b0..00000000 --- a/.changeset/stale-roses-compare.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"permissionless": patch ---- - -Added support for initData & deInitData diff --git a/packages/permissionless/CHANGELOG.md b/packages/permissionless/CHANGELOG.md index 5b24410c..cb65c992 100644 --- a/packages/permissionless/CHANGELOG.md +++ b/packages/permissionless/CHANGELOG.md @@ -1,5 +1,13 @@ # permissionless +## 0.2.4 + +### Patch Changes + +- 7d4602c831430744916dda33983be0583d9b0662: Added utility functions to encode 7579 function calldata +- d23ee0d5b530134756ea098f6233910f79cba83e: Added support to send calls with 7579 functions and override paymaster props +- d23ee0d5b530134756ea098f6233910f79cba83e: Added support for initData & deInitData + ## 0.2.3 ### Patch Changes diff --git a/packages/permissionless/package.json b/packages/permissionless/package.json index 176fc1dd..a2d4dd86 100644 --- a/packages/permissionless/package.json +++ b/packages/permissionless/package.json @@ -1,6 +1,6 @@ { "name": "permissionless", - "version": "0.2.3", + "version": "0.2.4", "author": "Pimlico", "homepage": "https://docs.pimlico.io/permissionless", "repository": "github:pimlicolabs/permissionless.js", @@ -11,7 +11,13 @@ "type": "module", "sideEffects": false, "description": "A utility library for working with ERC-4337", - "keywords": ["ethereum", "erc-4337", "eip-4337", "paymaster", "bundler"], + "keywords": [ + "ethereum", + "erc-4337", + "eip-4337", + "paymaster", + "bundler" + ], "license": "MIT", "exports": { ".": { From 9efabbfac5b8f192be814d25976e0133a21071d6 Mon Sep 17 00:00:00 2001 From: Garvit Khatri Date: Wed, 2 Oct 2024 16:39:08 +0100 Subject: [PATCH 2/3] Update readme --- packages/permissionless/README.md | 64 ++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 18 deletions(-) diff --git a/packages/permissionless/README.md b/packages/permissionless/README.md index c4f617c0..31f51bb6 100644 --- a/packages/permissionless/README.md +++ b/packages/permissionless/README.md @@ -4,21 +4,33 @@ ![Node Version](https://img.shields.io/badge/node-20.x-green) -permissionless.js is a TypeScript library built on top of [viem](https://viem.sh) for deploying and managing [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) smart accounts, interacting with bundlers and paymasters, and leveraging custom signers. +permissionless.js is a TypeScript library built on top of +[viem](https://viem.sh) for deploying and managing +[ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) smart accounts, interacting +with bundlers and paymasters, and leveraging custom signers. ## Features -- **High-Level Smart Account Support**: We support a high-level API for deploying and managing smart accounts, including some of the most popular implementations ([Safe](https://safe.global), [Kernel](https://zerodev.app), [Biconomy](https://biconomy.io), etc.) -- **Bundler Support**: We support all bundler actions following [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337#rpc-methods-eth-namespace). -- **Gas Sponsorship**: We support paymaster actions to allow you to easily sponsor gas fees. -- **User Operation Utility Functions**: We provide many low-level utility functions useful for dealing with User Operations. -- **Modular and Extensible**: We allow you to easily create and plug in your own smart account systems, bundlers, paymasters, and signers. -- **Built on & for viem**: permissionless.js is designed to be a thin wrapper around viem, maintaining the same style and overall feel viem provides. +- **High-Level Smart Account Support**: We support a high-level API for + deploying and managing smart accounts, including some of the most popular + implementations ([Safe](https://safe.global), [Kernel](https://zerodev.app), + [Biconomy](https://biconomy.io), etc.) +- **Bundler Support**: We support all bundler actions following + [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337#rpc-methods-eth-namespace). +- **Gas Sponsorship**: We support paymaster actions to allow you to easily + sponsor gas fees. +- **User Operation Utility Functions**: We provide many low-level utility + functions useful for dealing with User Operations. +- **Modular and Extensible**: We allow you to easily create and plug in your own + smart account systems, bundlers, paymasters, and signers. +- **Built on & for viem**: permissionless.js is designed to be a thin wrapper + around viem, maintaining the same style and overall feel viem provides. - and a lot more... ## Documentation -[Take a look at our documentation](https://docs.pimlico.io/permissionless) to learn more about permissionless.js. +[Take a look at our documentation](https://docs.pimlico.io/permissionless) to +learn more about permissionless.js. ## Installation @@ -42,27 +54,43 @@ yarn add viem permissionless ```typescript // Import the required modules. -import { createBundlerClient } from "permissionless" -import { sepolia } from "viem/chains" -import { http } from "viem" +import { createSmartAccountClient } from "permissionless"; +import { createPaymasterClient } from "viem/account-abstraction"; +import { sepolia } from "viem/chains"; +import { http } from "viem"; -// Create the required clients. -const bundlerClient = createBundlerClient({ - chain: sepolia, - transport: http(`https://api.pimlico.io/v1/sepolia/rpc?apikey=${pimlicoApiKey}`) // Use any bundler url +const paymaster = createPaymasterClient({ + transport: http(`https://api.pimlico.io/v2/sepolia/rpc?apikey=${pimlicoApiKey}`) +}) + +const account = toSimpleSmartAccount({ + client: getPublicClient(anvilRpc), + owner: privateKeyToAccount(generatePrivateKey()) }) +// Create the required clients. +const bundlerClient = createSmartAccountClient({ + account, + paymaster: + chain: sepolia, + bundlerTransport: http( + `https://api.pimlico.io/v2/sepolia/rpc?apikey=${pimlicoApiKey}`, + ), // Use any bundler url +}); + // Consume bundler, paymaster, and smart account actions! const userOperationReceipt = await bundlerClient.getUserOperationReceipt({ - hash: "0x5faea6a3af76292c2b23468bbea96ef63fb31360848be195748437f0a79106c8" -}) + hash: "0x5faea6a3af76292c2b23468bbea96ef63fb31360848be195748437f0a79106c8", +}); ``` ## Contributors -For a full explanation of permissionless.js, please visit our [docs page](https://docs.pimlico.io/permissionless) +For a full explanation of permissionless.js, please visit our +[docs page](https://docs.pimlico.io/permissionless) Build permissionless.js locally with: + ```bash bun run build ``` From 90f8a8414e70d7a1c1ad8362e67f4cff1f5ff126 Mon Sep 17 00:00:00 2001 From: plusminushalf Date: Wed, 2 Oct 2024 15:40:18 +0000 Subject: [PATCH 3/3] chore: format --- packages/permissionless/package.json | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/packages/permissionless/package.json b/packages/permissionless/package.json index a2d4dd86..7c0e3229 100644 --- a/packages/permissionless/package.json +++ b/packages/permissionless/package.json @@ -11,13 +11,7 @@ "type": "module", "sideEffects": false, "description": "A utility library for working with ERC-4337", - "keywords": [ - "ethereum", - "erc-4337", - "eip-4337", - "paymaster", - "bundler" - ], + "keywords": ["ethereum", "erc-4337", "eip-4337", "paymaster", "bundler"], "license": "MIT", "exports": { ".": {