diff --git a/bun.lockb b/bun.lockb index da5f021a..8007b749 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md new file mode 100644 index 00000000..8b7f8c72 --- /dev/null +++ b/packages/core/CHANGELOG.md @@ -0,0 +1,7 @@ +# @zerodev/sdk + +## 5.2.4 + +### Patch Changes + +- Update permissionless@0.1.18 and return maxFeePerGas and maxPriorityFeePerGas in response from sponsorUserOperation action diff --git a/packages/core/actions/paymaster/sponsorUserOperation.ts b/packages/core/actions/paymaster/sponsorUserOperation.ts index 5b8b5de7..69289683 100644 --- a/packages/core/actions/paymaster/sponsorUserOperation.ts +++ b/packages/core/actions/paymaster/sponsorUserOperation.ts @@ -1,13 +1,10 @@ +import { getEntryPointVersion } from "permissionless" import type { ENTRYPOINT_ADDRESS_V06_TYPE, - EntryPoint, - GetEntryPointVersion + EntryPoint } from "permissionless/types/entrypoint" -import type { - UserOperation, - UserOperationWithBigIntAsHex -} from "permissionless/types/userOperation.js" -import { ENTRYPOINT_ADDRESS_V06, deepHexlify } from "permissionless/utils" +import type { UserOperation } from "permissionless/types/userOperation.js" +import { deepHexlify } from "permissionless/utils" import type { Address, Hex } from "viem" import type { PartialBy } from "viem/types/utils" import type { ZeroDevPaymasterClient } from "../../clients/paymasterClient.js" @@ -32,6 +29,8 @@ export type SponsorUserOperationParameters = { shouldConsume?: boolean } +export type PartialPick = Partial> + export type SponsorUserOperationReturnType = entryPoint extends ENTRYPOINT_ADDRESS_V06_TYPE ? Pick< @@ -40,7 +39,11 @@ export type SponsorUserOperationReturnType = | "verificationGasLimit" | "preVerificationGas" | "paymasterAndData" - > + > & + PartialPick< + UserOperation<"v0.6">, + "maxFeePerGas" | "maxPriorityFeePerGas" + > : Pick< UserOperation<"v0.7">, | "callGasLimit" @@ -50,7 +53,11 @@ export type SponsorUserOperationReturnType = | "paymasterVerificationGasLimit" | "paymasterPostOpGasLimit" | "paymasterData" - > + > & + PartialPick< + UserOperation<"v0.7">, + "maxFeePerGas" | "maxPriorityFeePerGas" + > /** * Returns paymasterAndData & updated gas parameters required to sponsor a userOperation. @@ -64,11 +71,7 @@ export const sponsorUserOperation = async ( params: [ { chainId: client.chain?.id as number, - userOp: deepHexlify( - args.userOperation - ) as UserOperationWithBigIntAsHex< - GetEntryPointVersion - >, + userOp: deepHexlify(args.userOperation), entryPointAddress: args.entryPoint, gasTokenData: args.gasToken && { tokenAddress: args.gasToken @@ -78,22 +81,18 @@ export const sponsorUserOperation = async ( } ] }) - if (args.entryPoint === ENTRYPOINT_ADDRESS_V06) { - const responseV06 = response as { - paymasterAndData: Hex - preVerificationGas: Hex - verificationGasLimit: Hex - callGasLimit: Hex - paymaster?: never - paymasterVerificationGasLimit?: never - paymasterPostOpGasLimit?: never - paymasterData?: never - } + const entryPointVersion = getEntryPointVersion(args.entryPoint) + if (entryPointVersion === "v0.6") { return { - paymasterAndData: responseV06.paymasterAndData, - preVerificationGas: BigInt(responseV06.preVerificationGas), - verificationGasLimit: BigInt(responseV06.verificationGasLimit), - callGasLimit: BigInt(responseV06.callGasLimit) + paymasterAndData: response.paymasterAndData, + preVerificationGas: BigInt(response.preVerificationGas), + verificationGasLimit: BigInt(response.verificationGasLimit), + callGasLimit: BigInt(response.callGasLimit), + maxFeePerGas: + response.maxFeePerGas && BigInt(response.maxFeePerGas), + maxPriorityFeePerGas: + response.maxPriorityFeePerGas && + BigInt(response.maxPriorityFeePerGas) } as SponsorUserOperationReturnType } const responseV07 = response as { @@ -118,24 +117,4 @@ export const sponsorUserOperation = async ( paymasterPostOpGasLimit: BigInt(responseV07.paymasterPostOpGasLimit), paymasterData: responseV07.paymasterData } as SponsorUserOperationReturnType - // [TODO] Add gas price params in the response in permissionless - // let result: UserOperation<"v0.6"> = { - // ...args.userOperation, - // paymasterAndData: response.paymasterAndData, - // preVerificationGas: BigInt(response.preVerificationGas), - // verificationGasLimit: BigInt(response.verificationGasLimit), - // callGasLimit: BigInt(response.callGasLimit) - // } - // if ( - // response.maxFeePerGas !== undefined && - // response.maxPriorityFeePerGas !== undefined - // ) { - // result = { - // ...result, - // maxFeePerGas: BigInt(response.maxFeePerGas), - // maxPriorityFeePerGas: BigInt(response.maxPriorityFeePerGas) - // } - // } - - // return result } diff --git a/packages/core/package.json b/packages/core/package.json index 213f66c5..195ef67e 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@zerodev/sdk", - "version": "5.2.3", + "version": "5.2.4", "author": "ZeroDev", "main": "./_cjs/index.js", "module": "./_esm/index.js", @@ -91,7 +91,7 @@ }, "peerDependencies": { "viem": "^2.9.17", - "permissionless": "^0.1.17" + "permissionless": "^0.1.18" }, "dependencies": { "semver": "^7.6.0" diff --git a/packages/core/types/kernel.ts b/packages/core/types/kernel.ts index 3eef4db1..9a2035f5 100644 --- a/packages/core/types/kernel.ts +++ b/packages/core/types/kernel.ts @@ -46,8 +46,8 @@ export type ZeroDevPaymasterRpcSchema = [ preVerificationGas: Hex verificationGasLimit: Hex callGasLimit: Hex - maxFeePerGas: Hex - maxPriorityFeePerGas: Hex + maxFeePerGas?: Hex + maxPriorityFeePerGas?: Hex paymaster?: never paymasterVerificationGasLimit?: never paymasterPostOpGasLimit?: never @@ -61,6 +61,8 @@ export type ZeroDevPaymasterRpcSchema = [ paymasterVerificationGasLimit: Hex paymasterPostOpGasLimit: Hex paymasterData: Hex + maxFeePerGas?: Hex + maxPriorityFeePerGas?: Hex paymasterAndData?: never } }, diff --git a/packages/presets/CHANGELOG.md b/packages/presets/CHANGELOG.md new file mode 100644 index 00000000..292353ff --- /dev/null +++ b/packages/presets/CHANGELOG.md @@ -0,0 +1,7 @@ +# @zerodev/presets + +## 5.2.2 + +### Patch Changes + +- Update permissionless@0.1.18 diff --git a/packages/presets/package.json b/packages/presets/package.json index b55b4f74..caf1de91 100644 --- a/packages/presets/package.json +++ b/packages/presets/package.json @@ -1,6 +1,6 @@ { "name": "@zerodev/presets", - "version": "5.2.1", + "version": "5.2.2", "author": "ZeroDev", "main": "./_cjs/index.js", "module": "./_esm/index.js", @@ -52,7 +52,7 @@ "typescript": "^5.0.0", "@zerodev/sdk": "^5.2.1", "@zerodev/ecdsa-validator": "^5.2.1", - "permissionless": "^0.1.17", + "permissionless": "^0.1.18", "viem": "^2.9.17" } } diff --git a/packages/test/ecdsaKernelAccount.test.ts b/packages/test/ecdsaKernelAccount.test.ts index e7d1badc..f8f774a7 100644 --- a/packages/test/ecdsaKernelAccount.test.ts +++ b/packages/test/ecdsaKernelAccount.test.ts @@ -464,6 +464,9 @@ describe("ECDSA kernel Account", () => { userOperation: userOp }) expect(userOpHash).toHaveLength(66) + await bundlerClient.waitForUserOperationReceipt({ + hash: userOpHash + }) await waitForNonceUpdate() }, diff --git a/packages/test/package.json b/packages/test/package.json index 6a902c23..50623da9 100644 --- a/packages/test/package.json +++ b/packages/test/package.json @@ -12,6 +12,6 @@ "@zerodev/ecdsa-validator": "workspace:*", "@zerodev/session-key": "workspace:*", "@zerodev/modular-permission": "workspace:*", - "permissionless": "^0.1.17" + "permissionless": "^0.1.18" } } diff --git a/plugins/ecdsa/CHANGELOG.md b/plugins/ecdsa/CHANGELOG.md new file mode 100644 index 00000000..6600a27b --- /dev/null +++ b/plugins/ecdsa/CHANGELOG.md @@ -0,0 +1,7 @@ +# @zerodev/ecdsa-validator + +## 5.2.3 + +### Patch Changes + +- Update permissionless@0.1.18 diff --git a/plugins/ecdsa/package.json b/plugins/ecdsa/package.json index fb29b936..513e9bda 100644 --- a/plugins/ecdsa/package.json +++ b/plugins/ecdsa/package.json @@ -1,6 +1,6 @@ { "name": "@zerodev/ecdsa-validator", - "version": "5.2.2", + "version": "5.2.3", "author": "ZeroDev", "main": "./_cjs/index.js", "module": "./_esm/index.js", @@ -37,6 +37,6 @@ "peerDependencies": { "viem": "^2.9.17", "@zerodev/sdk": "^5.2.1", - "permissionless": "^0.1.17" + "permissionless": "^0.1.18" } } diff --git a/plugins/modularPermission/CHANGELOG.md b/plugins/modularPermission/CHANGELOG.md new file mode 100644 index 00000000..8880252c --- /dev/null +++ b/plugins/modularPermission/CHANGELOG.md @@ -0,0 +1,7 @@ +# @zerodev/modular-permission + +## 5.2.2 + +### Patch Changes + +- Update permissionless@0.1.18 diff --git a/plugins/modularPermission/package.json b/plugins/modularPermission/package.json index d608bc48..34cbf598 100644 --- a/plugins/modularPermission/package.json +++ b/plugins/modularPermission/package.json @@ -1,6 +1,6 @@ { "name": "@zerodev/modular-permission", - "version": "5.2.1", + "version": "5.2.2", "author": "ZeroDev", "main": "./_cjs/index.js", "module": "./_esm/index.js", @@ -58,6 +58,6 @@ "peerDependencies": { "viem": "^2.9.17", "@zerodev/sdk": "^5.2.1", - "permissionless": "^0.1.17" + "permissionless": "^0.1.18" } } diff --git a/plugins/passkey/CHANGELOG.md b/plugins/passkey/CHANGELOG.md new file mode 100644 index 00000000..45eead5b --- /dev/null +++ b/plugins/passkey/CHANGELOG.md @@ -0,0 +1,7 @@ +# @zerodev/passkey-validator + +## 5.2.3 + +### Patch Changes + +- Update permissionless@0.1.18 diff --git a/plugins/passkey/package.json b/plugins/passkey/package.json index b9630702..70bccdc5 100644 --- a/plugins/passkey/package.json +++ b/plugins/passkey/package.json @@ -1,6 +1,6 @@ { "name": "@zerodev/passkey-validator", - "version": "5.2.2", + "version": "5.2.3", "author": "ZeroDev", "main": "./_cjs/index.js", "module": "./_esm/index.js", @@ -41,6 +41,6 @@ "peerDependencies": { "viem": "^2.9.17", "@zerodev/sdk": "^5.2.1", - "permissionless": "^0.1.17" + "permissionless": "^0.1.18" } } diff --git a/plugins/permission/CHANGELOG.md b/plugins/permission/CHANGELOG.md new file mode 100644 index 00000000..3f8704f7 --- /dev/null +++ b/plugins/permission/CHANGELOG.md @@ -0,0 +1,7 @@ +# @zerodev/permissions + +## 5.2.2 + +### Patch Changes + +- Update permissionless@0.1.18 diff --git a/plugins/permission/package.json b/plugins/permission/package.json index 73230803..6c6bae0d 100644 --- a/plugins/permission/package.json +++ b/plugins/permission/package.json @@ -1,6 +1,6 @@ { "name": "@zerodev/permissions", - "version": "5.2.1", + "version": "5.2.2", "author": "ZeroDev", "main": "./_cjs/index.js", "module": "./_esm/index.js", @@ -58,6 +58,6 @@ "peerDependencies": { "viem": "^2.9.17", "@zerodev/sdk": "^5.2.1", - "permissionless": "^0.1.17" + "permissionless": "^0.1.18" } } diff --git a/plugins/session-key/CHANGELOG.md b/plugins/session-key/CHANGELOG.md new file mode 100644 index 00000000..c6af5d00 --- /dev/null +++ b/plugins/session-key/CHANGELOG.md @@ -0,0 +1,7 @@ +# @zerodev/session-key + +## 5.2.2 + +### Patch Changes + +- Update permissionless@0.1.18 diff --git a/plugins/session-key/package.json b/plugins/session-key/package.json index 6b7f0949..39555222 100644 --- a/plugins/session-key/package.json +++ b/plugins/session-key/package.json @@ -1,6 +1,6 @@ { "name": "@zerodev/session-key", - "version": "5.2.1", + "version": "5.2.2", "author": "ZeroDev", "main": "./_cjs/index.js", "module": "./_esm/index.js", @@ -40,6 +40,6 @@ "peerDependencies": { "viem": "^2.9.17", "@zerodev/sdk": "^5.2.1", - "permissionless": "^0.1.17" + "permissionless": "^0.1.18" } } diff --git a/plugins/weighted-ecdsa/CHANGELOG.md b/plugins/weighted-ecdsa/CHANGELOG.md new file mode 100644 index 00000000..bc68dd8a --- /dev/null +++ b/plugins/weighted-ecdsa/CHANGELOG.md @@ -0,0 +1,7 @@ +# @zerodev/weighted-ecdsa-validator + +## 5.2.2 + +### Patch Changes + +- Update permissionless@0.1.18 diff --git a/plugins/weighted-ecdsa/package.json b/plugins/weighted-ecdsa/package.json index a6c482d2..8818dfeb 100644 --- a/plugins/weighted-ecdsa/package.json +++ b/plugins/weighted-ecdsa/package.json @@ -1,6 +1,6 @@ { "name": "@zerodev/weighted-ecdsa-validator", - "version": "5.2.1", + "version": "5.2.2", "author": "ZeroDev", "main": "./_cjs/index.js", "module": "./_esm/index.js", @@ -37,6 +37,6 @@ "peerDependencies": { "viem": "^2.9.17", "@zerodev/sdk": "^5.2.1", - "permissionless": "^0.1.17" + "permissionless": "^0.1.18" } }