diff --git a/README.md b/README.md index 6e5a82f9f..3c87efb37 100644 --- a/README.md +++ b/README.md @@ -39,19 +39,18 @@ bun i ```typescript import { createNexusClient } from "@biconomy/sdk"; +import { http } from "viem"; -const smartAccount = await createNexusClient({ - signer: viemWalletOrEthersSigner, - bundlerUrl: "", // From dashboard.biconomy.io - paymasterUrl: "", // From dashboard.biconomy.io +const nexusClient = await createNexusClient({ + holder: account, + chain, + transport: http(), + bundlerTransport: http(bundlerUrl), }); -const { wait } = await smartAccount.sendTransaction({ to: "0x...", value: 1 }); +const hash = await nexusClient.sendTransaction({ calls: [to: "0x...", value: 1] }); +const { status, transactionHash } = await nexusClient.account.client.waitForTransactionReceipt({ hash }); -const { - receipt: { transactionHash }, - success, -} = await wait(); ``` ## Documentation and Resources diff --git a/src/sdk/account/toNexusAccount.ts b/src/sdk/account/toNexusAccount.ts index fab2f3f7b..b8b389019 100644 --- a/src/sdk/account/toNexusAccount.ts +++ b/src/sdk/account/toNexusAccount.ts @@ -65,23 +65,23 @@ import { type UnknownHolder, toHolder } from "./utils/toHolder" /** * Parameters for creating a Nexus Smart Account */ -export type ToNexusSmartAccountParameters = { - /** The blockchain network */ - chain: Chain - /** The transport configuration */ - transport: ClientConfig["transport"] - /** The holder account or address */ - holder: UnknownHolder - /** Optional index for the account */ - index?: bigint | undefined - /** Optional active validation module */ - activeModule?: BaseValidationModule - /** Optional factory address */ - factoryAddress?: Address - /** Optional K1 validator address */ - k1ValidatorAddress?: Address -} & Prettify< - Pick< +export type ToNexusSmartAccountParameters = Prettify< + { + /** The blockchain network */ + chain: Chain + /** The transport configuration */ + transport: ClientConfig["transport"] + /** The holder account or address */ + holder: UnknownHolder + /** Optional index for the account */ + index?: bigint | undefined + /** Optional active validation module */ + activeModule?: BaseValidationModule + /** Optional factory address */ + factoryAddress?: Address + /** Optional K1 validator address */ + k1ValidatorAddress?: Address + } & Pick< ClientConfig, | "account" | "cacheTime" @@ -215,7 +215,6 @@ export const toNexusAccount = async ( _accountAddress = e?.cause.data.args[0] as Address return _accountAddress } - console.log("Im in here", e) } throw new Error("Failed to get counterfactual account address") } diff --git a/src/sdk/clients/createBicoBundlerClient.ts b/src/sdk/clients/createBicoBundlerClient.ts index 9a5d38846..e1c7fd09b 100644 --- a/src/sdk/clients/createBicoBundlerClient.ts +++ b/src/sdk/clients/createBicoBundlerClient.ts @@ -8,7 +8,7 @@ import { type BicoBundlerClientConfig = Omit & OneOf< | { - transport?: Transport + transport: Transport } | { bundlerUrl: string diff --git a/typedoc.json b/typedoc.json index 1b6162e2c..1b8defe3a 100644 --- a/typedoc.json +++ b/typedoc.json @@ -1,13 +1,13 @@ { "$schema": "https://typedoc.org/schema.json", - "entryPoints": ["src/index.ts"], + "entryPoints": ["src/sdk/index.ts"], "exclude": [ "src/sdk/account/utils/**/*.ts", "src/sdk/__contracts/**/*.ts", "src/test/**/*.ts" ], - "basePath": "src", - "includes": "src", + "basePath": "src/sdk", + "includes": "src/sdk", "out": "docs", "gitRevision": "main" }