-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.js | ||
*.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, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules/** |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_ |
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Ignore artifacts: | ||
build | ||
coverage |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"useTabs": true | ||
} |
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. |
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 |
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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.