Skip to content

Commit

Permalink
chore: fix readme & docs
Browse files Browse the repository at this point in the history
  • Loading branch information
joepegler committed Sep 20, 2024
2 parents 4d7b6d0 + 2eab2a8 commit 37c1eb6
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 31 deletions.
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
35 changes: 17 additions & 18 deletions src/sdk/account/toNexusAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Transport, Chain, Account, RpcSchema>,
| "account"
| "cacheTime"
Expand Down Expand Up @@ -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")
}
Expand Down
2 changes: 1 addition & 1 deletion src/sdk/clients/createBicoBundlerClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
type BicoBundlerClientConfig = Omit<BundlerClientConfig, "transport"> &
OneOf<
| {
transport?: Transport
transport: Transport
}
| {
bundlerUrl: string
Expand Down
6 changes: 3 additions & 3 deletions typedoc.json
Original file line number Diff line number Diff line change
@@ -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"
}

0 comments on commit 37c1eb6

Please sign in to comment.