Skip to content
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
38 changes: 38 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
# Checkout the repository
- name: Checkout code
uses: actions/checkout@v2

# Set up Node.js and install dependencies
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'npm'

- name: Install dependencies
run: npm install

# Compile TypeScript files
- name: Compile TypeScript
run: npm run tsc

# Separate Test Step
- name: Run tests
run: npm test
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SDK to create and send UserOperation
# SDK to create and send UserOperation

This package provides 2 APIs for using UserOperations:

Expand All @@ -19,7 +19,7 @@ An implementation of the BaseWalletAPI, for the SimpleWallet sample of account-a
```typescript
owner = provider.getSigner()
const walletAPI = new SimpleAccountAPI({
provider,
provider,
entryPointAddress,
owner,
factoryAddress
Expand All @@ -32,7 +32,7 @@ const op = await walletAPI.createSignedUserOp({

## High-Level Provider API

A simplified mode that doesn't require a different wallet extension.
A simplified mode that doesn't require a different wallet extension.
Instead, the current provider's account is used as wallet owner by calling its "Sign Message" operation.

This can only work for wallets that use an EIP-191 ("Ethereum Signed Message") signature (like our sample SimpleWallet)
Expand All @@ -46,8 +46,10 @@ const aaSigner = provider.getSigner()
const config = {
chainId: await provider.getNetwork().then(net => net.chainId),
entryPointAddress,
bundlerUrl: 'http://localhost:3000/rpc'
}
bundlerUrl: 'http://localhost:3000/rpc',
factoryAddress, // You need to provide either factoryAddress or factoryManagerAddress
factoryManagerAddress // Optional, but needed if factoryAddress is not provided
}
const aaProvider = await wrapProvider(provider, config, aaSigner)
const walletAddress = await aaProvider.getSigner().getAddress()

Expand All @@ -59,3 +61,6 @@ const myContract = new Contract(abi, aaProvider)
await myContract.someMethod()
```

### Configuration Note:
- When using the **high-level provider API**, you **must** provide either the `factoryAddress` (pre-deployed factory contract) or the `factoryManagerAddress` (to fetch the `factoryAddress` dynamically).
- If both are missing, an error will be thrown during initialization.
Loading