Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sherifahmed990 committed Jul 29, 2023
0 parents commit 1b7877a
Show file tree
Hide file tree
Showing 52 changed files with 7,142 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.js
*.cjs
15 changes: 15 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/* eslint-env node */
module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
],
parser: "@typescript-eslint/parser",
parserOptions: {
tsconfigRootDir: __dirname,
project: ["./tsconfig.json"],
},
plugins: ["@typescript-eslint"],
root: true,
};
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules/**
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
npx lint-staged
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore artifacts:
build
coverage
3 changes: 3 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"useTabs": true
}
7 changes: 7 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright <2023> <CandideLabs>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
18 changes: 18 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!-- PROJECT LOGO -->

<div align="center">
<h1 align="center">AbstractionKit - Account Abstraction SDK by Candide</h2>
</div>

<div align="center">
<img src="https://user-images.githubusercontent.com/7014833/203773780-04a0c8c0-93a6-43a4-bb75-570cb951dfa0.png" height =200>
</div>

# About

AbstractionKit - Account Abstraction SDK by Candide

<!-- LICENSE -->
## License

MIT
48 changes: 48 additions & 0 deletions dist/Bundler.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import type {
UserOperation,
JsonRpcError,
GasEstimationResult,
UserOperationByHashResult,
UserOperationReceiptResult,
AbiInputValue,
JsonRpcResponse,
} from "./types";
import { BytesLike } from "ethers";
export declare class Bundler {
readonly rpcUrl: string;
readonly entrypointAddress: string;
constructor(rpcUrl: string, entrypointAddress: string);
chainId(): Promise<
| {
chainId: string;
}
| JsonRpcError
>;
supportedEntryPoints(): Promise<
| {
supportedEntryPoints: string[];
}
| JsonRpcError
>;
estimateUserOperationGas(
useroperation: UserOperation,
): Promise<GasEstimationResult | JsonRpcError>;
sendUserOperation(useroperation: UserOperation): Promise<
| {
userOperationHash: string;
}
| JsonRpcError
>;
getUserOperationReceipt(
useroperationhash: BytesLike,
): Promise<UserOperationReceiptResult | JsonRpcError>;
getUserOperationByHash(
useroperationhash: BytesLike,
): Promise<UserOperationByHashResult | JsonRpcError>;
sendJsonRpcRequest(
rpcUrl: string,
method: string,
params: AbiInputValue,
): Promise<JsonRpcResponse>;
}
//# sourceMappingURL=Bundler.d.ts.map
1 change: 1 addition & 0 deletions dist/Bundler.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions dist/abstractionkit.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
export { SmartAccount } from "./account/SmartAccount";
export { CandideAccount } from "./account/CandideAccount";
export { SmartAccountFactory } from "./factory/SmartAccountFactory";
export { CandideAccountFactory } from "./factory/CandideAccountFactory";
export { Bundler } from "./Bundler";
export { getUserOperationHash } from "./utils";
export { UserOperationEmptyValues } from "./constants";
export type {
UserOperation,
AbiInputValue,
JsonRpcResponse,
JsonRpcResult,
JsonRpcError,
GasEstimationResult,
UserOperationByHashResult,
UserOperationReceipt,
UserOperationReceiptResult,
} from "./types";
//# sourceMappingURL=abstractionkit.d.ts.map
1 change: 1 addition & 0 deletions dist/abstractionkit.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions dist/account/CandideAccount.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { SmartAccount } from "./SmartAccount";
import type { BigNumberish, BytesLike } from "ethers";
import type { Operation } from "../types";
import { SmartAccountFactory } from "../factory/SmartAccountFactory";
export declare class CandideAccount extends SmartAccount {
readonly entrypointAddress: string;
readonly candideAccountFactory: SmartAccountFactory;
constructor(
singletonAddress?: string,
entrypointAddress?: string,
candideAccountFactory?: SmartAccountFactory,
);
createNewAccount(
owners: string[],
threshold?: BigNumberish,
): [string, BytesLike];
createNewAccount(
owners: string[],
threshold: BigNumberish,
c2nonce: BigNumberish,
): [string, BytesLike];
createNewAccount(
owners: string[],
threshold: BigNumberish,
c2nonce: BigNumberish,
fallbackHandler: string,
): [string, BytesLike];
createSendEthCallData(to: string, value: BigNumberish): BytesLike;
createCallData(
to: string,
value: BigNumberish,
data: BytesLike,
operation: Operation,
paymaster: string,
approveToken: string,
approveAmount: BigNumberish,
): BytesLike;
}
//# sourceMappingURL=CandideAccount.d.ts.map
1 change: 1 addition & 0 deletions dist/account/CandideAccount.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions dist/account/SmartAccount.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import type { BytesLike, BigNumberish } from "ethers";
import { AbiInputValue } from "../types";
export declare class SmartAccount {
readonly singletonAddress: string;
readonly proxyByteCode: BytesLike;
readonly initializerFunctionSelector: string;
readonly initializerFunctionInputAbi: string[];
readonly executorFunctionSelector: string;
readonly executorFunctionInputAbi: string[];
constructor(
singletonAddress: string,
proxyByteCode: BytesLike,
initializerFunctionSelector: string,
initializerFunctionInputAbi: string[],
executorFunctionSelector: string,
executorFunctionInputAbi: string[],
);
getInitializerCallData(
initializerFunctionInputParameters: AbiInputValue[],
): BytesLike;
getExecutorCallData(
executorFunctionInputParameters: AbiInputValue[],
): BytesLike;
getProxyAddress(
initializerCallData: BytesLike,
factoryAddress: string,
c2Nonce: BigNumberish,
): string;
}
//# sourceMappingURL=SmartAccount.d.ts.map
1 change: 1 addition & 0 deletions dist/account/SmartAccount.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions dist/constants.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import type { UserOperation } from "./types";
export declare const UserOperationEmptyValues: UserOperation;
//# sourceMappingURL=constants.d.ts.map
1 change: 1 addition & 0 deletions dist/constants.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions dist/factory/CandideAccountFactory.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { SmartAccountFactory } from "./SmartAccountFactory";
export declare class CandideAccountFactory extends SmartAccountFactory {
constructor(address?: string);
}
//# sourceMappingURL=CandideAccountFactory.d.ts.map
1 change: 1 addition & 0 deletions dist/factory/CandideAccountFactory.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions dist/factory/SmartAccountFactory.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { BytesLike } from "ethers";
import type { AbiInputValue } from "../types";
export declare class SmartAccountFactory {
readonly address: string;
readonly generatorFunctionSelector: string;
readonly generatorFunctionInputAbi: string[];
constructor(
address: string,
generatorFunctionSelector: string,
generatorFunctionInputAbi: string[],
);
getFactoryGeneratorFunctionCallData(
generatorFunctionInputParameters: AbiInputValue[],
): BytesLike;
}
//# sourceMappingURL=SmartAccountFactory.d.ts.map
1 change: 1 addition & 0 deletions dist/factory/SmartAccountFactory.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import * as abstractionkit from "./abstractionkit.js";
export { abstractionkit };
export * from "./abstractionkit.js";
//# sourceMappingURL=index.d.ts.map
1 change: 1 addition & 0 deletions dist/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1b7877a

Please sign in to comment.