Skip to content

Commit

Permalink
chore: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
joepegler committed Apr 12, 2024
1 parent c87d477 commit cb0619e
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 79 deletions.
67 changes: 19 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,32 @@

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/bcnmy/biconomy-client-sdk)

This repository serves as a comprehensive foundation for typescript account abstraction projects, streamlining the development process with a focus on best practices, security, and efficiency.
The Biconomy SDK is your all-in-one toolkit for building decentralized applications (dApps) with **ERC4337 Account Abstraction** and **Smart Accounts**. It is designed for seamless user experiences and offers non-custodial solutions for user onboarding, sending transactions (userOps), gas sponsorship and much more.

## 📚 Table of Contents

- [SDK 🚀](#sdk-)
- [📚 Table of Contents](#-table-of-contents)
- [Getting Started](#getting-started)
- [🛠️ Quickstart](#-quickstart)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [🛠️ Essential Scripts](#️-essential-scripts)
- [🧪 Run Tests](#-run-tests)
- [📊 Coverage Report](#-coverage-report)
- [🎨 Lint Code](#-lint-code)
- [🖌️ Auto-fix Linting Issues](#️-auto-fix-linting-issues)
- [🖌️ Format Issues](#️-auto-fix-linting-issues)
- [📄 Documentation and Resources](#-documentation-and-resources)
- [License](#license)
- [Connect with Biconomy 🍊](#connect-with-biconomy-🍊)

## Getting Started

To kickstart, follow these steps:

### Prerequisites

- Node.js (v18.x or later)
- Bun (or npm)
## 🛠️ Quickstart

### Installation

1. **Clone the repository:**
1. **Add the package and install dependencies:**

```bash
git clone https://github.com/bcnmy/biconomy-client-sdk.git
cd sdk
bun add @biconomy/account viem
```

2. **Install dependencies:**
Expand All @@ -46,51 +38,30 @@ cd sdk
bun i
```

3. **Setup environment variables:**
```typescript
import { createSmartAccountClient } from "@biconomy/account";

Copy `.env.example` to `.env` and fill in your details.
const smartAccount = await createSmartAccountClient({
signer: viemWalletOrEthersSigner,
bundlerUrl: "", // From dashboard.biconomy.io
paymasterUrl: "", // From dashboard.biconomy.io
});

## 🛠️ Essential Scripts
const { wait } = await smartAccount.sendTransaction({ to: "0x...", value: 1 });

### 🧪 Run Tests

```bash
bun run test --watch
const {
receipt: { transactionHash },
success,
} = await wait();
```

Carries out tests.

### 📊 Coverage Report

```bash
bun run test --coverage
```

Creates detailed reports for test coverage.

### 🎨 Lint Code

```bash
bun run lint:fix
```

Checks code for style and potential errors.

### 🖌️ Auto-fix Linting Issues

```bash
bun run lint:fix
```

Automatically fixes linting problems found.

## Documentation and Resources

For a comprehensive understanding of our project and to contribute effectively, please refer to the following resources:

- [**Biconomy Documentation**](https://docs.biconomy.io)
- [**Biconomy Dashboard**](https://dashboard.biconomy.io)
- [**TSDoc**](https://bcnmy.github.io/biconomy-client-sdk)
- [**API Documentation**](https://bcnmy.github.io/biconomy-client-sdk)
- [**Contributing Guidelines**](./CONTRIBUTING.md): Learn how to contribute to our project, from code contributions to documentation improvements.
- [**Code of Conduct**](./CODE_OF_CONDUCT.md): Our commitment to fostering an open and welcoming environment.
- [**Security Policy**](./SECURITY.md): Guidelines for reporting security vulnerabilities.
Expand Down
14 changes: 0 additions & 14 deletions config.json

This file was deleted.

1 change: 0 additions & 1 deletion src/modules/BatchedSessionRouterModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { type SmartAccountSigner, convertSigner } from "../account"
import { BaseValidationModule } from "./BaseValidationModule.js"
import { SessionKeyManagerModule } from "./SessionKeyManagerModule.js"
import type {
SessionLeafNode,
SessionSearchParam,
SessionStatus
} from "./interfaces/ISessionStorage.js"
Expand Down
4 changes: 2 additions & 2 deletions tests/account/read.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ import {
type BiconomySmartAccountV2Config,
DEFAULT_ENTRYPOINT_ADDRESS,
ERROR_MESSAGES,
NATIVE_TOKEN_ALIAS,
compareChainIds,
createSmartAccountClient,
NATIVE_TOKEN_ALIAS
createSmartAccountClient
} from "../../src/account"
import { type UserOperationStruct, getChain } from "../../src/account"
import { BiconomyAccountAbi } from "../../src/account/abi/SmartAccount"
Expand Down
4 changes: 2 additions & 2 deletions tests/account/write.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import { generatePrivateKey, privateKeyToAccount } from "viem/accounts"
import { beforeAll, describe, expect, test } from "vitest"
import {
type BiconomySmartAccountV2,
createSmartAccountClient,
NATIVE_TOKEN_ALIAS
NATIVE_TOKEN_ALIAS,
createSmartAccountClient
} from "../../src/account"
import { PaymasterMode } from "../../src/paymaster"
import { testOnlyOnOptimism } from "../setupFiles"
Expand Down
2 changes: 1 addition & 1 deletion tests/modules/read.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { defaultAbiCoder } from "@ethersproject/abi"
import { JsonRpcProvider } from "@ethersproject/providers"
import { Wallet } from "@ethersproject/wallet"
import {
Expand All @@ -17,7 +18,6 @@ import {
createMultiChainValidationModule
} from "../../src/modules"
import { getConfig } from "../utils"
import { defaultAbiCoder } from "@ethersproject/abi"

describe("Modules: Read", () => {
const {
Expand Down
10 changes: 5 additions & 5 deletions tests/modules/write.test.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import {
http,
type Hex,
createPublicClient,
createWalletClient,
encodeAbiParameters,
encodeFunctionData,
parseAbi,
encodeAbiParameters,
parseUnits,
createPublicClient
parseUnits
} from "viem"
import { privateKeyToAccount } from "viem/accounts"
import { beforeAll, describe, expect, test } from "vitest"
import {
type BiconomySmartAccountV2,
createSmartAccountClient,
type WalletClientSigner
type WalletClientSigner,
createSmartAccountClient
} from "../../src/account"
import { Logger, getChain } from "../../src/account"
import {
Expand Down
12 changes: 6 additions & 6 deletions tests/utils.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import fs from "node:fs"
import {
http,
type Chain,
type Hex,
type PublicClient,
parseAbi,
createWalletClient,
http
parseAbi
} from "viem"
import { generatePrivateKey, privateKeyToAccount } from "viem/accounts"
import { polygonMumbai } from "viem/chains"
import {
Logger,
type SmartAccountSigner,
Expand All @@ -16,16 +19,13 @@ import {
extractChainIdFromBundlerUrl,
extractChainIdFromPaymasterUrl
} from "../src/bundler"
import type { SignerData } from "../src/modules"
import type {
ISessionStorage,
SessionLeafNode,
SessionSearchParam,
SessionStatus
} from "../src/modules/interfaces/ISessionStorage"
import fs from "node:fs"
import type { SignerData } from "../src/modules"
import { generatePrivateKey, privateKeyToAccount } from "viem/accounts"
import { polygonMumbai } from "viem/chains"

export const getEnvVars = () => {
const fields = [
Expand Down

0 comments on commit cb0619e

Please sign in to comment.