Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: docs #38

Merged
merged 3 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
}
Loading