Skip to content

Commit

Permalink
feat: entry point address as optional to SmartAccountProvider (#180)
Browse files Browse the repository at this point in the history
* feat: abstract out entry point contract address from SCA provider params

* feat: make entry point address as an optional param to SCA provider class

* feat: update docs for the new utils methods

* Update site/packages/aa-core/utils/getDefaultEntryPointContract.md

Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>

* Update site/packages/aa-core/utils/getDefaultSimpleAccountFactory.md

Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>

* chore: nit error message update and refactoring

---------

Co-authored-by: Ajay Vasisht <43521356+avasisht23@users.noreply.github.com>
  • Loading branch information
denniswon and avasisht23 committed Nov 3, 2023
1 parent 0aa0448 commit 4b62df0
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ import { useAccount, useNetwork, type Chain } from "wagmi";
import { localSmartContractStore } from "~/clients/localStorage";
import { NFTContractABI } from "../../clients/nftContract";
import {
DAAppConfiguration,
daappConfigurations,
DAAppConfiguration,
daappConfigurations,
} from "../../configs/clientConfigs";
import {
MIN_ONBOARDING_WALLET_BALANCE,
OnboardingContext,
OnboardingStep,
OnboardingStepIdentifier,
initialStep,
metaForStepIdentifier,
MIN_ONBOARDING_WALLET_BALANCE,
OnboardingContext,
OnboardingStep,
OnboardingStepIdentifier,
initialStep,
metaForStepIdentifier,
} from "./OnboardingDataModels";

async function pollForLambdaForComplete(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
LocalAccountSigner,
SmartAccountProvider,
type Address,
type BatchUserOperationCallData,
type SmartAccountSigner,
} from "@alchemy/aa-core";
Expand Down
2 changes: 2 additions & 0 deletions site/smart-accounts/signers/capsule.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ import { sepolia } from "viem/chains";
import { capsuleSigner } from "./capsule";

const chain = sepolia;
const entryPointAddress = getDefaultEntryPointAddress(chain);
const factoryAddress = getDefaultLightAccountFactoryAddress(chain);
const provider = new AlchemyProvider({
apiKey: "ALCHEMY_API_KEY",
chain,
Expand Down
2 changes: 2 additions & 0 deletions site/smart-accounts/signers/dynamic.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ import { sepolia } from "viem/chains";
import { dynamicSigner } from "./dynamic";

const chain = sepolia;
const entryPointAddress = getDefaultEntryPointAddress(chain);
const factoryAddress = getDefaultLightAccountFactoryAddress(chain);
const provider = new AlchemyProvider({
apiKey: "ALCHEMY_API_KEY",
chain,
Expand Down
3 changes: 3 additions & 0 deletions site/smart-accounts/signers/magic.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ import { sepolia } from "viem/chains";
import { createMagicSigner } from "./magic";

const chain = sepolia;
const entryPointAddress = getDefaultEntryPointContract(chain);
const factoryAddress = getDefaultLightAccountFactory(chain);

// NOTE: the below is async because it depends on creating a magic signer. You can choose to break that up how you want
// eg. use a useEffect + useState to create the signer and then pass it down to the provider
const provider = new AlchemyProvider({
Expand Down
2 changes: 2 additions & 0 deletions site/smart-accounts/signers/turnkey.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ import { newTurnkeySigner } from "./turnkey";
async function main() {
const owner = await newTurnkeySigner();
const chain = sepolia;
const entryPointAddress = getDefaultEntryPointAddress(chain);
const factoryAddress = getDefaultLightAccountFactoryAddress(chain);
const provider = new AlchemyProvider({
apiKey: "ALCHEMY_API_KEY",
chain,
Expand Down
2 changes: 2 additions & 0 deletions site/smart-accounts/signers/web3auth.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ import { sepolia } from "viem/chains";
import { web3authSigner } from "./web3auth";

const chain = sepolia;
const entryPointAddress = getDefaultEntryPointAddress(chain);
const factoryAddress = getDefaultLightAccountFactoryAddress(chain);
const provider = new AlchemyProvider({
apiKey: "ALCHEMY_API_KEY",
chain,
Expand Down

0 comments on commit 4b62df0

Please sign in to comment.