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

feat: merge in all of the staged changes to the aa-sdk #120

Merged
merged 192 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
192 commits
Select commit Hold shift + click to select a range
22118fa
docs: add a vitepress site skeleton (#1)
moldy530 Sep 19, 2023
4b7ba5f
docs: add github action to deploy to pages (#2)
moldy530 Sep 19, 2023
46e57b5
docs: add sidebar skeleton for docs (#3)
moldy530 Sep 19, 2023
4c70cb1
docs: add overview doc for the various packages exported by Account K…
moldy530 Sep 21, 2023
15b7f57
feat: make account class generic on providers
avasisht23 Sep 20, 2023
e2ecf9d
fix: make account optional except for certain methods
avasisht23 Sep 21, 2023
4209f80
fix: moldy's comments
avasisht23 Sep 21, 2023
e76f20a
fix: use interface for defining unconnected providers
avasisht23 Sep 22, 2023
22ecc67
fix: use interface account for alchemy gasmanager methods
avasisht23 Sep 22, 2023
f4603d4
fix: use interface account for alchemy gasmanager methods
avasisht23 Sep 22, 2023
d87e078
fix: use interface account for ethers provider-adapter
avasisht23 Sep 22, 2023
306aa93
fix: remove account generic for unconnected providers
avasisht23 Sep 22, 2023
3e404a6
docs: add docs for ownership transfer (#8)
moldy530 Sep 22, 2023
8ccdd15
docs: add docs for batching transactions (#9)
moldy530 Sep 22, 2023
90d27e5
docs: add using your own account docs (#10)
moldy530 Sep 22, 2023
2caa3a2
refactor: remove ConnectedSmartContractAccountProvider
avasisht23 Sep 22, 2023
161c317
fix: moldy's comments
avasisht23 Sep 22, 2023
afd1f2b
feat: add light account support
avasisht23 Sep 20, 2023
8ca6b0e
feat: add unit and e2e tests
avasisht23 Sep 20, 2023
ed3e0da
feat: add unit and e2e tests
avasisht23 Sep 20, 2023
e494434
feat: add transferownership e2e test
avasisht23 Sep 20, 2023
d4e21a4
fix: update on pr yml to run e2e tests just to show
avasisht23 Sep 20, 2023
8f4567c
fix: remove skips
avasisht23 Sep 20, 2023
2180689
fix: remove skips
avasisht23 Sep 20, 2023
8f35c4c
fix: update on pr yml to remove e2e tests since they passed
avasisht23 Sep 20, 2023
ed550c4
fix: update on pr yml to remove e2e tests since they passed
avasisht23 Sep 20, 2023
43a0e81
fix: address moldy's comments
avasisht23 Sep 21, 2023
f16c7c4
fix: make on-chain getOwner call
avasisht23 Sep 22, 2023
ddfd293
fix: remove account generic for unconnected providers
avasisht23 Sep 22, 2023
7c6f5c2
refactor: remove ConnectedSmartContractAccountProvider
avasisht23 Sep 22, 2023
9fad15f
feat: add light account to index file to export
avasisht23 Sep 22, 2023
945d178
feat: add light account to index file to export
avasisht23 Sep 22, 2023
0310d74
feat: add light account abis
avasisht23 Sep 20, 2023
77c16f3
test: refactor e2e test file
avasisht23 Sep 22, 2023
4e72967
chore: add undeploed owner to pr action
avasisht23 Sep 22, 2023
9fa7bd8
docs: add magic link signer docs (#12)
moldy530 Sep 25, 2023
b7d4c42
docs: add sendUserOperation docs as example of how to build package d…
moldy530 Sep 25, 2023
972b897
fix: create new signer with util for each e2e test
avasisht23 Sep 25, 2023
c873c5c
feat: replace simpleAccount with lightAccount in example dapp
avasisht23 Sep 22, 2023
b9ca650
refactor: make account class generic on providers (#4)
avasisht23 Sep 25, 2023
f0fb23f
feat: add light account abis (#6)
avasisht23 Sep 25, 2023
5434f22
feat: add light account support (#5)
avasisht23 Sep 25, 2023
4c381bd
feat: replace simpleAccount with lightAccount in example dapp (#11)
avasisht23 Sep 25, 2023
e82304d
docs: add bring your own signer docs (#18)
moldy530 Sep 25, 2023
ec4e887
docs: add dev docs for aa-accounts/light-account
avasisht23 Sep 26, 2023
4d56d52
docs: add dev docs for aa-accounts/light-account
avasisht23 Sep 26, 2023
dfa7cff
docs: add dev docs for aa-accounts/light-account
avasisht23 Sep 26, 2023
387822e
docs: add dev docs for aa-accounts/light-account
avasisht23 Sep 26, 2023
0f6a27d
docs: add dev docs for aa-accounts/light-account
avasisht23 Sep 26, 2023
8af1566
docs: add dev docs for aa-accounts/light-account
avasisht23 Sep 26, 2023
886a8ef
docs: add dev docs for aa-accounts/light-account
avasisht23 Sep 26, 2023
239b653
Merge pull request #19 from OMGWINNING/09-26-docs_add_dev_docs_for_aa…
avasisht23 Sep 26, 2023
a9f016e
docs: add getting started page (#14)
SahilAujla Sep 26, 2023
09e8460
docs: using smart accounts overview (#15)
SahilAujla Sep 26, 2023
bf293b6
refactor: rename middleware util methods for alchemy gas manager endp…
avasisht23 Sep 26, 2023
d9a2ad8
refactor: rename middleware util methods for alchemy gas manager endp…
avasisht23 Sep 26, 2023
7e7b578
refactor: rename middleware util methods for alchemy gas manager endp…
avasisht23 Sep 26, 2023
95e31d2
refactor: rename middleware util methods for alchemy gas manager endp…
avasisht23 Sep 26, 2023
9b17d25
feat: change param to estimateGas
avasisht23 Sep 27, 2023
903ca03
feat: change param to estimateGas
avasisht23 Sep 27, 2023
b387ab4
fix: remove timestamp site
avasisht23 Sep 27, 2023
12f060d
fix: remove deprecated signers
avasisht23 Sep 27, 2023
ed6164f
Merge pull request #23 from OMGWINNING/09-27-fix_remove_deprecated_si…
avasisht23 Sep 27, 2023
ef2215b
starting new page waitForUserOperationTransaction. Adding method deta…
avarobinson Sep 27, 2023
25ffd3e
Merge pull request #20 from OMGWINNING/09-26-docs_add_aa-core/accounts
avasisht23 Sep 27, 2023
8ee73cc
fix: make base provider constructor an object
avasisht23 Sep 27, 2023
f509e48
feat: update alchemy provider with new types
avasisht23 Sep 27, 2023
1c816b8
Update site/packages/aa-core/provider/waitForUserOperationTransaction.md
avarobinson Sep 27, 2023
6901533
Update site/packages/aa-core/provider/waitForUserOperationTransaction.md
avarobinson Sep 27, 2023
417fdbe
Merge pull request #30 from OMGWINNING/09-27-fix_make_base_provider_c…
avasisht23 Sep 27, 2023
106706b
fix: fixing nits
avarobinson Sep 27, 2023
098e28c
fix: running prettier
avarobinson Sep 27, 2023
1fd264b
Merge pull request #29 from OMGWINNING/ava/waitForUserOperationTransa…
avarobinson Sep 27, 2023
a0d803f
fix: don't require provider input for alchemy provider
avasisht23 Sep 28, 2023
0f78051
test: refactor tests in aa-ethers
avasisht23 Sep 27, 2023
3f15ea5
test: refactor tests in aa-accounts
avasisht23 Sep 27, 2023
5db9be6
test: refactor tests in aa-core
avasisht23 Sep 27, 2023
0d04c74
test: refactor tests in aa-alchemy
avasisht23 Sep 27, 2023
908cadb
fix: move back package.json
avasisht23 Sep 27, 2023
1855a8c
fix: remove package.jsonc hange
avasisht23 Sep 27, 2023
05a6a40
test: refactor tests in aa-core
avasisht23 Sep 27, 2023
b763634
Merge pull request #33 from OMGWINNING/09-28-fix_don_t_require_provid…
avasisht23 Sep 28, 2023
d24a908
docs: add web3auth docs (#28)
moldy530 Sep 28, 2023
9efbd57
docs: add some more helpful links to contributing (#22)
moldy530 Sep 28, 2023
f3a1c1e
docs: add benchmarks for light account (#32)
moldy530 Sep 28, 2023
06ccc50
docs: add docs for EOA signers (#34)
moldy530 Sep 28, 2023
479b446
Merge pull request #24 from OMGWINNING/09-27-test_refactor_tests
avasisht23 Sep 29, 2023
0710742
Merge pull request #25 from OMGWINNING/09-27-test_refactor_tests_in_a…
avasisht23 Sep 29, 2023
8f0cbb3
Merge pull request #26 from OMGWINNING/09-27-test_refactor_tests_in_a…
avasisht23 Sep 29, 2023
7989e95
Merge pull request #27 from OMGWINNING/09-27-ftest_refactor_tests_in_…
avasisht23 Sep 29, 2023
9b27e22
feat: add support for LocalAcount to the LocalAccountSigner (#36)
moldy530 Sep 29, 2023
744664a
docs: add code docs for aa-core/getUserOperationByHash (#31)
avarobinson Sep 29, 2023
26b98f3
fix: nit typo fix in code from 337 to 4337
denniswon Sep 29, 2023
2ae29e1
docs: add aa-core signer docs
moldy530 Sep 29, 2023
edd3b8e
docs: adds Turnkey to the list of signing providers (#35)
MaxBlaushild Sep 29, 2023
1f6de30
docs: start adding utils docs
moldy530 Sep 29, 2023
a2ede85
fix: fix a lint issue I missed
moldy530 Sep 29, 2023
8b93826
docs: add more utils docs for aa-core
moldy530 Sep 29, 2023
6d72a19
Merge pull request #37 from OMGWINNING/denniswon/typo-fix
denniswon Sep 29, 2023
8d2027b
Merge pull request #40 from OMGWINNING/moldy/utils-docs-2
denniswon Sep 29, 2023
16f9c8d
Merge pull request #38 from OMGWINNING/moldy/signer-docs
denniswon Sep 29, 2023
35e835b
Merge pull request #39 from OMGWINNING/moldy/utils-docs-1
denniswon Sep 29, 2023
b72823b
chore: add denniswon to OWNERS
Sep 29, 2023
e3788f4
Merge pull request #42 from OMGWINNING/denniswon/nit-add-denniswon-to…
denniswon Sep 29, 2023
95d0792
feat: document and update the client types in core (#43)
moldy530 Sep 29, 2023
f766cc2
fix: site deploy was using node 18.18 not 18.10
moldy530 Sep 29, 2023
69782a4
docs: update the docs on byosca to use LightAccount
moldy530 Sep 29, 2023
cf55911
fix: actually use node 18.10 in the workflow
moldy530 Sep 29, 2023
ec4a4a1
Merge pull request #45 from OMGWINNING/moldy/update-byosca
denniswon Sep 29, 2023
d7cab2c
docs: add docs for erc4337ClientActions
moldy530 Sep 29, 2023
66dfe09
docs: add aa-alchemy docs
avasisht23 Sep 26, 2023
f5fbe1a
docs: more updates, still wip
avasisht23 Sep 27, 2023
26900f9
docs: docs for aa-alchemy
avasisht23 Sep 29, 2023
191f2b3
docs: docs for aa-alchemy
avasisht23 Sep 29, 2023
18f9dc8
docs: docs for aa-alchemy
avasisht23 Sep 29, 2023
25be668
docs: docs for aa-alchemy
avasisht23 Sep 29, 2023
16efa11
docs: docs for aa-alchemy
avasisht23 Sep 29, 2023
2b18c6b
docs: docs for aa-alchemy
avasisht23 Sep 29, 2023
85fc75f
docs: docs for aa-alchemy
avasisht23 Sep 29, 2023
3f85068
docs: docs for aa-alchemy
avasisht23 Sep 29, 2023
ba55ef9
docs: docs for aa-alchemy
avasisht23 Sep 29, 2023
3e72a1c
docs: docs for aa-alchemy
avasisht23 Sep 29, 2023
5479c31
Merge pull request #21 from OMGWINNING/09-26-docs_add_aa-alchemy_docs
avasisht23 Sep 29, 2023
826d882
Merge pull request #46 from OMGWINNING/moldy/erc4337actions-docs
denniswon Oct 1, 2023
9fec303
docs: docs for aa-ethers (wip)
avasisht23 Sep 30, 2023
dfcb091
docs: docs for aa-ethers (wip)
avasisht23 Sep 30, 2023
911d294
docs: docs for aa-ethers (wip)
avasisht23 Sep 30, 2023
50d984f
docs: docs for aa-ethers (wip)
avasisht23 Oct 2, 2023
a720399
docs: docs for aa-ethers (wip)
avasisht23 Oct 2, 2023
a739b5f
docs: docs for aa-ethers (wip)
avasisht23 Oct 2, 2023
6ff5d2e
docs: docs for aa-ethers (wip)
avasisht23 Oct 2, 2023
84764be
docs: docs for aa-ethers
avasisht23 Oct 2, 2023
9e3f14b
docs: docs for aa-ethers
avasisht23 Oct 2, 2023
861957b
docs: docs for aa-ethers
avasisht23 Oct 2, 2023
20505a8
docs: docs for aa-ethers
avasisht23 Oct 2, 2023
0708972
docs: docs for aa-ethers
avasisht23 Oct 2, 2023
8caa655
docs: docs for aa-ethers
avasisht23 Oct 2, 2023
ba16089
docs: docs for aa-ethers
avasisht23 Oct 2, 2023
0897c53
docs: add docs for using Light Account (#16)
SahilAujla Oct 2, 2023
9e475fc
docs: add doc for sponsoring gas (#17)
SahilAujla Oct 2, 2023
8d4e100
docs: docs for aa-ethers
avasisht23 Oct 2, 2023
ce97d9e
Merge pull request #47 from OMGWINNING/09-29-docs_add_docs_for_aa-ethers
avasisht23 Oct 2, 2023
3c71d59
docs: update a few docs to match styles of other docs (#52)
moldy530 Oct 2, 2023
9baef13
docs: finish adding aa-core utils docs (#53)
moldy530 Oct 2, 2023
487e96c
docs: fix a typo in a code example
moldy530 Oct 2, 2023
e09d1d6
docs: fix comment in code snippet
moldy530 Oct 2, 2023
5cc11c3
docs: add Capsule to the list of signers (#57)
nityas Oct 2, 2023
7d918d8
docs: provider/getUserOperationReceipt (#48)
denniswon Oct 2, 2023
40e89d6
docs: aa-core sendTransaction and sendTransactions (#49)
denniswon Oct 2, 2023
6a6c9e4
docs: aa-core providers request method (#50)
denniswon Oct 2, 2023
3a088e7
docs: aa-core providers connection methods (#51)
denniswon Oct 2, 2023
08f30e4
docs: add web3auth direct link
moldy530 Oct 3, 2023
c763120
docs: updates to transferring-ownership (#54)
avasisht23 Oct 3, 2023
8d3d1ca
docs: updates to batching-transactions (#55)
avasisht23 Oct 3, 2023
33f0f34
chore: attempt to disable setting basepath for github pages (#59)
moldy530 Oct 3, 2023
1e7be78
moldy/pages base path (#60)
moldy530 Oct 3, 2023
e068ffe
refactor: remove getFeeData and use viem method (#58)
moldy530 Oct 3, 2023
ee9e299
fix: override getAccountInitCode in LightAccount (#61)
avasisht23 Oct 3, 2023
53aa7f5
docs: aa-core providers sign methods (#62)
denniswon Oct 3, 2023
3e3e923
docs: aa-core providers build user op methods (#64)
denniswon Oct 4, 2023
9c87aec
docs: add erc-6900 page (#69)
SahilAujla Oct 4, 2023
cba5cc4
chore: update (#66)
howydev Oct 4, 2023
ad22c6f
docs: format capsule doc (#71)
SahilAujla Oct 4, 2023
fbb7352
chore: add links to git repo, audit report (#72)
howydev Oct 5, 2023
8ec2271
feat: create6492Signature at BaseSCA level using account init code pa…
denniswon Oct 6, 2023
c856e3e
feat: la factory util + docs + example (#82)
rthomare Oct 6, 2023
767e1c0
chore: fix up viem versioning and light account integration into daap…
rthomare Oct 7, 2023
2c381f8
docs: add search (#87)
avasisht23 Oct 9, 2023
012cece
feat: add drop and replace to the uo logic (#85)
moldy530 Oct 9, 2023
6f73c52
feat: add lit signer docs (#70)
Oct 9, 2023
cdb28d8
docs: adding portal (#65)
parsaattari Oct 9, 2023
3ee758c
docs: add privy guide (#63)
ankushswar1 Oct 9, 2023
80cafdb
docs: fix some lint errors (#90)
moldy530 Oct 9, 2023
c511284
docs: update sponsoring-gas.md (#83)
willhennessy Oct 9, 2023
00d54b6
docs: add withCustomMiddleware (#81)
SahilAujla Oct 9, 2023
112009c
docs: add withFeeDataGetter (#80)
SahilAujla Oct 9, 2023
5ea2cc9
docs: add why account kit doc (#74)
SahilAujla Oct 9, 2023
7996be6
docs: updates to choosing smart account (#56)
avasisht23 Oct 9, 2023
08c78c2
docs: fix lint formatting
moldy530 Oct 9, 2023
c785fd2
feat: landing page (#67)
avasisht23 Oct 9, 2023
72293f5
chore: update the publish package job to include deploying the site (…
moldy530 Oct 9, 2023
0820c91
docs: update lit snippet (#92)
moldy530 Oct 10, 2023
f556bb8
refactor: remove unnecessary extra client on alchemy provider (#93)
moldy530 Oct 10, 2023
1d7e0fb
docs: aa-core accounts (#68)
denniswon Oct 10, 2023
70d1733
feat: add account and signer type log into the headers of public clie…
denniswon Oct 10, 2023
7bd35f4
docs: update choosing a signer docs (#89)
moldy530 Oct 10, 2023
313c96a
add heap analytics (#94)
SahilAujla Oct 10, 2023
f1fb937
docs: add intro doc (#75)
SahilAujla Oct 10, 2023
0bb5ce0
docs: add fireblocks signer (#88)
moldy530 Oct 10, 2023
f61428a
Merge branch 'alchemyplatform:main' into main
moldy530 Oct 10, 2023
b7d5521
chore: fix the setup node version in github actions
moldy530 Oct 10, 2023
d54718d
docs: add favicon (#96)
avasisht23 Oct 10, 2023
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
71 changes: 71 additions & 0 deletions .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Deploy VitePress site to Pages
on:
workflow_dispatch:
inputs:
no_base_path:
required: false
default: false
type: boolean

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false

jobs:
# Build job
build:
runs-on: ubuntu-latest
name: Build
env:
NO_BASE_PATH: ${{ inputs.no_base_path }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18.10"
cache: yarn

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Install dependencies
run: yarn

- name: Build with VitePress
working-directory: site
run: |
yarn build
touch .vitepress/dist/.nojekyll

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: site/.vitepress/dist

# Deployment job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: build
runs-on: ubuntu-latest
name: Deploy
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
env:
NO_BASE_PATH: ${{ inputs.no_base_path }}
8 changes: 4 additions & 4 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
- uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: "16.20"
node-version: "18.10"
cache: "yarn"

- name: Install dependencies
Expand All @@ -28,9 +28,9 @@ jobs:
- uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: "16.20"
node-version: "18.10"
cache: "yarn"

- name: Install dependencies
Expand Down
63 changes: 49 additions & 14 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,33 @@ on:
default: false
type: boolean

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false

# If we ever migrate this to not be manual, we HAVE to check that the commit
# it is running against DOES NOT contain [skip-ci] in the commit message
jobs:
build_test_and_deploy:
name: Build, Test, and Deploy
build_and_test:
name: Build and Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.ALCHEMY_BOT_PAT }}

- name: Set Github User Details
run: |
git config --global user.name "Alchemy Bot"
git config --global user.email "alchemy-bot@alchemy.com"

- name: Set NPM Permissions
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc

- name: Set Node.js 16.x
uses: actions/setup-node@v3
with:
node-version: "16.20"
node-version: "18.10"
cache: "yarn"

- name: Install dependencies
Expand All @@ -54,9 +56,42 @@ jobs:
API_KEY: ${{ secrets.API_KEY }}
OWNER_MNEMONIC: ${{ secrets.OWNER_MNEMONIC }}
PAYMASTER_POLICY_ID: ${{ secrets.PAYMASTER_POLICY_ID }}
UNDEPLOYED_OWNER_MNEMONIC: ${{ secrets.UNDEPLOYED_OWNER_MNEMONIC }}
LIGHT_ACCOUNT_OWNER_MNEMONIC: ${{ secrets.LIGHT_ACCOUNT_OWNER_MNEMONIC }}
run: yarn test:e2e

deploy:
name: Deploy
needs: build_and_test
runs-on: ubuntu-latest
if: inputs.publish
steps:
- name: Set Github User Details
run: |
git config --global user.name "Alchemy Bot"
git config --global user.email "alchemy-bot@alchemy.com"

- name: Set NPM Permissions
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc

# Lerna publish will, compute the new version, update files, run precommit hooks, tag, publish, and push change log
- name: Publish using Lerna
if: inputs.publish
run: yarn lerna publish --no-private --yes --no-verify-access

publish_site:
name: Publish Docs Site
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
needs: deploy
runs-on: ubuntu-latest
if: inputs.publish
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
env:
# TODO(moldy): just remove this altogether once we're live
NO_BASE_PATH: true
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ lerna-debug.log
.tool-versions

# example ignores
examples/contracts/**/out
examples/contracts/**/out

docs/.vitepress/dist
docs/.vitepress/cache
2 changes: 1 addition & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @moldy530 @rthomare @dancoombs @mokok123 @avasisht23
* @moldy530 @rthomare @dancoombs @mokok123 @avasisht23 @denniswon
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

⚠️ This repo is actively being developed and certain features might not be fully implemented yet or are subject to change ⚠️

Alchemy's Account Abstraction Kit is an SDK that enables easy interactions with ERC-4337 compliant smart accounts. It supports bringing your own Account Contracts or using any of the currently available accounts. The SDK is built on top of `viem` to enable a lighter-weight bundle and is published with ESM default exports though also supports CJS.
Alchemy's Account Abstraction Kit is an SDK that enables easy interactions with [ERC-4337](https://eips.ethereum.org/EIPS/eip-4337) compliant smart accounts. It supports bringing your own Account Contracts or using any of the currently available accounts. The SDK is built on top of `viem` to enable a lighter-weight bundle and is published with ESM default exports though also supports CJS.

## Getting Started

Expand Down Expand Up @@ -73,13 +73,13 @@ const owner: SmartAccountSigner =
LocalAccountSigner.mnemonicToAccountSigner(MNEMONIC);

// 2. initialize the provider and connect it to the account
const provider = new SmartAccountProvider(
const provider = new SmartAccountProvider({
// the demo key below is public and rate-limited, it's better to create a new one
// you can get started with a free account @ https://www.alchemy.com/
"https://polygon-mumbai.g.alchemy.com/v2/demo", // rpcUrl
"0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789", // entryPointAddress
polygonMumbai // chain
).connect(
rpcProvider: "https://polygon-mumbai.g.alchemy.com/v2/demo",
entryPointAddress: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
chain: polygonMumbai,
}).connect(
(rpcClient) =>
new SimpleSmartContractAccount({
entryPointAddress: "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",
Expand Down Expand Up @@ -139,7 +139,7 @@ let provider = new AlchemyProvider({
);

// [OPTIONAL] Use Alchemy Gas Manager
provider = provider.withAlchemyGasManager({
provider.withAlchemyGasManager({
policyId: PAYMASTER_POLICY_ID,
entryPoint: ENTRYPOINT_ADDRESS,
});
Expand Down Expand Up @@ -208,16 +208,16 @@ const { hash } = await signer.sendUserOperation({

The primary interfaces are the `SmartAccountProvider` and `BaseSmartContractAccount`.

The `SmartAccountProvider` is an ERC-1193 compliant Provider that wraps JSON RPC methods and some Wallet Methods (signing, sendTransaction, etc). It also provides two utility methods for sending UserOperations:
The `SmartAccountProvider` is an [EIP-1193](https://eips.ethereum.org/EIPS/eip-1193) compliant Provider that wraps JSON RPC methods and some Wallet Methods (signing, sendTransaction, etc). It also provides two utility methods for sending UserOperations:

1. `sendUserOperation` -- this takes in `target`, `callData`, and an optional `value` which then constructs a UserOperation (UO), sends it, and returns the `hash` of the UO. It handles estimating gas, fetching fee data, (optionally) requesting paymasterAndData, and lastly signing. This is done via a middleware stack that runs in a specific order. The middleware order is `getDummyPaymasterData` => `estimateGas` => `getFeeData` => `getPaymasterAndData`. The paymaster fields are set to `0x` by default. They can be changed using `provider.withPaymasterMiddleware`.
2. `sendTransaction` -- this takes in a traditional Transaction Request object which then gets converted into a UO. Currently, the only data being used from the Transaction Request object is `from`, `to`, `data` and `value`. Support for other fields is coming soon.
2. `sendTransaction` -- this takes in a traditional Transaction Request object which then gets converted into a UO. Note that `to` field of transaction is required, and among other fields of transaction, only `data`, `value`, `maxFeePerGas`, `maxPriorityFeePerGas` fields are considered if given. Support for other fields is coming soon.

If you want to add support for your own `SmartAccounts` then you will need to provide an implementation of `BaseSmartContractAccount`. You can see an example of this in [SimpleSmartContractAccount](packages/core/src/account/simple.ts). You will need to implement 4 methods:

1. `getDummySignature` -- this method should return a signature that will not `revert` during validation. It does not have to pass validation, just not cause the contract to revert. This is required for gas estimation so that the gas estimate are accurate.
2. `encodeExecute` -- this method should return the abi encoded function data for a call to your contract's `execute` method
3. `signMessage` -- this should return an ERC-191 compliant message and is used to sign UO Hashes
3. `signMessage` -- this should return an [EIP-191](https://eips.ethereum.org/EIPS/eip-191) compliant message and is used to sign UO Hashes
4. `getAccountInitCode` -- this should return the init code that will be used to create an account if one does not exist. Usually this is the concatenation of the account's factory address and the abi encoded function data of the account factory's `createAccount` method.

### Paymaster Middleware
Expand Down
5 changes: 5 additions & 0 deletions examples/aa-simple-dapp/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
8 changes: 4 additions & 4 deletions examples/alchemy-daapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,16 @@ export const alchemyApiKey = "<your-api-key>";
export const serverConfigs: Record<number, ServerConfiguration> = {
[polygonMumbai.id]: {
nftContractAddress: "<your-nft-contract-address>",
simpleAccountFactoryAddress: "<your-simple-account-factory-address>",
lightAccountFactoryAddress: "<your-light-account-factory-address>",
gasManagerPolicyId: "<your-gas-manager-policy-id>",
chain: polygonMumbai,
},
// Repeat for other chains as needed
};
```
### **🗒️ Notes:** for `nftContractAddress` and `simpleAccountFactoryAddress`
### **🗒️ Notes:** for `nftContractAddress` and `lightAccountFactoryAddress`
- There are already contract addresses deployed for them across [various chains here](https://github.com/alchemyplatform/aa-sdk/blob/main/examples/alchemy-daapp/src/configs/clientConfigs.ts).
- We used eth-infinitism's [simpleAccountFactory here](https://github.com/eth-infinitism/account-abstraction/blob/main/contracts/samples/SimpleAccountFactory.sol).
- We used Alchemy's [lightAccountFactory here]. todo(ajay): post the repo when live
- Finally, the contracts sibling package has the copy of the [NFT contract](https://github.com/alchemyplatform/aa-sdk/tree/main/examples/contracts/DAAppNFT/src) along instructions on [how to deploy it](https://github.com/alchemyplatform/aa-sdk/blob/main/examples/contracts/README.md).

4. Update the serverConfigs.ts file with your alchemy API keys:
Expand All @@ -60,7 +60,7 @@ yarn dev
## How This Works
The [`onboarding-controller.ts`](https://github.com/alchemyplatform/aa-sdk/blob/master/examples/alchemy-daapp/src/surfaces/onboarding/OnboardingController.ts) file contains the onboarding controller, which handles the onboarding process for new users. The controller uses the Alchemy SDK to create a new account and mint an NFT.

In the [`clientConfigs.ts`](https://github.com/alchemyplatform/aa-sdk/blob/main/examples/alchemy-daapp/src/configs/clientConfigs.ts) file, you will find the configuration for the DAApp, including the nft contract address, simple account factory address, gas manager policy id, rpc url, and chain. You'll also find an example NFT contract in [`examples/contracts/DAAppNFT`](https://github.com/alchemyplatform/aa-sdk/tree/main/examples/contracts/DAAppNFT)
In the [`clientConfigs.ts`](https://github.com/alchemyplatform/aa-sdk/blob/main/examples/alchemy-daapp/src/configs/clientConfigs.ts) file, you will find the configuration for the DAApp, including the nft contract address, light account factory address, gas manager policy id, rpc url, and chain. You'll also find an example NFT contract in [`examples/contracts/DAAppNFT`](https://github.com/alchemyplatform/aa-sdk/tree/main/examples/contracts/DAAppNFT)

You can replace the default values with your contract addresses and policy ids and add or remove chains as needed.

Expand Down
3 changes: 2 additions & 1 deletion examples/alchemy-daapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@alchemy/aa-accounts": "latest",
"@alchemy/aa-alchemy": "latest",
"@alchemy/aa-core": "latest",
"@chakra-ui/react": "^2.6.1",
Expand All @@ -24,7 +25,7 @@
"next": "^13.4.1",
"react": "18.2.0",
"react-dom": "18.2.0",
"viem": "^1.10.9",
"viem": "^1.16.2",
"wagmi": "^1.3.11",
"zod": "^3.21.4"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useCallback } from "react";
import { toHex } from "viem";
import { useWalletClient } from "wagmi";

type SimpleSmartAccountSignerResult =
type LightSmartAccountSignerResult =
| {
isLoading: false;
owner: SmartAccountSigner;
Expand All @@ -13,8 +13,9 @@ type SimpleSmartAccountSignerResult =
owner: undefined;
};

export function useSimpleAccountSigner(): SimpleSmartAccountSignerResult {
export function useLightAccountSigner(): LightSmartAccountSignerResult {
const walletClientQuery = useWalletClient();
const signerType = "json-rpc"
// We need this to by pass a viem bug https://github.com/wagmi-dev/viem/issues/606
const signMessage = useCallback(
(data: string | Uint8Array) =>
Expand Down Expand Up @@ -48,5 +49,5 @@ export function useSimpleAccountSigner(): SimpleSmartAccountSignerResult {
owner: undefined,
};
}
return { isLoading: false, owner: { signMessage, signTypedData, getAddress } };
return { isLoading: false, owner: { signerType, signMessage, signTypedData, getAddress } };
}
Loading