@1llet.xyz/erc4337-gasless-sdk 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/types.ts ADDED
@@ -0,0 +1,51 @@
1
+ import { type Address, type Chain, type Hash, type Hex } from "viem";
2
+
3
+ export interface ChainConfig {
4
+ chain: Chain;
5
+ rpcUrl: string;
6
+ bundlerUrl: string;
7
+ entryPointAddress: Address;
8
+ factoryAddress: Address;
9
+ paymasterAddress: Address;
10
+ usdcAddress: Address;
11
+ }
12
+
13
+ export interface UserOperation {
14
+ sender: Address;
15
+ nonce: bigint;
16
+ initCode: Hex;
17
+ callData: Hex;
18
+ callGasLimit: bigint;
19
+ verificationGasLimit: bigint;
20
+ preVerificationGas: bigint;
21
+ maxFeePerGas: bigint;
22
+ maxPriorityFeePerGas: bigint;
23
+ paymasterAndData: Hex;
24
+ signature: Hex;
25
+ }
26
+
27
+ export interface GasEstimate {
28
+ callGasLimit: string;
29
+ verificationGasLimit: string;
30
+ preVerificationGas: string;
31
+ maxFeePerGas: string;
32
+ maxPriorityFeePerGas: string;
33
+ }
34
+
35
+ export interface UserOpReceipt {
36
+ userOpHash: Hash;
37
+ sender: Address;
38
+ success: boolean;
39
+ actualGasCost: string;
40
+ receipt: {
41
+ transactionHash: Hash;
42
+ blockNumber: string;
43
+ };
44
+ }
45
+
46
+ export interface ApprovalSupportResult {
47
+ type: "permit" | "approve" | "none";
48
+ gasCost?: string;
49
+ fundingNeeded?: string;
50
+ fundedAmount?: string;
51
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "declaration": true,
7
+ "strict": true,
8
+ "esModuleInterop": true,
9
+ "skipLibCheck": true,
10
+ "forceConsistentCasingInFileNames": true
11
+ },
12
+ "include": [
13
+ "src/**/*"
14
+ ],
15
+ "exclude": [
16
+ "node_modules",
17
+ "dist"
18
+ ]
19
+ }
package/tsup.config.ts ADDED
@@ -0,0 +1,10 @@
1
+ import { defineConfig } from "tsup";
2
+
3
+ export default defineConfig({
4
+ entry: ["src/index.ts"],
5
+ format: ["cjs", "esm"], // Build for commonjs and esmodules
6
+ dts: true, // Generate declaration file (.d.ts)
7
+ splitting: false,
8
+ sourcemap: true,
9
+ clean: true,
10
+ });