@1llet.xyz/erc4337-gasless-sdk 0.4.7 → 0.4.9

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/dist/index.d.mts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Chain, Address, Hash, Hex } from 'viem';
2
+ import z from 'zod';
2
3
 
3
4
  interface Token {
4
5
  symbol: string;
@@ -277,4 +278,95 @@ declare const erc20Abi: readonly [{
277
278
  readonly type: "function";
278
279
  }];
279
280
 
280
- export { AccountAbstraction, type ApprovalSupportResult, BASE_MAINNET, BASE_SEPOLIA, BundlerClient, CHAIN_CONFIGS, type ChainConfig, GNOSIS_MAINNET, type GasEstimate, type Token, type UserOpReceipt, type UserOperation, entryPointAbi, erc20Abi, smartAccountAbi };
281
+ declare const ChainKeyEnum: z.ZodEnum<{
282
+ Base: "Base";
283
+ Optimism: "Optimism";
284
+ Arbitrum: "Arbitrum";
285
+ Unichain: "Unichain";
286
+ Polygon: "Polygon";
287
+ Avalanche: "Avalanche";
288
+ WorldChain: "WorldChain";
289
+ Stellar: "Stellar";
290
+ Monad: "Monad";
291
+ BNB: "BNB";
292
+ GNOSIS: "GNOSIS";
293
+ }>;
294
+ type ChainKey = z.infer<typeof ChainKeyEnum>;
295
+
296
+ interface FacilitatorPaymentPayload {
297
+ authorization: {
298
+ from: Address;
299
+ to: Address;
300
+ value: bigint;
301
+ validAfter: bigint;
302
+ validBefore: bigint;
303
+ nonce: Hex;
304
+ };
305
+ signature: Hex;
306
+ signedXDR?: string;
307
+ }
308
+ interface SettleResponse {
309
+ success: boolean;
310
+ errorReason?: string;
311
+ transactionHash?: Hex | string;
312
+ burnTransactionHash?: Hex | string;
313
+ mintTransactionHash?: Hex | string;
314
+ fee?: string;
315
+ netAmount?: string;
316
+ payer?: string;
317
+ attestation?: {
318
+ message: string;
319
+ attestation: string;
320
+ };
321
+ data?: any;
322
+ }
323
+ interface BridgeContext {
324
+ paymentPayload: FacilitatorPaymentPayload;
325
+ sourceChain: ChainKey;
326
+ destChain: ChainKey;
327
+ sourceToken?: string;
328
+ destToken?: string;
329
+ amount: string;
330
+ recipient: string;
331
+ senderAddress?: string;
332
+ facilitatorPrivateKey?: string;
333
+ feeRecipient?: string;
334
+ }
335
+ interface BridgeStrategy {
336
+ name: string;
337
+ canHandle(context: BridgeContext): boolean;
338
+ execute(context: BridgeContext): Promise<SettleResponse>;
339
+ }
340
+
341
+ declare class BridgeManager {
342
+ private strategies;
343
+ constructor();
344
+ private getStrategy;
345
+ execute(context: BridgeContext): Promise<SettleResponse>;
346
+ }
347
+
348
+ declare class NearStrategy implements BridgeStrategy {
349
+ name: string;
350
+ canHandle(context: BridgeContext): boolean;
351
+ execute(context: BridgeContext): Promise<SettleResponse>;
352
+ }
353
+
354
+ declare class CCTPStrategy implements BridgeStrategy {
355
+ name: string;
356
+ canHandle(context: BridgeContext): boolean;
357
+ execute(context: BridgeContext): Promise<SettleResponse>;
358
+ }
359
+
360
+ declare class GaslessStrategy implements BridgeStrategy {
361
+ name: string;
362
+ canHandle(context: BridgeContext): boolean;
363
+ execute(context: BridgeContext): Promise<SettleResponse>;
364
+ }
365
+
366
+ declare class StandardBridgeStrategy implements BridgeStrategy {
367
+ name: string;
368
+ canHandle(context: BridgeContext): boolean;
369
+ execute(context: BridgeContext): Promise<SettleResponse>;
370
+ }
371
+
372
+ export { AccountAbstraction, type ApprovalSupportResult, BASE_MAINNET, BASE_SEPOLIA, BridgeManager, BundlerClient, CCTPStrategy, CHAIN_CONFIGS, type ChainConfig, GNOSIS_MAINNET, type GasEstimate, GaslessStrategy, NearStrategy, StandardBridgeStrategy, type Token, type UserOpReceipt, type UserOperation, entryPointAbi, erc20Abi, smartAccountAbi };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Chain, Address, Hash, Hex } from 'viem';
2
+ import z from 'zod';
2
3
 
3
4
  interface Token {
4
5
  symbol: string;
@@ -277,4 +278,95 @@ declare const erc20Abi: readonly [{
277
278
  readonly type: "function";
278
279
  }];
279
280
 
280
- export { AccountAbstraction, type ApprovalSupportResult, BASE_MAINNET, BASE_SEPOLIA, BundlerClient, CHAIN_CONFIGS, type ChainConfig, GNOSIS_MAINNET, type GasEstimate, type Token, type UserOpReceipt, type UserOperation, entryPointAbi, erc20Abi, smartAccountAbi };
281
+ declare const ChainKeyEnum: z.ZodEnum<{
282
+ Base: "Base";
283
+ Optimism: "Optimism";
284
+ Arbitrum: "Arbitrum";
285
+ Unichain: "Unichain";
286
+ Polygon: "Polygon";
287
+ Avalanche: "Avalanche";
288
+ WorldChain: "WorldChain";
289
+ Stellar: "Stellar";
290
+ Monad: "Monad";
291
+ BNB: "BNB";
292
+ GNOSIS: "GNOSIS";
293
+ }>;
294
+ type ChainKey = z.infer<typeof ChainKeyEnum>;
295
+
296
+ interface FacilitatorPaymentPayload {
297
+ authorization: {
298
+ from: Address;
299
+ to: Address;
300
+ value: bigint;
301
+ validAfter: bigint;
302
+ validBefore: bigint;
303
+ nonce: Hex;
304
+ };
305
+ signature: Hex;
306
+ signedXDR?: string;
307
+ }
308
+ interface SettleResponse {
309
+ success: boolean;
310
+ errorReason?: string;
311
+ transactionHash?: Hex | string;
312
+ burnTransactionHash?: Hex | string;
313
+ mintTransactionHash?: Hex | string;
314
+ fee?: string;
315
+ netAmount?: string;
316
+ payer?: string;
317
+ attestation?: {
318
+ message: string;
319
+ attestation: string;
320
+ };
321
+ data?: any;
322
+ }
323
+ interface BridgeContext {
324
+ paymentPayload: FacilitatorPaymentPayload;
325
+ sourceChain: ChainKey;
326
+ destChain: ChainKey;
327
+ sourceToken?: string;
328
+ destToken?: string;
329
+ amount: string;
330
+ recipient: string;
331
+ senderAddress?: string;
332
+ facilitatorPrivateKey?: string;
333
+ feeRecipient?: string;
334
+ }
335
+ interface BridgeStrategy {
336
+ name: string;
337
+ canHandle(context: BridgeContext): boolean;
338
+ execute(context: BridgeContext): Promise<SettleResponse>;
339
+ }
340
+
341
+ declare class BridgeManager {
342
+ private strategies;
343
+ constructor();
344
+ private getStrategy;
345
+ execute(context: BridgeContext): Promise<SettleResponse>;
346
+ }
347
+
348
+ declare class NearStrategy implements BridgeStrategy {
349
+ name: string;
350
+ canHandle(context: BridgeContext): boolean;
351
+ execute(context: BridgeContext): Promise<SettleResponse>;
352
+ }
353
+
354
+ declare class CCTPStrategy implements BridgeStrategy {
355
+ name: string;
356
+ canHandle(context: BridgeContext): boolean;
357
+ execute(context: BridgeContext): Promise<SettleResponse>;
358
+ }
359
+
360
+ declare class GaslessStrategy implements BridgeStrategy {
361
+ name: string;
362
+ canHandle(context: BridgeContext): boolean;
363
+ execute(context: BridgeContext): Promise<SettleResponse>;
364
+ }
365
+
366
+ declare class StandardBridgeStrategy implements BridgeStrategy {
367
+ name: string;
368
+ canHandle(context: BridgeContext): boolean;
369
+ execute(context: BridgeContext): Promise<SettleResponse>;
370
+ }
371
+
372
+ export { AccountAbstraction, type ApprovalSupportResult, BASE_MAINNET, BASE_SEPOLIA, BridgeManager, BundlerClient, CCTPStrategy, CHAIN_CONFIGS, type ChainConfig, GNOSIS_MAINNET, type GasEstimate, GaslessStrategy, NearStrategy, StandardBridgeStrategy, type Token, type UserOpReceipt, type UserOperation, entryPointAbi, erc20Abi, smartAccountAbi };