diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ea9aeb34..6e32e43de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # @biconomy/sdk +## 0.0.29 + +### Patch Changes + +- AbstractJS rebrand +- meeNode support +- useTestBundler + ## 0.0.28 ### Patch Changes diff --git a/README.md b/README.md index 41aaa070d..f918041b4 100644 --- a/README.md +++ b/README.md @@ -32,21 +32,31 @@ bun add @biconomy/sdk viem @rhinestone/module-sdk 2. **Basic Usage:** ```typescript -import { createSmartAccountClient } from "@biconomy/sdk"; -import { http } from "viem"; - -const nexusClient = await createSmartAccountClient({ - signer: account, - chain, - transport: http(), - bundlerTransport: http(bundlerUrl), -}); - -const hash = await nexusClient.sendTransaction({ - calls: [{ to: "0x...", value: 1 }] -}); - -const { status, transactionHash } = await nexusClient.waitForTransactionReceipt({ hash }); +import { toMultichainNexusAccount, mcUSDC } from "@biconomy/sdk"; +import { base, optimism } from "viem/chains"; +import { privateKeyToAccount } from "viem/accounts"; + +const eoaAccount = privateKeyToAccount(`0x${process.env.PRIVATE_KEY}`) +const mcNexus = await toMultichainNexusAccount({ + chains: [base, optimism], + signer: eoaAccount +}) +const meeClient = createMeeClient({ account: mcNexus }) + +const quote = await meeClient.getQuote({ + instructions: [{ + calls: [{ to: "0x...", value: 1 }], + chainId: base.id + }], + feeToken: { + address: mcUSDC.addressOn(base.id), // Token used to pay for the transaction + chainId: base.id // Chain where the payment will be processed + } +}) + +// Execute the quote and get back a transaction hash +// This sends the transaction to the network +const { hash } = await meeClient.executeQuote({ quote }) ``` ### Testing diff --git a/package.json b/package.json index ec470ec0b..d274fd83b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@biconomy/sdk", - "version": "0.0.28", + "version": "0.0.29", "author": "Biconomy", "repository": "github:bcnmy/sdk", "main": "./dist/_cjs/index.js", diff --git a/src/sdk/account/decorators/build.ts b/src/sdk/account/decorators/build.ts index e7b1f4ace..148011e27 100644 --- a/src/sdk/account/decorators/build.ts +++ b/src/sdk/account/decorators/build.ts @@ -1,7 +1,7 @@ import type { Instruction } from "../../clients/decorators/mee/getQuote" import type { BaseMultichainSmartAccount } from "../toMultiChainNexusAccount" import { - type BuildDefaultInstructionsParams, + type BuildDefaultParams, buildDefaultInstructions } from "./instructions/buildDefaultInstructions" import { @@ -26,7 +26,7 @@ export type BaseInstructionsParams = { */ export type BuildDefaultInstruction = { type: "default" - data: BuildDefaultInstructionsParams + data: BuildDefaultParams } /** diff --git a/src/sdk/account/decorators/instructions/buildDefaultInstructions.ts b/src/sdk/account/decorators/instructions/buildDefaultInstructions.ts index 5cfecab33..6963a309b 100644 --- a/src/sdk/account/decorators/instructions/buildDefaultInstructions.ts +++ b/src/sdk/account/decorators/instructions/buildDefaultInstructions.ts @@ -9,22 +9,11 @@ export type BuildDefaultParams = { instructions: Instruction[] | Instruction } -/** - * Parameters for building base instructions - * @property currentInstructions - Optional array of {@link Instruction} existing instructions to append to - * @property instructions - Single {@link Instruction} or array of instructions to add - */ -export type BuildDefaultInstructionsParams = BaseInstructionsParams & - BuildDefaultParams - /** * Builds a base set of instructions by combining existing instructions with new ones * * @param baseParams - {@link BaseInstructionsParams} Base configuration - * @param baseParams.currentInstructions - Optional array of existing instructions (defaults to empty array) - * @param params - {@link BuildDefaultInstructionsParams} Instructions configuration - * @param params.instructions - Single instruction or array of instructions to append - * + * @param params - {@link BuildDefaultParams} Instructions configuration * @returns Promise resolving to an array of {@link Instruction} * * @example diff --git a/src/sdk/account/decorators/instructions/buildIntent.ts b/src/sdk/account/decorators/instructions/buildIntent.ts index c144a78f2..01ea6defa 100644 --- a/src/sdk/account/decorators/instructions/buildIntent.ts +++ b/src/sdk/account/decorators/instructions/buildIntent.ts @@ -1,4 +1,4 @@ -import type { Chain, erc20Abi } from "viem" +import type { Chain } from "viem" import type { Instruction } from "../../../clients/decorators/mee" import type { BaseMultichainSmartAccount } from "../../toMultiChainNexusAccount" import type { MultichainToken } from "../../utils/Types" diff --git a/src/sdk/account/toMultiChainNexusAccount.ts b/src/sdk/account/toMultiChainNexusAccount.ts index eb63ee6e2..9937ff881 100644 --- a/src/sdk/account/toMultiChainNexusAccount.ts +++ b/src/sdk/account/toMultiChainNexusAccount.ts @@ -1,4 +1,4 @@ -import { http, type Chain, type erc20Abi } from "viem" +import { http, type Chain } from "viem" import type { Instruction } from "../clients/decorators/mee/getQuote" import { MEE_VALIDATOR_ADDRESS, diff --git a/src/sdk/account/toNexusAccount.addresses.test.ts b/src/sdk/account/toNexusAccount.addresses.test.ts index 52f8cef8c..68ba02fbe 100644 --- a/src/sdk/account/toNexusAccount.addresses.test.ts +++ b/src/sdk/account/toNexusAccount.addresses.test.ts @@ -72,7 +72,8 @@ describe("nexus.account.addresses", async () => { transport: http(), bundlerTransport: http(bundlerUrl), validatorAddress: TEST_ADDRESS_K1_VALIDATOR_ADDRESS, - factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS + factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS, + useTestBundler: true }) nexusAccount = nexusClient.account @@ -139,14 +140,16 @@ describe("nexus.account.addresses", async () => { signer: eoaAccount, chain: base, transport: http(), - bundlerTransport: http(bundlerUrl) + bundlerTransport: http(bundlerUrl), + useTestBundler: true }) const testnetClient = await createSmartAccountClient({ signer: eoaAccount, chain: baseSepolia, transport: http(), - bundlerTransport: http(bundlerUrl) + bundlerTransport: http(bundlerUrl), + useTestBundler: true }) const testnetAddress = await testnetClient.account.getAddress() @@ -164,7 +167,8 @@ describe("nexus.account.addresses", async () => { transport: http(), validatorAddress: MEE_VALIDATOR_ADDRESS, factoryAddress: NEXUS_ACCOUNT_FACTORY, - attesters: [TEMP_MEE_ATTESTER_ADDR] + attesters: [TEMP_MEE_ATTESTER_ADDR], + useTestBundler: true }) const meeAddress = await meeAccount.getAddress() diff --git a/src/sdk/account/toNexusAccount.test.ts b/src/sdk/account/toNexusAccount.test.ts index 952b475b8..67e15fb17 100644 --- a/src/sdk/account/toNexusAccount.test.ts +++ b/src/sdk/account/toNexusAccount.test.ts @@ -98,7 +98,8 @@ describe("nexus.account", async () => { transport: http(), bundlerTransport: http(bundlerUrl), validatorAddress: TEST_ADDRESS_K1_VALIDATOR_ADDRESS, - factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS + factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS, + useTestBundler: true }) nexusAccount = nexusClient.account diff --git a/src/sdk/account/toNexusAccount.ts b/src/sdk/account/toNexusAccount.ts index c4dd5800e..cbe83f3aa 100644 --- a/src/sdk/account/toNexusAccount.ts +++ b/src/sdk/account/toNexusAccount.ts @@ -118,6 +118,8 @@ export type ToNexusSmartAccountParameters = { bootStrapAddress?: Address /** Optional registry address */ registryAddress?: Address + /** Optional use test bundler */ + useTestBundler?: boolean } & Prettify< Pick< ClientConfig, @@ -160,6 +162,7 @@ export type NexusSmartAccountImplementation = SmartAccountImplementation< signer: Signer publicClient: PublicClient walletClient: WalletClient + useTestBundler: boolean } > @@ -196,7 +199,8 @@ export const toNexusAccount = async ( attesters: attesters_ = [RHINESTONE_ATTESTER_ADDRESS], attesterThreshold = 1, bootStrapAddress = NEXUS_BOOTSTRAP_ADDRESS, - registryAddress = REGISTRY_ADDRESS + registryAddress = REGISTRY_ADDRESS, + useTestBundler = false } = parameters const useMeeAccount = addressEquals(validatorAddress, MEE_VALIDATOR_ADDRESS) @@ -600,7 +604,8 @@ export const toNexusAccount = async ( signer, walletClient, publicClient, - attesters: attesters_ + attesters: attesters_, + useTestBundler } }) } diff --git a/src/sdk/account/utils/index.ts b/src/sdk/account/utils/index.ts index 9f7fcb4d8..a63982d9e 100644 --- a/src/sdk/account/utils/index.ts +++ b/src/sdk/account/utils/index.ts @@ -4,7 +4,7 @@ export * from "./Constants.js" export * from "./getChain.js" export * from "./Logger.js" export * from "./toSigner.js" -export * from "../decorators/getNexusAddress.js" +export * from "../decorators" export * from "./toFeeToken.js" export * from "./getMultichainContract.js" export * from "./explorer.js" diff --git a/src/sdk/clients/createBicoBundlerClient.test.ts b/src/sdk/clients/createBicoBundlerClient.test.ts index bed11bef5..c6f852f9f 100644 --- a/src/sdk/clients/createBicoBundlerClient.test.ts +++ b/src/sdk/clients/createBicoBundlerClient.test.ts @@ -44,7 +44,8 @@ describe("bico.bundler", async () => { chain, transport: http(), validatorAddress: TEST_ADDRESS_K1_VALIDATOR_ADDRESS, - factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS + factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS, + useTestBundler: true }) bicoBundler = createBicoBundlerClient({ bundlerUrl, account: nexusAccount }) diff --git a/src/sdk/clients/createBicoPaymasterClient.test.ts b/src/sdk/clients/createBicoPaymasterClient.test.ts index 70b82af78..806579b16 100644 --- a/src/sdk/clients/createBicoPaymasterClient.test.ts +++ b/src/sdk/clients/createBicoPaymasterClient.test.ts @@ -145,8 +145,6 @@ describe.skip("bico.paymaster", async () => { bundlerTransport: http(bundlerUrl) }) - console.log(nexusClient.account.address, "nexusClient.account.address") - const initialBalance = await publicClient.getBalance({ address: nexusAccountAddress }) diff --git a/src/sdk/clients/createBundlerClient.test.ts b/src/sdk/clients/createBundlerClient.test.ts index 03fb1ae46..58525b8eb 100644 --- a/src/sdk/clients/createBundlerClient.test.ts +++ b/src/sdk/clients/createBundlerClient.test.ts @@ -15,18 +15,20 @@ const COMPETITORS = [ { name: "Pimlico", chain: baseSepolia, - bundlerUrl: `https://api.pimlico.io/v2/${baseSepolia.id}/rpc?apikey=${process.env.PIMLICO_API_KEY}` + bundlerUrl: `https://api.pimlico.io/v2/${baseSepolia.id}/rpc?apikey=${process.env.PIMLICO_API_KEY}`, + useTestBundler: true }, { name: "Biconomy", bundlerUrl: `https://bundler.biconomy.io/api/v3/${baseSepolia.id}/nJPK7B3ru.dd7f7861-190d-41bd-af80-6877f74b8f44`, - chain: baseSepolia + chain: baseSepolia, + useTestBundler: false } ] describe.each(COMPETITORS)( "nexus.interoperability with $name", - async ({ bundlerUrl, chain }) => { + async ({ bundlerUrl, chain, useTestBundler }) => { const account = privateKeyToAccount(`0x${process.env.PRIVATE_KEY as Hex}`) const publicClient = createPublicClient({ @@ -45,7 +47,8 @@ describe.each(COMPETITORS)( transport: http(), // You can omit this outside of a testing context validatorAddress: MAINNET_ADDRESS_K1_VALIDATOR_ADDRESS, - factoryAddress: MAINNET_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS + factoryAddress: MAINNET_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS, + useTestBundler }) nexusAccountAddress = await nexusAccount.getCounterFactualAddress() diff --git a/src/sdk/clients/createHttpClient.ts b/src/sdk/clients/createHttpClient.ts index 989ee22a5..ed47206be 100644 --- a/src/sdk/clients/createHttpClient.ts +++ b/src/sdk/clients/createHttpClient.ts @@ -64,6 +64,7 @@ export const createHttpClient = (url: Url): HttpClient => { }) if (!result.ok) { + console.log({ result }) throw new Error(result.statusText) } diff --git a/src/sdk/clients/createNexusSessionClient.test.ts b/src/sdk/clients/createNexusSessionClient.test.ts index bdb5ed100..667e37cbf 100644 --- a/src/sdk/clients/createNexusSessionClient.test.ts +++ b/src/sdk/clients/createNexusSessionClient.test.ts @@ -61,7 +61,8 @@ describe("nexus.session.client", async () => { signer: eoaAccount, chain, transport: http(), - bundlerTransport: http(bundlerUrl) + bundlerTransport: http(bundlerUrl), + useTestBundler: true }) nexusAccountAddress = await nexusClient.account.getCounterFactualAddress() @@ -181,7 +182,8 @@ describe("nexus.session.client", async () => { accountAddress: nexusClient.account.address, signer: sessionKeyAccount, transport: http(), - bundlerTransport: http(bundlerUrl) + bundlerTransport: http(bundlerUrl), + useTestBundler: true }) const usePermissionsModule = toSmartSessionsValidator({ @@ -238,7 +240,8 @@ describe("nexus.session.client", async () => { accountAddress: nexusClient.account.address, signer: sessionKeyAccount, transport: http(), - bundlerTransport: http(bundlerUrl) + bundlerTransport: http(bundlerUrl), + useTestBundler: true }) const useSmartSessionNexusClient = smartSessionNexusClient.extend( diff --git a/src/sdk/clients/createSmartAccountClient.test.ts b/src/sdk/clients/createSmartAccountClient.test.ts index 81911acca..46850ba45 100644 --- a/src/sdk/clients/createSmartAccountClient.test.ts +++ b/src/sdk/clients/createSmartAccountClient.test.ts @@ -74,7 +74,8 @@ describe("nexus.client", async () => { transport: http(), bundlerTransport: http(bundlerUrl), validatorAddress: TEST_ADDRESS_K1_VALIDATOR_ADDRESS, - factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS + factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS, + useTestBundler: true }) nexusAccountAddress = await nexusClient.account.getCounterFactualAddress() }) @@ -277,7 +278,8 @@ describe("nexus.client", async () => { transport: http(), bundlerTransport: http(bundlerUrl), validatorAddress: TEST_ADDRESS_K1_VALIDATOR_ADDRESS, - factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS + factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS, + useTestBundler: true }) const ethersNexusClient = await createSmartAccountClient({ @@ -286,7 +288,8 @@ describe("nexus.client", async () => { transport: http(), bundlerTransport: http(bundlerUrl), validatorAddress: TEST_ADDRESS_K1_VALIDATOR_ADDRESS, - factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS + factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS, + useTestBundler: true }) const sig1 = await viemNexusClient.signMessage({ message: "123" }) @@ -303,7 +306,8 @@ describe("nexus.client", async () => { transport: http(), bundlerTransport: http(bundlerUrl), validatorAddress: TEST_ADDRESS_K1_VALIDATOR_ADDRESS, - factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS + factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS, + useTestBundler: true }) const hash = await ethersNexusClient.sendUserOperation({ diff --git a/src/sdk/clients/createSmartAccountClient.ts b/src/sdk/clients/createSmartAccountClient.ts index 773078fd6..d39f1ddea 100644 --- a/src/sdk/clients/createSmartAccountClient.ts +++ b/src/sdk/clients/createSmartAccountClient.ts @@ -176,6 +176,8 @@ export type SmartAccountClientConfig< bootStrapAddress?: Address /** Registry address */ registryAddress?: Address + /** Use test bundler */ + useTestBundler?: boolean } > @@ -217,6 +219,7 @@ export async function createSmartAccountClient( paymasterContext, attesters, attesterThreshold, + useTestBundler = false, ...bundlerConfig } = parameters @@ -234,7 +237,8 @@ export async function createSmartAccountClient( factoryAddress, validatorAddress, attesters, - attesterThreshold + attesterThreshold, + useTestBundler })) const bundler_ = createBicoBundlerClient({ diff --git a/src/sdk/clients/decorators/bundler/getGasFeeValues.ts b/src/sdk/clients/decorators/bundler/getGasFeeValues.ts index b04dd021f..a9d9c0171 100644 --- a/src/sdk/clients/decorators/bundler/getGasFeeValues.ts +++ b/src/sdk/clients/decorators/bundler/getGasFeeValues.ts @@ -1,4 +1,5 @@ import type { Account, Chain, Client, Hex, Transport } from "viem" +import type { NexusAccount } from "../../../account/toNexusAccount" export type BicoRpcSchema = [ { @@ -69,10 +70,12 @@ export const getGasFeeValues = async ( .toLowerCase() .includes("biconomy") + const usePimlico = !!(client?.account as NexusAccount)?.useTestBundler + const gasPrice = await client.request({ - method: isABiconomyBundler - ? "biconomy_getGasFeeValues" - : "pimlico_getUserOperationGasPrice", + method: usePimlico + ? "pimlico_getUserOperationGasPrice" + : "biconomy_getGasFeeValues", params: [] }) diff --git a/src/sdk/clients/decorators/erc7579/erc7579.decorators.test.ts b/src/sdk/clients/decorators/erc7579/erc7579.decorators.test.ts index dc72b0163..106756001 100644 --- a/src/sdk/clients/decorators/erc7579/erc7579.decorators.test.ts +++ b/src/sdk/clients/decorators/erc7579/erc7579.decorators.test.ts @@ -55,7 +55,8 @@ describe("erc7579.decorators", async () => { transport: http(), bundlerTransport: http(bundlerUrl), validatorAddress: TEST_ADDRESS_K1_VALIDATOR_ADDRESS, - factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS + factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS, + useTestBundler: true }) nexusAccountAddress = await nexusClient.account.getCounterFactualAddress() diff --git a/src/sdk/clients/decorators/smartAccount/account.decorators.test.ts b/src/sdk/clients/decorators/smartAccount/account.decorators.test.ts index 851eae270..737e047bc 100644 --- a/src/sdk/clients/decorators/smartAccount/account.decorators.test.ts +++ b/src/sdk/clients/decorators/smartAccount/account.decorators.test.ts @@ -50,7 +50,8 @@ describe("account.decorators", async () => { transport: http(), bundlerTransport: http(bundlerUrl), validatorAddress: TEST_ADDRESS_K1_VALIDATOR_ADDRESS, - factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS + factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS, + useTestBundler: true }) nexusAccountAddress = await nexusClient.account.getCounterFactualAddress() await fundAndDeployClients(testClient, [nexusClient]) diff --git a/src/sdk/clients/decorators/smartAccount/debugUserOperation.ts b/src/sdk/clients/decorators/smartAccount/debugUserOperation.ts index c0435e834..17cc1778e 100644 --- a/src/sdk/clients/decorators/smartAccount/debugUserOperation.ts +++ b/src/sdk/clients/decorators/smartAccount/debugUserOperation.ts @@ -13,9 +13,9 @@ import { type UserOperationRequest, formatUserOperationRequest, getUserOperationError, + prepareUserOperation, toPackedUserOperation } from "viem/account-abstraction" -import { prepareUserOperationWithoutSignature } from "./prepareUserOperationWithoutSignature" import type { Assign, @@ -133,7 +133,7 @@ export async function debugUserOperation< const request = account ? await getAction( client, - prepareUserOperationWithoutSignature, + prepareUserOperation, "prepareUserOperation" )(parameters as unknown as PrepareUserOperationParameters) : parameters @@ -141,10 +141,7 @@ export async function debugUserOperation< const signature = (parameters.signature || (await account?.signUserOperation(request as UserOperation)))! - const userOpWithSignature = { - ...request, - signature - } as UserOperation + const userOpWithSignature = { ...request, signature } as UserOperation const packed = toPackedUserOperation(userOpWithSignature) console.log( diff --git a/src/sdk/modules/k1Validator/toK1Validator.test.ts b/src/sdk/modules/k1Validator/toK1Validator.test.ts index 6fb443439..bd1b00e05 100644 --- a/src/sdk/modules/k1Validator/toK1Validator.test.ts +++ b/src/sdk/modules/k1Validator/toK1Validator.test.ts @@ -56,7 +56,8 @@ describe("modules.k1Validator", async () => { transport: http(), bundlerTransport: http(bundlerUrl), validatorAddress: TEST_ADDRESS_K1_VALIDATOR_ADDRESS, - factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS + factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS, + useTestBundler: true }) nexusAccountAddress = await nexusClient.account.getCounterFactualAddress() diff --git a/src/sdk/modules/ownableValidator/decorators/ownables.decorators.test.ts b/src/sdk/modules/ownableValidator/decorators/ownables.decorators.test.ts index 2b8717a9e..96df48bb4 100644 --- a/src/sdk/modules/ownableValidator/decorators/ownables.decorators.test.ts +++ b/src/sdk/modules/ownableValidator/decorators/ownables.decorators.test.ts @@ -60,7 +60,8 @@ describe("modules.ownables.decorators", async () => { transport: http(), bundlerTransport: http(bundlerUrl), validatorAddress: TEST_ADDRESS_K1_VALIDATOR_ADDRESS, - factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS + factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS, + useTestBundler: true }) nexusAccountAddress = await nexusClient.account.getCounterFactualAddress() diff --git a/src/sdk/modules/ownableValidator/toOwnableValidator.dx.test.ts b/src/sdk/modules/ownableValidator/toOwnableValidator.dx.test.ts index b5aee66d6..33f9b329d 100644 --- a/src/sdk/modules/ownableValidator/toOwnableValidator.dx.test.ts +++ b/src/sdk/modules/ownableValidator/toOwnableValidator.dx.test.ts @@ -67,7 +67,8 @@ describe("modules.ownableValidator.dx", async () => { transport: http(), bundlerTransport: http(bundlerUrl), validatorAddress: TEST_ADDRESS_K1_VALIDATOR_ADDRESS, - factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS + factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS, + useTestBundler: true }) // Fund the account and deploy the smart contract wallet diff --git a/src/sdk/modules/ownableValidator/toOwnableValidator.executor.test.ts b/src/sdk/modules/ownableValidator/toOwnableValidator.executor.test.ts index 160d37149..df87e7a8e 100644 --- a/src/sdk/modules/ownableValidator/toOwnableValidator.executor.test.ts +++ b/src/sdk/modules/ownableValidator/toOwnableValidator.executor.test.ts @@ -66,7 +66,8 @@ describe("modules.ownableExecutor", async () => { transport: http(), bundlerTransport: http(bundlerUrl), validatorAddress: TEST_ADDRESS_K1_VALIDATOR_ADDRESS, - factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS + factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS, + useTestBundler: true }) nexusAccountAddress = await nexusClient.account.getCounterFactualAddress() diff --git a/src/sdk/modules/ownableValidator/toOwnableValidator.test.ts b/src/sdk/modules/ownableValidator/toOwnableValidator.test.ts index a80854332..517d44913 100644 --- a/src/sdk/modules/ownableValidator/toOwnableValidator.test.ts +++ b/src/sdk/modules/ownableValidator/toOwnableValidator.test.ts @@ -70,7 +70,8 @@ describe("modules.ownables", async () => { transport: http(), bundlerTransport: http(bundlerUrl), validatorAddress: TEST_ADDRESS_K1_VALIDATOR_ADDRESS, - factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS + factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS, + useTestBundler: true }) await fundAndDeployClients(testClient, [nexusClient]) diff --git a/src/sdk/modules/smartSessionsValidator/decorators/smartSessions.decorators.test.ts b/src/sdk/modules/smartSessionsValidator/decorators/smartSessions.decorators.test.ts index 074f81561..e08391eec 100644 --- a/src/sdk/modules/smartSessionsValidator/decorators/smartSessions.decorators.test.ts +++ b/src/sdk/modules/smartSessionsValidator/decorators/smartSessions.decorators.test.ts @@ -58,7 +58,8 @@ describe("modules.smartSessions.decorators", async () => { transport: http(), bundlerTransport: http(bundlerUrl), validatorAddress: TEST_ADDRESS_K1_VALIDATOR_ADDRESS, - factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS + factoryAddress: TEST_ADDRESS_K1_VALIDATOR_FACTORY_ADDRESS, + useTestBundler: true }) sessionRequestedInfo = [ @@ -121,7 +122,8 @@ describe("modules.smartSessions.decorators", async () => { accountAddress: nexusClient.account.address, signer: sessionKeyAccount, transport: http(), - bundlerTransport: http(bundlerUrl) + bundlerTransport: http(bundlerUrl), + useTestBundler: true }) const nexusSessionClient = smartSessionNexusClient.extend( diff --git a/src/sdk/modules/smartSessionsValidator/toSmartSessionValidator.enable.mode.test.ts b/src/sdk/modules/smartSessionsValidator/toSmartSessionValidator.enable.mode.test.ts index a55e69b44..bf4be7ecd 100644 --- a/src/sdk/modules/smartSessionsValidator/toSmartSessionValidator.enable.mode.test.ts +++ b/src/sdk/modules/smartSessionsValidator/toSmartSessionValidator.enable.mode.test.ts @@ -99,7 +99,8 @@ describe.skip("modules.smartSessions.enable.mode.dx", async () => { index, signer: eoaAccount, chain, - transport: http() + transport: http(), + useTestBundler: true }) nexusAccountAddress = await nexusAccount.getCounterFactualAddress() @@ -110,7 +111,8 @@ describe.skip("modules.smartSessions.enable.mode.dx", async () => { signer: eoaAccount, chain, transport: http(), - bundlerTransport: http(bundlerUrl) + bundlerTransport: http(bundlerUrl), + useTestBundler: true }) await fundAndDeployClients(testClient, [nexusClient]) diff --git a/src/sdk/modules/smartSessionsValidator/toSmartSessionsValidator.advanced.test.ts b/src/sdk/modules/smartSessionsValidator/toSmartSessionsValidator.advanced.test.ts index 82024e817..948e41232 100644 --- a/src/sdk/modules/smartSessionsValidator/toSmartSessionsValidator.advanced.test.ts +++ b/src/sdk/modules/smartSessionsValidator/toSmartSessionsValidator.advanced.test.ts @@ -84,7 +84,8 @@ describe("modules.smartSessions.dx", async () => { signer: eoaAccount, chain, transport: http(), - bundlerTransport: http(bundlerUrl) + bundlerTransport: http(bundlerUrl), + useTestBundler: true }) // Fund the account and deploy the smart contract wallet @@ -174,7 +175,8 @@ describe("modules.smartSessions.dx", async () => { accountAddress: usersSessionData.granter, signer: sessionKeyAccount, transport: http(), - bundlerTransport: http(bundlerUrl) + bundlerTransport: http(bundlerUrl), + useTestBundler: true }) // Create a new smart sessions module with the session key diff --git a/src/sdk/modules/smartSessionsValidator/toSmartSessionsValidator.dx.test.ts b/src/sdk/modules/smartSessionsValidator/toSmartSessionsValidator.dx.test.ts index 12b9fef73..14acd0f18 100644 --- a/src/sdk/modules/smartSessionsValidator/toSmartSessionsValidator.dx.test.ts +++ b/src/sdk/modules/smartSessionsValidator/toSmartSessionsValidator.dx.test.ts @@ -84,7 +84,8 @@ describe("modules.smartSessions.dx", async () => { signer: eoaAccount, chain, transport: http(), - bundlerTransport: http(bundlerUrl) + bundlerTransport: http(bundlerUrl), + useTestBundler: true }) // Fund the account and deploy the smart contract wallet @@ -157,7 +158,8 @@ describe("modules.smartSessions.dx", async () => { accountAddress: usersSessionData.granter, signer: sessionKeyAccount, transport: http(), - bundlerTransport: http(bundlerUrl) + bundlerTransport: http(bundlerUrl), + useTestBundler: true }) // Create a new smart sessions module with the session key diff --git a/src/sdk/modules/smartSessionsValidator/toSmartSessionsValidator.policies.test.ts b/src/sdk/modules/smartSessionsValidator/toSmartSessionsValidator.policies.test.ts index 031ad57d8..c3de634cc 100644 --- a/src/sdk/modules/smartSessionsValidator/toSmartSessionsValidator.policies.test.ts +++ b/src/sdk/modules/smartSessionsValidator/toSmartSessionsValidator.policies.test.ts @@ -54,7 +54,8 @@ describe("modules.smartSessions.policies", async () => { signer: eoaAccount, chain, transport: http(), - bundlerTransport: http(bundlerUrl) + bundlerTransport: http(bundlerUrl), + useTestBundler: true }) nexusAccountAddress = await nexusClient.account.getCounterFactualAddress() @@ -97,7 +98,8 @@ describe("modules.smartSessions.policies", async () => { signer: eoaAccount, chain, transport: http(), - bundlerTransport: http(bundlerUrl) + bundlerTransport: http(bundlerUrl), + useTestBundler: true }) // Create a smart sessions module for the user's account diff --git a/src/sdk/modules/smartSessionsValidator/toSmartSessionsValidator.sudo.policy.test.ts b/src/sdk/modules/smartSessionsValidator/toSmartSessionsValidator.sudo.policy.test.ts index c8521ebec..3a72eb099 100644 --- a/src/sdk/modules/smartSessionsValidator/toSmartSessionsValidator.sudo.policy.test.ts +++ b/src/sdk/modules/smartSessionsValidator/toSmartSessionsValidator.sudo.policy.test.ts @@ -62,7 +62,8 @@ describe("modules.smartSessions.sudo.policy", async () => { signer: eoaAccount, chain, transport: http(), - bundlerTransport: http(bundlerUrl) + bundlerTransport: http(bundlerUrl), + useTestBundler: true }) nexusAccountAddress = await nexusClient.account.getCounterFactualAddress() @@ -156,7 +157,8 @@ describe("modules.smartSessions.sudo.policy", async () => { accountAddress: usersSessionData.granter, signer: sessionKeyAccount, transport: http(), - bundlerTransport: http(bundlerUrl) + bundlerTransport: http(bundlerUrl), + useTestBundler: true }) // Create a new smart sessions module with the session key diff --git a/src/sdk/modules/smartSessionsValidator/toSmartSessionsValidator.test.ts b/src/sdk/modules/smartSessionsValidator/toSmartSessionsValidator.test.ts index 302d122cf..dd78f5b71 100644 --- a/src/sdk/modules/smartSessionsValidator/toSmartSessionsValidator.test.ts +++ b/src/sdk/modules/smartSessionsValidator/toSmartSessionsValidator.test.ts @@ -62,7 +62,8 @@ describe("modules.smartSessions", async () => { signer: eoaAccount, chain, transport: http(), - bundlerTransport: http(bundlerUrl) + bundlerTransport: http(bundlerUrl), + useTestBundler: true }) sessionsModule = toSmartSessionsValidator({ @@ -284,7 +285,8 @@ describe("modules.smartSessions", async () => { accountAddress: nexusClient.account.address, signer: sessionKeyAccount, transport: http(), - bundlerTransport: http(bundlerUrl) + bundlerTransport: http(bundlerUrl), + useTestBundler: true }) const usePermissionsModule = toSmartSessionsValidator({ diff --git a/src/sdk/modules/smartSessionsValidator/toSmartSessionsValidator.uni.policy.test.ts b/src/sdk/modules/smartSessionsValidator/toSmartSessionsValidator.uni.policy.test.ts index 6ee0f827f..6e777118d 100644 --- a/src/sdk/modules/smartSessionsValidator/toSmartSessionsValidator.uni.policy.test.ts +++ b/src/sdk/modules/smartSessionsValidator/toSmartSessionsValidator.uni.policy.test.ts @@ -68,7 +68,8 @@ describe("modules.smartSessions.uni.policy", async () => { signer: eoaAccount, chain, transport: http(), - bundlerTransport: http(bundlerUrl) + bundlerTransport: http(bundlerUrl), + useTestBundler: true }) nexusAccountAddress = await nexusClient.account.getCounterFactualAddress() @@ -292,7 +293,8 @@ describe("modules.smartSessions.uni.policy", async () => { accountAddress: nexusClient.account.address, signer: sessionKeyAccount, transport: http(), - bundlerTransport: http(bundlerUrl) + bundlerTransport: http(bundlerUrl), + useTestBundler: true }) const usePermissionsModule = toSmartSessionsValidator({