From 7ccd9662bbec7cc5277d2c16770d2eb46d5796de Mon Sep 17 00:00:00 2001 From: yaniferhaoui Date: Fri, 13 Sep 2024 11:43:49 +0200 Subject: [PATCH] feat: export some functions --- packages/core/accounts/index.ts | 4 ++++ packages/core/actions/index.ts | 6 ++++++ packages/core/index.ts | 6 +++++- plugins/permission/signers/toEmptyECDSASigner.ts | 4 ++-- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/packages/core/accounts/index.ts b/packages/core/accounts/index.ts index 7e719922..ee787b43 100644 --- a/packages/core/accounts/index.ts +++ b/packages/core/accounts/index.ts @@ -13,3 +13,7 @@ export { KernelFactoryV2Abi } from "./kernel/v2/abi/KernelFactoryV2Abi.js" export { EIP1271Abi } from "./kernel/abi/EIP1271Abi.js" export { addressToEmptyAccount } from "./addressToEmptyAccount.js" export * from "./utils/index.js" +export { accountMetadata } from "./kernel/utils/common/accountMetadata.js" +export { getActionSelector } from "./kernel/utils/common/getActionSelector.js" +export { getPluginsEnableTypedData } from "./kernel/utils/plugins/ep0_7/getPluginsEnableTypedData.js" +export { getKernelV3Nonce } from "./kernel/utils/account/ep0_7/getKernelV3Nonce.js" diff --git a/packages/core/actions/index.ts b/packages/core/actions/index.ts index 76507259..7c15e245 100644 --- a/packages/core/actions/index.ts +++ b/packages/core/actions/index.ts @@ -10,6 +10,12 @@ export { type SignUserOperationReturnType } from "./account-client/signUserOperation.js" +export { + type PrepareUserOperationParameters, + type PrepareUserOperationReturnType, + prepareUserOperation, +} from "./account-client/prepareUserOperation.js" + export { getUserOperationGasPrice, type GetUserOperationGasPriceReturnType diff --git a/packages/core/index.ts b/packages/core/index.ts index 1f995f8c..1e0116df 100644 --- a/packages/core/index.ts +++ b/packages/core/index.ts @@ -6,7 +6,11 @@ export { type KernelSmartAccount, KERNEL_ADDRESSES, addressToEmptyAccount, - EIP1271Abi + EIP1271Abi, + getKernelV3Nonce, + accountMetadata, + getActionSelector, + getPluginsEnableTypedData } from "./accounts/index.js" export { sponsorUserOperation, diff --git a/plugins/permission/signers/toEmptyECDSASigner.ts b/plugins/permission/signers/toEmptyECDSASigner.ts index 8ae92b6e..a36c379e 100644 --- a/plugins/permission/signers/toEmptyECDSASigner.ts +++ b/plugins/permission/signers/toEmptyECDSASigner.ts @@ -5,7 +5,7 @@ import { toAccount } from "viem/accounts" import { ECDSA_SIGNER_CONTRACT } from "../constants.js" import type { ModularSigner } from "../types.js" -export function toEmptyECDSASigner(address: Address): ModularSigner { +export function toEmptyECDSASigner(address: Address, signerContractAddress: Address = ECDSA_SIGNER_CONTRACT): ModularSigner { const account = toAccount({ address, async signMessage() { @@ -25,7 +25,7 @@ export function toEmptyECDSASigner(address: Address): ModularSigner { }) return { account, - signerContractAddress: ECDSA_SIGNER_CONTRACT, + signerContractAddress: signerContractAddress, getSignerData: () => { return address },