Skip to content

Commit

Permalink
refactor: use new custom schema
Browse files Browse the repository at this point in the history
  • Loading branch information
avasisht23 committed Nov 1, 2023
1 parent 38f6dbb commit 3fee977
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 17 deletions.
3 changes: 0 additions & 3 deletions packages/ethers/src/provider-adapter.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
SmartAccountProvider,
getChain,
getDefaultEntryPointAddress,
type AccountMiddlewareFn,
type FeeDataMiddleware,
type GasEstimatorMiddleware,
Expand Down Expand Up @@ -30,8 +29,6 @@ export class EthersProviderAdapter extends JsonRpcProvider {
const chain = getChain(opts.chainId);
this.accountProvider = new SmartAccountProvider({
rpcProvider: opts.rpcProvider,
entryPointAddress:
opts.entryPointAddress ?? getDefaultEntryPointAddress(chain),
chain,
});
}
Expand Down
16 changes: 2 additions & 14 deletions packages/ethers/src/schema.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
SmartAccountProvider,
type PublicErc4337Client,
createPublicErc4337ClientSchema,
} from "@alchemy/aa-core";
import { Address as zAddress } from "abitype/zod";
import type { HttpTransport } from "viem";
Expand All @@ -15,19 +15,7 @@ export const EthersProviderAdapterOptsSchema = z
.object({
rpcProvider: z.union([
z.string(),
z
.any()
.refine<PublicErc4337Client<HttpTransport>>(
(provider): provider is PublicErc4337Client<HttpTransport> => {
return (
typeof provider === "object" &&
"request" in provider &&
"type" in provider &&
"key" in provider &&
"name" in provider
);
}
),
createPublicErc4337ClientSchema<HttpTransport>(),
]),
chainId: z.number(),
})
Expand Down

0 comments on commit 3fee977

Please sign in to comment.