Socket
Socket
Sign inDemoInstall

@alchemy/aa-accounts

Package Overview
Dependencies
17
Maintainers
2
Versions
93
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.0 to 0.3.0

3

dist/cjs/kernel-zerodev/e2e-tests/constants.d.ts

@@ -1,3 +0,2 @@

export declare const RPC_URL: string | undefined;
export declare const API_KEY: string | undefined;
export declare const MUMBAI_RPC_URL: string | undefined;
export declare const OWNER_MNEMONIC: string;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.OWNER_MNEMONIC = exports.API_KEY = exports.RPC_URL = void 0;
exports.RPC_URL = process.env.RPC_URL;
exports.API_KEY = process.env.API_KEY;
exports.OWNER_MNEMONIC = exports.MUMBAI_RPC_URL = void 0;
exports.MUMBAI_RPC_URL = process.env.MUMBAI_RPC_URL;
exports.OWNER_MNEMONIC = process.env.OWNER_MNEMONIC;
//# sourceMappingURL=constants.js.map

@@ -15,5 +15,3 @@ "use strict";

chain: chains_1.polygonMumbai,
rpcProvider: constants_js_1.RPC_URL != null
? constants_js_1.RPC_URL
: `${chains_1.polygonMumbai.rpcUrls.alchemy.http[0]}/${constants_js_1.API_KEY}`,
rpcProvider: constants_js_1.MUMBAI_RPC_URL,
validatorAddress: "0x180D6465F921C7E0DEA0040107D342c87455fFF5",

@@ -25,3 +23,4 @@ accountFactoryAddress: "0x5D006d3880645ec6e254E18C1F879DAC9Dd71A39",

const owner = {
signerType: "kernel-zerodev",
inner: ownerAccount,
signerType: "aa-sdk-tests",
signMessage: async (msg) => ownerAccount.signMessage({

@@ -50,2 +49,7 @@ message: { raw: (0, viem_1.toHex)(msg) },

});
const feeDataGetter = async () => ({
maxFeePerGas: 100000000000n,
maxPriorityFeePerGas: 100000000000n,
});
provider.withFeeDataGetter(feeDataGetter);
function connect(index, owner = mockOwner) {

@@ -52,0 +56,0 @@ return provider.connect((_provider) => account(index, owner));

@@ -1,3 +0,5 @@

import type { Address, Hex, SignTypedDataParams, SmartAccountSigner } from "@alchemy/aa-core";
export declare class MockSigner implements SmartAccountSigner {
import { type Address, type Hex, type SignTypedDataParams, type SmartAccountSigner } from "@alchemy/aa-core";
import { type HDAccount } from "viem/accounts";
export declare class MockSigner implements SmartAccountSigner<HDAccount> {
inner: HDAccount;
signerType: string;

@@ -4,0 +6,0 @@ getAddress(): Promise<Address>;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MockSigner = void 0;
const accounts_1 = require("viem/accounts");
const constants_js_1 = require("../constants.js");
class MockSigner {
constructor() {
Object.defineProperty(this, "inner", {
enumerable: true,
configurable: true,
writable: true,
value: (0, accounts_1.mnemonicToAccount)(constants_js_1.OWNER_MNEMONIC)
});
Object.defineProperty(this, "signerType", {

@@ -10,3 +18,3 @@ enumerable: true,

writable: true,
value: "mock"
value: "aa-sdk-tests"
});

@@ -13,0 +21,0 @@ }

@@ -0,3 +1,3 @@

import type { SmartAccountSigner } from "@alchemy/aa-core";
import { type Hex } from "viem";
import type { SmartAccountSigner } from "@alchemy/aa-core";
export declare enum ValidatorMode {

@@ -4,0 +4,0 @@ sudo = "0x00000000",

@@ -1,4 +0,4 @@

export declare const RPC_URL: string;
export declare const API_KEY: string;
export declare const PAYMASTER_POLICY_ID: string;
export declare const UNDEPLOYED_OWNER_MNEMONIC: string;
export declare const LIGHT_ACCOUNT_OWNER_MNEMONIC: string;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LIGHT_ACCOUNT_OWNER_MNEMONIC = exports.UNDEPLOYED_OWNER_MNEMONIC = exports.API_KEY = exports.RPC_URL = void 0;
exports.RPC_URL = process.env.RPC_URL;
exports.LIGHT_ACCOUNT_OWNER_MNEMONIC = exports.UNDEPLOYED_OWNER_MNEMONIC = exports.PAYMASTER_POLICY_ID = exports.API_KEY = void 0;
exports.API_KEY = process.env.API_KEY;
exports.PAYMASTER_POLICY_ID = process.env.PAYMASTER_POLICY_ID;
exports.UNDEPLOYED_OWNER_MNEMONIC = process.env.UNDEPLOYED_OWNER_MNEMONIC;
exports.LIGHT_ACCOUNT_OWNER_MNEMONIC = process.env.LIGHT_ACCOUNT_OWNER_MNEMONIC;
//# sourceMappingURL=constants.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const aa_alchemy_1 = require("@alchemy/aa-alchemy");
const aa_core_1 = require("@alchemy/aa-core");

@@ -7,4 +8,3 @@ const viem_1 = require("viem");

const chains_1 = require("viem/chains");
const account_js_1 = require("../account.js");
const utils_js_1 = require("../utils.js");
const index_js_1 = require("../../index.js");
const constants_js_1 = require("./constants.js");

@@ -17,3 +17,3 @@ const chain = chains_1.sepolia;

const signer = givenConnectedProvider({ owner, chain });
expect(await signer.getAddress()).toMatchInlineSnapshot('"0x7eDdc16B15259E5541aCfdebC46929873839B872"');
expect(await signer.getAddress()).toMatchInlineSnapshot('"0xbd96C2c76dE02A75fe2909730422e05ce18f484e"');
});

@@ -51,3 +51,3 @@ it("should sign typed data successfully", async () => {

};
expect(await undeployedSigner.signTypedDataWith6492(typedData)).toMatchInlineSnapshot('"0x000000000000000000000000dc31c846da74400c732edb0fe888a2e4adfbb8b1000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000445fbfb9cf000000000000000000000000ef9d7530d16df66481adf291dc9a12b44c7f7df00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041591a9422219a5f2bc87ee24a82a6d5ef9674bf7408a2a289984de258466d148e75efb65b487ffbfcb061b268b1b667d8d7d4eac2c3d9d2d0a52d49c891be567c1c000000000000000000000000000000000000000000000000000000000000006492649264926492649264926492649264926492649264926492649264926492"');
expect(await undeployedSigner.signTypedDataWith6492(typedData)).toMatchInlineSnapshot('"0x000000000000000000000000000000893a26168158fbeadd9335be5bc96592e2000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000445fbfb9cf000000000000000000000000ef9d7530d16df66481adf291dc9a12b44c7f7df00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041591a9422219a5f2bc87ee24a82a6d5ef9674bf7408a2a289984de258466d148e75efb65b487ffbfcb061b268b1b667d8d7d4eac2c3d9d2d0a52d49c891be567c1c000000000000000000000000000000000000000000000000000000000000006492649264926492649264926492649264926492649264926492649264926492"');
});

@@ -59,3 +59,3 @@ it("should sign message with 6492 successfully for undeployed account", async () => {

});
expect(await undeployedSigner.signMessageWith6492("test")).toMatchInlineSnapshot('"0x000000000000000000000000dc31c846da74400c732edb0fe888a2e4adfbb8b1000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000445fbfb9cf000000000000000000000000ef9d7530d16df66481adf291dc9a12b44c7f7df00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041be34ecce63c5248d5cda407e7da319be3c861e6e2c5d30c9630cd35dcb55e56205c482503552883923f79e751ea3671cbb84d65b18af33cd3034aeb7d529da9a1b000000000000000000000000000000000000000000000000000000000000006492649264926492649264926492649264926492649264926492649264926492"');
expect(await undeployedSigner.signMessageWith6492("test")).toMatchInlineSnapshot('"0x000000000000000000000000000000893a26168158fbeadd9335be5bc96592e2000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000445fbfb9cf000000000000000000000000ef9d7530d16df66481adf291dc9a12b44c7f7df00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041be34ecce63c5248d5cda407e7da319be3c861e6e2c5d30c9630cd35dcb55e56205c482503552883923f79e751ea3671cbb84d65b18af33cd3034aeb7d529da9a1b000000000000000000000000000000000000000000000000000000000000006492649264926492649264926492649264926492649264926492649264926492"');
});

@@ -93,3 +93,11 @@ it("should execute successfully", async () => {

it("should transfer ownership successfully", async () => {
const signer = givenConnectedProvider({ owner, chain });
const signer = givenConnectedProvider({
owner,
chain,
feeOpts: {
baseFeeBufferPercent: 50n,
maxPriorityFeeBufferPercent: 50n,
preVerificationGasBufferPercent: 50n,
},
});
const throwawayOwner = aa_core_1.LocalAccountSigner.privateKeyToAccountSigner((0, accounts_1.generatePrivateKey)());

@@ -100,3 +108,3 @@ const provider = givenConnectedProvider({ owner: throwawayOwner, chain });

data: "0x",
value: BigInt("0x10000000000000"),
value: 10000000000000n,
});

@@ -106,3 +114,3 @@ const fundThrowawayTxnHash = signer.waitForUserOperationTransaction(fundThrowawayResult.hash);

const newThrowawayOwner = aa_core_1.LocalAccountSigner.privateKeyToAccountSigner((0, accounts_1.generatePrivateKey)());
const result = await account_js_1.LightSmartContractAccount.transferOwnership(provider, newThrowawayOwner);
const result = await index_js_1.LightSmartContractAccount.transferOwnership(provider, newThrowawayOwner);
const txnHash = provider.waitForUserOperationTransaction(result);

@@ -114,12 +122,19 @@ await expect(txnHash).resolves.not.toThrowError();

});
const givenConnectedProvider = ({ owner, chain, accountAddress, }) => new aa_core_1.SmartAccountProvider({
rpcProvider: constants_js_1.RPC_URL != null ? constants_js_1.RPC_URL : `${chain.rpcUrls.alchemy.http[0]}/${constants_js_1.API_KEY}`,
chain,
}).connect((provider) => new account_js_1.LightSmartContractAccount({
chain,
owner,
factoryAddress: (0, utils_js_1.getDefaultLightAccountFactoryAddress)(chain),
rpcClient: provider,
accountAddress,
}));
const givenConnectedProvider = ({ owner, chain, accountAddress, feeOpts, }) => {
const provider = new aa_alchemy_1.AlchemyProvider({
apiKey: constants_js_1.API_KEY,
chain,
feeOpts,
}).connect((rpcClient) => new index_js_1.LightSmartContractAccount({
chain,
owner,
factoryAddress: (0, index_js_1.getDefaultLightAccountFactoryAddress)(chain),
rpcClient,
accountAddress,
}));
provider.withAlchemyGasManager({
policyId: constants_js_1.PAYMASTER_POLICY_ID,
});
return provider;
};
//# sourceMappingURL=light-account.test.js.map

@@ -16,5 +16,6 @@ "use strict";

case chains_1.arbitrumGoerli.id:
case chains_1.arbitrumSepolia.id:
case chains_1.base.id:
case chains_1.baseGoerli.id:
return "0x000000893A26168158fbeaDD9335Be5bC96592E2";
return "0x00000055C0b4fA41dde26A74435ff03692292FBD";
}

@@ -21,0 +22,0 @@ throw new Error(`no default light account factory contract exists for ${chain.name}`);

@@ -1,3 +0,2 @@

export declare const RPC_URL: string | undefined;
export declare const API_KEY: string | undefined;
export declare const MUMBAI_RPC_URL: string | undefined;
export declare const OWNER_MNEMONIC: string;

@@ -1,4 +0,3 @@

export const RPC_URL = process.env.RPC_URL;
export const API_KEY = process.env.API_KEY;
export const MUMBAI_RPC_URL = process.env.MUMBAI_RPC_URL;
export const OWNER_MNEMONIC = process.env.OWNER_MNEMONIC;
//# sourceMappingURL=constants.js.map

@@ -8,3 +8,3 @@ import { getDefaultEntryPointAddress, } from "@alchemy/aa-core";

import { KernelBaseValidator, ValidatorMode } from "../validator/base.js";
import { API_KEY, OWNER_MNEMONIC, RPC_URL } from "./constants.js";
import { MUMBAI_RPC_URL, OWNER_MNEMONIC } from "./constants.js";
import { MockSigner } from "./mocks/mock-signer.js";

@@ -14,5 +14,3 @@ describe("Kernel Account Tests", () => {

chain: polygonMumbai,
rpcProvider: RPC_URL != null
? RPC_URL
: `${polygonMumbai.rpcUrls.alchemy.http[0]}/${API_KEY}`,
rpcProvider: MUMBAI_RPC_URL,
validatorAddress: "0x180D6465F921C7E0DEA0040107D342c87455fFF5",

@@ -24,3 +22,4 @@ accountFactoryAddress: "0x5D006d3880645ec6e254E18C1F879DAC9Dd71A39",

const owner = {
signerType: "kernel-zerodev",
inner: ownerAccount,
signerType: "aa-sdk-tests",
signMessage: async (msg) => ownerAccount.signMessage({

@@ -49,2 +48,7 @@ message: { raw: toHex(msg) },

});
const feeDataGetter = async () => ({
maxFeePerGas: 100000000000n,
maxPriorityFeePerGas: 100000000000n,
});
provider.withFeeDataGetter(feeDataGetter);
function connect(index, owner = mockOwner) {

@@ -51,0 +55,0 @@ return provider.connect((_provider) => account(index, owner));

@@ -1,3 +0,5 @@

import type { Address, Hex, SignTypedDataParams, SmartAccountSigner } from "@alchemy/aa-core";
export declare class MockSigner implements SmartAccountSigner {
import { type Address, type Hex, type SignTypedDataParams, type SmartAccountSigner } from "@alchemy/aa-core";
import { type HDAccount } from "viem/accounts";
export declare class MockSigner implements SmartAccountSigner<HDAccount> {
inner: HDAccount;
signerType: string;

@@ -4,0 +6,0 @@ getAddress(): Promise<Address>;

@@ -0,3 +1,12 @@

import {} from "@alchemy/aa-core";
import { mnemonicToAccount } from "viem/accounts";
import { OWNER_MNEMONIC } from "../constants.js";
export class MockSigner {
constructor() {
Object.defineProperty(this, "inner", {
enumerable: true,
configurable: true,
writable: true,
value: mnemonicToAccount(OWNER_MNEMONIC)
});
Object.defineProperty(this, "signerType", {

@@ -7,3 +16,3 @@ enumerable: true,

writable: true,
value: "mock"
value: "aa-sdk-tests"
});

@@ -10,0 +19,0 @@ }

@@ -0,3 +1,3 @@

import type { SmartAccountSigner } from "@alchemy/aa-core";
import { type Hex } from "viem";
import type { SmartAccountSigner } from "@alchemy/aa-core";
export declare enum ValidatorMode {

@@ -4,0 +4,0 @@ sudo = "0x00000000",

@@ -1,4 +0,4 @@

export declare const RPC_URL: string;
export declare const API_KEY: string;
export declare const PAYMASTER_POLICY_ID: string;
export declare const UNDEPLOYED_OWNER_MNEMONIC: string;
export declare const LIGHT_ACCOUNT_OWNER_MNEMONIC: string;

@@ -1,5 +0,5 @@

export const RPC_URL = process.env.RPC_URL;
export const API_KEY = process.env.API_KEY;
export const PAYMASTER_POLICY_ID = process.env.PAYMASTER_POLICY_ID;
export const UNDEPLOYED_OWNER_MNEMONIC = process.env.UNDEPLOYED_OWNER_MNEMONIC;
export const LIGHT_ACCOUNT_OWNER_MNEMONIC = process.env.LIGHT_ACCOUNT_OWNER_MNEMONIC;
//# sourceMappingURL=constants.js.map

@@ -1,8 +0,8 @@

import { LocalAccountSigner, SmartAccountProvider, } from "@alchemy/aa-core";
import { isAddress } from "viem";
import { AlchemyProvider } from "@alchemy/aa-alchemy";
import { LocalAccountSigner } from "@alchemy/aa-core";
import { isAddress, } from "viem";
import { generatePrivateKey } from "viem/accounts";
import { sepolia } from "viem/chains";
import { LightSmartContractAccount } from "../account.js";
import { getDefaultLightAccountFactoryAddress } from "../utils.js";
import { API_KEY, LIGHT_ACCOUNT_OWNER_MNEMONIC, RPC_URL, UNDEPLOYED_OWNER_MNEMONIC, } from "./constants.js";
import { LightSmartContractAccount, getDefaultLightAccountFactoryAddress, } from "../../index.js";
import { API_KEY, LIGHT_ACCOUNT_OWNER_MNEMONIC, PAYMASTER_POLICY_ID, UNDEPLOYED_OWNER_MNEMONIC, } from "./constants.js";
const chain = sepolia;

@@ -14,3 +14,3 @@ describe("Light Account Tests", () => {

const signer = givenConnectedProvider({ owner, chain });
expect(await signer.getAddress()).toMatchInlineSnapshot('"0x7eDdc16B15259E5541aCfdebC46929873839B872"');
expect(await signer.getAddress()).toMatchInlineSnapshot('"0xbd96C2c76dE02A75fe2909730422e05ce18f484e"');
});

@@ -48,3 +48,3 @@ it("should sign typed data successfully", async () => {

};
expect(await undeployedSigner.signTypedDataWith6492(typedData)).toMatchInlineSnapshot('"0x000000000000000000000000dc31c846da74400c732edb0fe888a2e4adfbb8b1000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000445fbfb9cf000000000000000000000000ef9d7530d16df66481adf291dc9a12b44c7f7df00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041591a9422219a5f2bc87ee24a82a6d5ef9674bf7408a2a289984de258466d148e75efb65b487ffbfcb061b268b1b667d8d7d4eac2c3d9d2d0a52d49c891be567c1c000000000000000000000000000000000000000000000000000000000000006492649264926492649264926492649264926492649264926492649264926492"');
expect(await undeployedSigner.signTypedDataWith6492(typedData)).toMatchInlineSnapshot('"0x000000000000000000000000000000893a26168158fbeadd9335be5bc96592e2000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000445fbfb9cf000000000000000000000000ef9d7530d16df66481adf291dc9a12b44c7f7df00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041591a9422219a5f2bc87ee24a82a6d5ef9674bf7408a2a289984de258466d148e75efb65b487ffbfcb061b268b1b667d8d7d4eac2c3d9d2d0a52d49c891be567c1c000000000000000000000000000000000000000000000000000000000000006492649264926492649264926492649264926492649264926492649264926492"');
});

@@ -56,3 +56,3 @@ it("should sign message with 6492 successfully for undeployed account", async () => {

});
expect(await undeployedSigner.signMessageWith6492("test")).toMatchInlineSnapshot('"0x000000000000000000000000dc31c846da74400c732edb0fe888a2e4adfbb8b1000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000445fbfb9cf000000000000000000000000ef9d7530d16df66481adf291dc9a12b44c7f7df00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041be34ecce63c5248d5cda407e7da319be3c861e6e2c5d30c9630cd35dcb55e56205c482503552883923f79e751ea3671cbb84d65b18af33cd3034aeb7d529da9a1b000000000000000000000000000000000000000000000000000000000000006492649264926492649264926492649264926492649264926492649264926492"');
expect(await undeployedSigner.signMessageWith6492("test")).toMatchInlineSnapshot('"0x000000000000000000000000000000893a26168158fbeadd9335be5bc96592e2000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000000445fbfb9cf000000000000000000000000ef9d7530d16df66481adf291dc9a12b44c7f7df00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000041be34ecce63c5248d5cda407e7da319be3c861e6e2c5d30c9630cd35dcb55e56205c482503552883923f79e751ea3671cbb84d65b18af33cd3034aeb7d529da9a1b000000000000000000000000000000000000000000000000000000000000006492649264926492649264926492649264926492649264926492649264926492"');
});

@@ -90,3 +90,11 @@ it("should execute successfully", async () => {

it("should transfer ownership successfully", async () => {
const signer = givenConnectedProvider({ owner, chain });
const signer = givenConnectedProvider({
owner,
chain,
feeOpts: {
baseFeeBufferPercent: 50n,
maxPriorityFeeBufferPercent: 50n,
preVerificationGasBufferPercent: 50n,
},
});
const throwawayOwner = LocalAccountSigner.privateKeyToAccountSigner(generatePrivateKey());

@@ -97,3 +105,3 @@ const provider = givenConnectedProvider({ owner: throwawayOwner, chain });

data: "0x",
value: BigInt("0x10000000000000"),
value: 10000000000000n,
});

@@ -110,12 +118,19 @@ const fundThrowawayTxnHash = signer.waitForUserOperationTransaction(fundThrowawayResult.hash);

});
const givenConnectedProvider = ({ owner, chain, accountAddress, }) => new SmartAccountProvider({
rpcProvider: RPC_URL != null ? RPC_URL : `${chain.rpcUrls.alchemy.http[0]}/${API_KEY}`,
chain,
}).connect((provider) => new LightSmartContractAccount({
chain,
owner,
factoryAddress: getDefaultLightAccountFactoryAddress(chain),
rpcClient: provider,
accountAddress,
}));
const givenConnectedProvider = ({ owner, chain, accountAddress, feeOpts, }) => {
const provider = new AlchemyProvider({
apiKey: API_KEY,
chain,
feeOpts,
}).connect((rpcClient) => new LightSmartContractAccount({
chain,
owner,
factoryAddress: getDefaultLightAccountFactoryAddress(chain),
rpcClient,
accountAddress,
}));
provider.withAlchemyGasManager({
policyId: PAYMASTER_POLICY_ID,
});
return provider;
};
//# sourceMappingURL=light-account.test.js.map

@@ -1,2 +0,2 @@

import { arbitrum, arbitrumGoerli, base, baseGoerli, goerli, mainnet, optimism, optimismGoerli, polygon, polygonMumbai, sepolia, } from "viem/chains";
import { arbitrum, arbitrumGoerli, arbitrumSepolia, base, baseGoerli, goerli, mainnet, optimism, optimismGoerli, polygon, polygonMumbai, sepolia, } from "viem/chains";
export const getDefaultLightAccountFactoryAddress = (chain) => {

@@ -13,5 +13,6 @@ switch (chain.id) {

case arbitrumGoerli.id:
case arbitrumSepolia.id:
case base.id:
case baseGoerli.id:
return "0x000000893A26168158fbeaDD9335Be5bC96592E2";
return "0x00000055C0b4fA41dde26A74435ff03692292FBD";
}

@@ -18,0 +19,0 @@ throw new Error(`no default light account factory contract exists for ${chain.name}`);

@@ -1,4 +0,3 @@

export declare const RPC_URL: string | undefined;
export declare const API_KEY: string | undefined;
export declare const MUMBAI_RPC_URL: string | undefined;
export declare const OWNER_MNEMONIC: string;
//# sourceMappingURL=constants.d.ts.map

@@ -1,3 +0,5 @@

import type { Address, Hex, SignTypedDataParams, SmartAccountSigner } from "@alchemy/aa-core";
export declare class MockSigner implements SmartAccountSigner {
import { type Address, type Hex, type SignTypedDataParams, type SmartAccountSigner } from "@alchemy/aa-core";
import { type HDAccount } from "viem/accounts";
export declare class MockSigner implements SmartAccountSigner<HDAccount> {
inner: HDAccount;
signerType: string;

@@ -4,0 +6,0 @@ getAddress(): Promise<Address>;

@@ -0,3 +1,3 @@

import type { SmartAccountSigner } from "@alchemy/aa-core";
import { type Hex } from "viem";
import type { SmartAccountSigner } from "@alchemy/aa-core";
export declare enum ValidatorMode {

@@ -4,0 +4,0 @@ sudo = "0x00000000",

@@ -1,5 +0,5 @@

export declare const RPC_URL: string;
export declare const API_KEY: string;
export declare const PAYMASTER_POLICY_ID: string;
export declare const UNDEPLOYED_OWNER_MNEMONIC: string;
export declare const LIGHT_ACCOUNT_OWNER_MNEMONIC: string;
//# sourceMappingURL=constants.d.ts.map
{
"name": "@alchemy/aa-accounts",
"version": "0.2.0",
"version": "0.3.0",
"description": "A collection of ERC-4337 compliant smart contract account interfaces",

@@ -42,3 +42,4 @@ "author": "Alchemy",

"devDependencies": {
"@alchemy/aa-core": "^0.1.1",
"@alchemy/aa-alchemy": "^0.3.0",
"@alchemy/aa-core": "^0.2.0",
"typescript": "^5.0.4",

@@ -60,7 +61,7 @@ "typescript-template": "*",

"homepage": "https://github.com/alchemyplatform/aa-sdk#readme",
"gitHead": "e9de0ca797605b04dc0a5db0764f1efed4a94610",
"gitHead": "34243f6a3eca6230263033895d7b96401f0abb70",
"dependencies": {
"@alchemy/aa-core": "^0.2.0",
"@alchemy/aa-core": "^0.3.0",
"viem": "^1.16.2"
}
}

@@ -9,4 +9,6 @@ import type {

export class MockSigner implements SmartAccountSigner {
signerType = "mock";
inner: any;
signerType = "aa-sdk-tests";
getAddress(): Promise<Address> {

@@ -13,0 +15,0 @@ return Promise.resolve("0x48D4d3536cDe7A257087206870c6B6E76e3D4ff4");

@@ -21,5 +21,5 @@ import {

import { MultiSendAbi } from "./abis/MultiSendAbi.js";
import type { KernelUserOperationCallData } from "./types.js";
import { encodeCall } from "./utils.js";
import { KernelBaseValidator, ValidatorMode } from "./validator/base.js";
import type { KernelUserOperationCallData } from "./types.js";

@@ -26,0 +26,0 @@ export interface KernelSmartAccountParams<

@@ -1,3 +0,2 @@

export const RPC_URL = process.env.RPC_URL;
export const API_KEY = process.env.API_KEY;
export const MUMBAI_RPC_URL = process.env.MUMBAI_RPC_URL;
export const OWNER_MNEMONIC = process.env.OWNER_MNEMONIC!;

@@ -1,11 +0,15 @@

import type {
Address,
Hex,
SignTypedDataParams,
SmartAccountSigner,
import {
type Address,
type Hex,
type SignTypedDataParams,
type SmartAccountSigner,
} from "@alchemy/aa-core";
import { mnemonicToAccount, type HDAccount } from "viem/accounts";
import { OWNER_MNEMONIC } from "../constants.js";
export class MockSigner implements SmartAccountSigner {
signerType = "mock";
export class MockSigner implements SmartAccountSigner<HDAccount> {
inner = mnemonicToAccount(OWNER_MNEMONIC);
signerType = "aa-sdk-tests";
getAddress(): Promise<Address> {

@@ -12,0 +16,0 @@ return Promise.resolve("0x48D4d3536cDe7A257087206870c6B6E76e3D4ff4");

@@ -1,12 +0,14 @@

import type {
Address,
Hex,
SignTypedDataParams,
SmartAccountSigner,
import {
type Address,
type Hex,
type SignTypedDataParams,
type SmartAccountSigner,
} from "@alchemy/aa-core";
export class MockSignerValidator implements SmartAccountSigner {
signerType = "mock-validator";
inner: any;
signTypedData(params: SignTypedDataParams): Promise<`0x${string}`> {
signerType = "aa-sdk-tests";
signTypedData(_params: SignTypedDataParams): Promise<`0x${string}`> {
return Promise.resolve("0xMOCK_SIGN_TYPED_DATA");

@@ -13,0 +15,0 @@ }

@@ -0,3 +1,3 @@

import type { SmartAccountSigner } from "@alchemy/aa-core";
import { concatHex, type Hex } from "viem";
import type { SmartAccountSigner } from "@alchemy/aa-core";

@@ -4,0 +4,0 @@ export enum ValidatorMode {

@@ -1,3 +0,4 @@

export const RPC_URL = process.env.RPC_URL!;
export const API_KEY = process.env.API_KEY!;
export const PAYMASTER_POLICY_ID = process.env.PAYMASTER_POLICY_ID!;
export const UNDEPLOYED_OWNER_MNEMONIC = process.env.UNDEPLOYED_OWNER_MNEMONIC!;

@@ -4,0 +5,0 @@ export const LIGHT_ACCOUNT_OWNER_MNEMONIC =

@@ -5,2 +5,3 @@ import type { Address, Chain } from "viem";

arbitrumGoerli,
arbitrumSepolia,
base,

@@ -35,5 +36,6 @@ baseGoerli,

case arbitrumGoerli.id:
case arbitrumSepolia.id:
case base.id:
case baseGoerli.id:
return "0x000000893A26168158fbeaDD9335Be5bC96592E2";
return "0x00000055C0b4fA41dde26A74435ff03692292FBD";
}

@@ -40,0 +42,0 @@ throw new Error(

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc