@aomi-labs/client 0.1.21 → 0.1.23
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/cli.js +4048 -3396
- package/dist/index.cjs +658 -479
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +190 -250
- package/dist/index.d.ts +190 -250
- package/dist/index.js +655 -472
- package/dist/index.js.map +1 -1
- package/package.json +8 -6
- package/skills/README.md +2 -2
- package/skills/{aomi-app-builder → aomi-build}/SKILL.md +2 -2
- package/skills/aomi-build/agents/openai.yaml +4 -0
- package/skills/aomi-transact/SKILL.md +376 -113
- package/skills/aomi-app-builder/agents/openai.yaml +0 -4
- /package/skills/{aomi-app-builder → aomi-build}/references/aomi-sdk-patterns.md +0 -0
- /package/skills/{aomi-app-builder → aomi-build}/references/spec-to-tools.md +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Hex, Chain, TransactionReceipt } from 'viem';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Client-side user state synced with the backend.
|
|
@@ -315,28 +315,116 @@ type Listener<T = unknown> = (payload: T) => void;
|
|
|
315
315
|
*/
|
|
316
316
|
declare class TypedEventEmitter<EventMap extends Record<string, unknown> = Record<string, unknown>> {
|
|
317
317
|
private listeners;
|
|
318
|
-
/**
|
|
319
|
-
* Subscribe to an event type. Returns an unsubscribe function.
|
|
320
|
-
*/
|
|
321
318
|
on<K extends keyof EventMap & string>(type: K, handler: Listener<EventMap[K]>): () => void;
|
|
322
|
-
/**
|
|
323
|
-
* Subscribe to an event type for a single emission, then auto-unsubscribe.
|
|
324
|
-
*/
|
|
325
319
|
once<K extends keyof EventMap & string>(type: K, handler: Listener<EventMap[K]>): () => void;
|
|
326
|
-
/**
|
|
327
|
-
* Emit an event to all listeners of `type` and wildcard `"*"` listeners.
|
|
328
|
-
*/
|
|
329
320
|
emit<K extends keyof EventMap & string>(type: K, payload: EventMap[K]): void;
|
|
330
|
-
/**
|
|
331
|
-
* Remove a specific handler from an event type.
|
|
332
|
-
*/
|
|
333
321
|
off<K extends keyof EventMap & string>(type: K, handler: Listener<EventMap[K]>): void;
|
|
334
|
-
/**
|
|
335
|
-
* Remove all listeners for all event types.
|
|
336
|
-
*/
|
|
337
322
|
removeAllListeners(): void;
|
|
338
323
|
}
|
|
339
324
|
|
|
325
|
+
type UnwrappedEvent = {
|
|
326
|
+
type: string;
|
|
327
|
+
payload: unknown;
|
|
328
|
+
};
|
|
329
|
+
declare function unwrapSystemEvent(event: AomiSystemEvent): UnwrappedEvent | null;
|
|
330
|
+
|
|
331
|
+
type AAProvider = "alchemy" | "pimlico";
|
|
332
|
+
type AAMode = "4337" | "7702";
|
|
333
|
+
type AASponsorship = "disabled" | "optional" | "required";
|
|
334
|
+
type AAWalletCall = {
|
|
335
|
+
to: Hex;
|
|
336
|
+
value: bigint;
|
|
337
|
+
data?: Hex;
|
|
338
|
+
chainId: number;
|
|
339
|
+
};
|
|
340
|
+
type WalletAtomicCapability = {
|
|
341
|
+
atomic?: {
|
|
342
|
+
status?: string;
|
|
343
|
+
};
|
|
344
|
+
};
|
|
345
|
+
interface AAChainConfig {
|
|
346
|
+
chainId: number;
|
|
347
|
+
enabled: boolean;
|
|
348
|
+
defaultMode: AAMode;
|
|
349
|
+
supportedModes: AAMode[];
|
|
350
|
+
allowBatching: boolean;
|
|
351
|
+
sponsorship: AASponsorship;
|
|
352
|
+
}
|
|
353
|
+
interface AAConfig {
|
|
354
|
+
enabled: boolean;
|
|
355
|
+
provider: AAProvider;
|
|
356
|
+
fallbackToEoa: boolean;
|
|
357
|
+
chains: AAChainConfig[];
|
|
358
|
+
}
|
|
359
|
+
interface AAResolvedConfig {
|
|
360
|
+
provider: AAProvider;
|
|
361
|
+
chainId: number;
|
|
362
|
+
mode: AAMode;
|
|
363
|
+
batchingEnabled: boolean;
|
|
364
|
+
sponsorship: AASponsorship;
|
|
365
|
+
fallbackToEoa: boolean;
|
|
366
|
+
}
|
|
367
|
+
/** The subset of AAWalletCall passed to smart account send methods (chainId already resolved). */
|
|
368
|
+
type AACallPayload = Omit<AAWalletCall, "chainId">;
|
|
369
|
+
interface SmartAccount {
|
|
370
|
+
provider: string;
|
|
371
|
+
mode: string;
|
|
372
|
+
AAAddress?: Hex;
|
|
373
|
+
delegationAddress?: Hex;
|
|
374
|
+
sendTransaction: (call: AACallPayload) => Promise<{
|
|
375
|
+
transactionHash: string;
|
|
376
|
+
}>;
|
|
377
|
+
sendBatchTransaction: (calls: AACallPayload[]) => Promise<{
|
|
378
|
+
transactionHash: string;
|
|
379
|
+
}>;
|
|
380
|
+
}
|
|
381
|
+
interface AAState<TAccount extends SmartAccount = SmartAccount> {
|
|
382
|
+
resolved: AAResolvedConfig | null;
|
|
383
|
+
account?: TAccount | null;
|
|
384
|
+
pending: boolean;
|
|
385
|
+
error: Error | null;
|
|
386
|
+
}
|
|
387
|
+
interface ExecutionResult {
|
|
388
|
+
txHash: string;
|
|
389
|
+
txHashes: string[];
|
|
390
|
+
executionKind: string;
|
|
391
|
+
batched: boolean;
|
|
392
|
+
sponsored: boolean;
|
|
393
|
+
AAAddress?: Hex;
|
|
394
|
+
delegationAddress?: Hex;
|
|
395
|
+
}
|
|
396
|
+
interface AtomicBatchArgs {
|
|
397
|
+
calls: AACallPayload[];
|
|
398
|
+
capabilities?: {
|
|
399
|
+
atomic?: {
|
|
400
|
+
required?: boolean;
|
|
401
|
+
};
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
interface ExecuteWalletCallsParams<TAccount extends SmartAccount = SmartAccount> {
|
|
405
|
+
callList: AAWalletCall[];
|
|
406
|
+
currentChainId: number;
|
|
407
|
+
capabilities: Record<string, WalletAtomicCapability> | undefined;
|
|
408
|
+
localPrivateKey: `0x${string}` | null;
|
|
409
|
+
providerState: AAState<TAccount>;
|
|
410
|
+
sendCallsSyncAsync: (args: AtomicBatchArgs) => Promise<unknown>;
|
|
411
|
+
sendTransactionAsync: (args: {
|
|
412
|
+
chainId: number;
|
|
413
|
+
to: Hex;
|
|
414
|
+
value: bigint;
|
|
415
|
+
data?: Hex;
|
|
416
|
+
}) => Promise<string>;
|
|
417
|
+
switchChainAsync: (params: {
|
|
418
|
+
chainId: number;
|
|
419
|
+
}) => Promise<unknown>;
|
|
420
|
+
chainsById: Record<number, Chain>;
|
|
421
|
+
getPreferredRpcUrl: (chain: Chain) => string;
|
|
422
|
+
}
|
|
423
|
+
declare function getAAChainConfig(config: AAConfig, calls: AAWalletCall[], chainsById: Record<number, Chain>): AAChainConfig | null;
|
|
424
|
+
declare function buildAAExecutionPlan(config: AAConfig, chainConfig: AAChainConfig): AAResolvedConfig;
|
|
425
|
+
declare function getWalletExecutorReady(providerState: AAState): boolean;
|
|
426
|
+
declare const DEFAULT_AA_CONFIG: AAConfig;
|
|
427
|
+
|
|
340
428
|
type WalletTxPayload = {
|
|
341
429
|
to: string;
|
|
342
430
|
value?: string;
|
|
@@ -375,6 +463,11 @@ declare function normalizeTxPayload(payload: unknown): WalletTxPayload | null;
|
|
|
375
463
|
* Normalize an EIP-712 signing request payload.
|
|
376
464
|
*/
|
|
377
465
|
declare function normalizeEip712Payload(payload: unknown): WalletEip712Payload;
|
|
466
|
+
/**
|
|
467
|
+
* Convert a normalized WalletTxPayload into an AAWalletCall.
|
|
468
|
+
* This is the single boundary conversion point from backend payloads to AA-ready calls.
|
|
469
|
+
*/
|
|
470
|
+
declare function toAAWalletCall(payload: WalletTxPayload, defaultChainId?: number): AAWalletCall;
|
|
378
471
|
/**
|
|
379
472
|
* Convert normalized EIP-712 payloads into the viem signing shape used by both
|
|
380
473
|
* the CLI and widget component layers.
|
|
@@ -536,8 +629,20 @@ declare class ClientSession extends TypedEventEmitter<SessionEventMap> {
|
|
|
536
629
|
removeExtValue(key: string): void;
|
|
537
630
|
resolveWallet(address: string, chainId?: number): void;
|
|
538
631
|
syncUserState(): Promise<AomiStateResponse>;
|
|
539
|
-
|
|
540
|
-
|
|
632
|
+
/** Whether the session is currently polling for state updates. */
|
|
633
|
+
getIsPolling(): boolean;
|
|
634
|
+
/**
|
|
635
|
+
* Fetch the current state from the backend (one-shot).
|
|
636
|
+
* Automatically starts polling if the backend is processing.
|
|
637
|
+
*/
|
|
638
|
+
fetchCurrentState(): Promise<void>;
|
|
639
|
+
/**
|
|
640
|
+
* Start polling for state updates. Idempotent — no-op if already polling.
|
|
641
|
+
* Useful for resuming polling after resolving a wallet request.
|
|
642
|
+
*/
|
|
643
|
+
startPolling(): void;
|
|
644
|
+
/** Stop polling for state updates. Idempotent — no-op if not polling. */
|
|
645
|
+
stopPolling(): void;
|
|
541
646
|
private pollTick;
|
|
542
647
|
private applyState;
|
|
543
648
|
private dispatchSystemEvents;
|
|
@@ -550,127 +655,7 @@ declare class ClientSession extends TypedEventEmitter<SessionEventMap> {
|
|
|
550
655
|
private assertUserStateAligned;
|
|
551
656
|
}
|
|
552
657
|
|
|
553
|
-
|
|
554
|
-
type: string;
|
|
555
|
-
payload: unknown;
|
|
556
|
-
};
|
|
557
|
-
/**
|
|
558
|
-
* Unwrap a tagged-enum AomiSystemEvent from the backend into a flat event.
|
|
559
|
-
*
|
|
560
|
-
* ```ts
|
|
561
|
-
* const event: AomiSystemEvent = { InlineCall: { type: "wallet_tx_request", payload: { to: "0x..." } } };
|
|
562
|
-
* const unwrapped = unwrapSystemEvent(event);
|
|
563
|
-
* // => { type: "wallet_tx_request", payload: { to: "0x..." } }
|
|
564
|
-
* ```
|
|
565
|
-
*/
|
|
566
|
-
declare function unwrapSystemEvent(event: AomiSystemEvent): UnwrappedEvent | null;
|
|
567
|
-
|
|
568
|
-
type AAExecutionMode = "4337" | "7702";
|
|
569
|
-
type AASponsorshipMode = "disabled" | "optional" | "required";
|
|
570
|
-
type WalletExecutionCall = {
|
|
571
|
-
to: string;
|
|
572
|
-
value: string;
|
|
573
|
-
data?: string;
|
|
574
|
-
chainId: number;
|
|
575
|
-
};
|
|
576
|
-
type WalletAtomicCapability = {
|
|
577
|
-
atomic?: {
|
|
578
|
-
status?: string;
|
|
579
|
-
};
|
|
580
|
-
};
|
|
581
|
-
type WalletPrimitiveCall = {
|
|
582
|
-
to: Hex;
|
|
583
|
-
value: bigint;
|
|
584
|
-
data?: Hex;
|
|
585
|
-
};
|
|
586
|
-
interface AAChainConfig {
|
|
587
|
-
chainId: number;
|
|
588
|
-
enabled: boolean;
|
|
589
|
-
defaultMode: AAExecutionMode;
|
|
590
|
-
supportedModes: AAExecutionMode[];
|
|
591
|
-
allowBatching: boolean;
|
|
592
|
-
sponsorship: AASponsorshipMode;
|
|
593
|
-
}
|
|
594
|
-
interface AAConfig {
|
|
595
|
-
enabled: boolean;
|
|
596
|
-
provider: string;
|
|
597
|
-
fallbackToEoa: boolean;
|
|
598
|
-
chains: AAChainConfig[];
|
|
599
|
-
}
|
|
600
|
-
interface AAExecutionPlan {
|
|
601
|
-
provider: string;
|
|
602
|
-
chainId: number;
|
|
603
|
-
mode: AAExecutionMode;
|
|
604
|
-
batchingEnabled: boolean;
|
|
605
|
-
sponsorship: AASponsorshipMode;
|
|
606
|
-
fallbackToEoa: boolean;
|
|
607
|
-
}
|
|
608
|
-
interface AALike {
|
|
609
|
-
provider: string;
|
|
610
|
-
mode: string;
|
|
611
|
-
AAAddress?: Hex;
|
|
612
|
-
delegationAddress?: Hex;
|
|
613
|
-
sendTransaction: (call: WalletPrimitiveCall) => Promise<{
|
|
614
|
-
transactionHash: string;
|
|
615
|
-
}>;
|
|
616
|
-
sendBatchTransaction: (calls: WalletPrimitiveCall[]) => Promise<{
|
|
617
|
-
transactionHash: string;
|
|
618
|
-
}>;
|
|
619
|
-
}
|
|
620
|
-
interface AAProviderQuery<TAA extends AALike = AALike> {
|
|
621
|
-
AA?: TAA | null;
|
|
622
|
-
isPending?: boolean;
|
|
623
|
-
error?: Error | null;
|
|
624
|
-
}
|
|
625
|
-
interface AAProviderState<TAA extends AALike = AALike> {
|
|
626
|
-
plan: AAExecutionPlan | null;
|
|
627
|
-
AA?: TAA | null;
|
|
628
|
-
isPending: boolean;
|
|
629
|
-
error: Error | null;
|
|
630
|
-
query?: AAProviderQuery<TAA>;
|
|
631
|
-
}
|
|
632
|
-
interface TransactionExecutionResult {
|
|
633
|
-
txHash: string;
|
|
634
|
-
txHashes: string[];
|
|
635
|
-
executionKind: string;
|
|
636
|
-
batched: boolean;
|
|
637
|
-
sponsored: boolean;
|
|
638
|
-
AAAddress?: Hex;
|
|
639
|
-
delegationAddress?: Hex;
|
|
640
|
-
}
|
|
641
|
-
interface SendCallsSyncArgs {
|
|
642
|
-
calls: WalletPrimitiveCall[];
|
|
643
|
-
capabilities?: {
|
|
644
|
-
atomic?: {
|
|
645
|
-
required?: boolean;
|
|
646
|
-
};
|
|
647
|
-
};
|
|
648
|
-
}
|
|
649
|
-
interface ExecuteWalletCallsParams<TAA extends AALike = AALike> {
|
|
650
|
-
callList: WalletExecutionCall[];
|
|
651
|
-
currentChainId: number;
|
|
652
|
-
capabilities: Record<string, WalletAtomicCapability> | undefined;
|
|
653
|
-
localPrivateKey: `0x${string}` | null;
|
|
654
|
-
providerState: AAProviderState<TAA>;
|
|
655
|
-
sendCallsSyncAsync: (args: SendCallsSyncArgs) => Promise<unknown>;
|
|
656
|
-
sendTransactionAsync: (args: {
|
|
657
|
-
chainId: number;
|
|
658
|
-
to: Hex;
|
|
659
|
-
value: bigint;
|
|
660
|
-
data?: Hex;
|
|
661
|
-
}) => Promise<string>;
|
|
662
|
-
switchChainAsync: (params: {
|
|
663
|
-
chainId: number;
|
|
664
|
-
}) => Promise<unknown>;
|
|
665
|
-
chainsById: Record<number, Chain>;
|
|
666
|
-
getPreferredRpcUrl: (chain: Chain) => string;
|
|
667
|
-
}
|
|
668
|
-
declare function parseAAConfig(value: unknown): AAConfig;
|
|
669
|
-
declare function getAAChainConfig(config: AAConfig, calls: WalletExecutionCall[], chainsById: Record<number, Chain>): AAChainConfig | null;
|
|
670
|
-
declare function buildAAExecutionPlan(config: AAConfig, chainConfig: AAChainConfig): AAExecutionPlan;
|
|
671
|
-
declare function getWalletExecutorReady(providerState: AAProviderState): boolean;
|
|
672
|
-
declare const DEFAULT_AA_CONFIG: AAConfig;
|
|
673
|
-
declare function executeWalletCalls(params: ExecuteWalletCallsParams): Promise<TransactionExecutionResult>;
|
|
658
|
+
declare function executeWalletCalls(params: ExecuteWalletCallsParams): Promise<ExecutionResult>;
|
|
674
659
|
|
|
675
660
|
interface AlchemyHookParams {
|
|
676
661
|
enabled: boolean;
|
|
@@ -678,158 +663,113 @@ interface AlchemyHookParams {
|
|
|
678
663
|
chain: Chain;
|
|
679
664
|
rpcUrl: string;
|
|
680
665
|
gasPolicyId?: string;
|
|
681
|
-
mode:
|
|
666
|
+
mode: AAMode;
|
|
682
667
|
}
|
|
683
|
-
type
|
|
684
|
-
|
|
668
|
+
type AlchemyHookState<TAccount extends SmartAccount = SmartAccount> = {
|
|
669
|
+
account?: TAccount | null;
|
|
670
|
+
pending?: boolean;
|
|
671
|
+
error?: Error | null;
|
|
672
|
+
};
|
|
673
|
+
type UseAlchemyAAHook<TAccount extends SmartAccount = SmartAccount> = (params?: AlchemyHookParams) => AlchemyHookState<TAccount>;
|
|
674
|
+
interface CreateAlchemyAAProviderOptions<TAccount extends SmartAccount = SmartAccount> {
|
|
685
675
|
accountAbstractionConfig?: AAConfig;
|
|
686
|
-
useAlchemyAA: UseAlchemyAAHook<
|
|
676
|
+
useAlchemyAA: UseAlchemyAAHook<TAccount>;
|
|
687
677
|
chainsById: Record<number, Chain>;
|
|
688
678
|
chainSlugById: Record<number, string>;
|
|
689
679
|
getPreferredRpcUrl: (chain: Chain) => string;
|
|
690
680
|
apiKeyEnvVar?: string;
|
|
691
681
|
gasPolicyEnvVar?: string;
|
|
692
682
|
}
|
|
693
|
-
declare function createAlchemyAAProvider<
|
|
683
|
+
declare function createAlchemyAAProvider<TAccount extends SmartAccount = SmartAccount>({ accountAbstractionConfig, useAlchemyAA, chainsById, chainSlugById, getPreferredRpcUrl, }: CreateAlchemyAAProviderOptions<TAccount>): (calls: AAWalletCall[] | null, localPrivateKey: `0x${string}` | null) => AAState<TAccount>;
|
|
684
|
+
|
|
685
|
+
type AAOwner = {
|
|
686
|
+
kind: "direct";
|
|
687
|
+
privateKey: `0x${string}`;
|
|
688
|
+
} | {
|
|
689
|
+
kind: "session";
|
|
690
|
+
adapter: string;
|
|
691
|
+
session: unknown;
|
|
692
|
+
signer?: unknown;
|
|
693
|
+
address?: Hex;
|
|
694
|
+
};
|
|
695
|
+
|
|
696
|
+
interface PimlicoResolveOptions {
|
|
697
|
+
calls: AAWalletCall[] | null;
|
|
698
|
+
localPrivateKey?: `0x${string}` | null;
|
|
699
|
+
accountAbstractionConfig?: AAConfig;
|
|
700
|
+
chainsById: Record<number, Chain>;
|
|
701
|
+
rpcUrl?: string;
|
|
702
|
+
modeOverride?: AAMode;
|
|
703
|
+
publicOnly?: boolean;
|
|
704
|
+
throwOnMissingConfig?: boolean;
|
|
705
|
+
apiKey?: string;
|
|
706
|
+
}
|
|
707
|
+
interface PimlicoResolvedConfig extends AAResolvedConfig {
|
|
708
|
+
apiKey: string;
|
|
709
|
+
chain: Chain;
|
|
710
|
+
rpcUrl?: string;
|
|
711
|
+
}
|
|
712
|
+
declare function resolvePimlicoConfig(options: PimlicoResolveOptions): PimlicoResolvedConfig | null;
|
|
694
713
|
|
|
695
714
|
interface PimlicoHookParams {
|
|
696
715
|
enabled: boolean;
|
|
697
716
|
apiKey: string;
|
|
698
717
|
chain: Chain;
|
|
699
|
-
mode:
|
|
718
|
+
mode: AAMode;
|
|
700
719
|
rpcUrl?: string;
|
|
701
720
|
}
|
|
702
|
-
type
|
|
703
|
-
|
|
721
|
+
type PimlicoHookState<TAccount extends SmartAccount = SmartAccount> = {
|
|
722
|
+
account?: TAccount | null;
|
|
723
|
+
pending?: boolean;
|
|
724
|
+
error?: Error | null;
|
|
725
|
+
};
|
|
726
|
+
type UsePimlicoAAHook<TAccount extends SmartAccount = SmartAccount> = (params?: PimlicoHookParams) => PimlicoHookState<TAccount>;
|
|
727
|
+
interface CreatePimlicoAAProviderOptions<TAccount extends SmartAccount = SmartAccount> {
|
|
704
728
|
accountAbstractionConfig?: AAConfig;
|
|
705
|
-
usePimlicoAA: UsePimlicoAAHook<
|
|
729
|
+
usePimlicoAA: UsePimlicoAAHook<TAccount>;
|
|
706
730
|
chainsById: Record<number, Chain>;
|
|
707
731
|
apiKeyEnvVar?: string;
|
|
708
732
|
rpcUrl?: string;
|
|
709
733
|
}
|
|
710
|
-
declare function createPimlicoAAProvider<
|
|
711
|
-
|
|
712
|
-
/**
|
|
713
|
-
* Reads the first non-empty env var from `candidates`.
|
|
714
|
-
* When `publicOnly` is true, only `NEXT_PUBLIC_*` names are considered.
|
|
715
|
-
*/
|
|
716
|
-
declare function readEnv(candidates: readonly string[], options?: {
|
|
717
|
-
publicOnly?: boolean;
|
|
718
|
-
}): string | undefined;
|
|
719
|
-
type AAProvider = "alchemy" | "pimlico";
|
|
720
|
-
/**
|
|
721
|
-
* Returns true if the given provider has a configured API key.
|
|
722
|
-
*/
|
|
723
|
-
declare function isProviderConfigured(provider: AAProvider, options?: {
|
|
724
|
-
publicOnly?: boolean;
|
|
725
|
-
}): boolean;
|
|
726
|
-
/**
|
|
727
|
-
* Picks the first configured provider (alchemy > pimlico).
|
|
728
|
-
* Throws if neither is configured.
|
|
729
|
-
*/
|
|
730
|
-
declare function resolveDefaultProvider(options?: {
|
|
731
|
-
publicOnly?: boolean;
|
|
732
|
-
}): AAProvider;
|
|
734
|
+
declare function createPimlicoAAProvider<TAccount extends SmartAccount = SmartAccount>({ accountAbstractionConfig, usePimlicoAA, chainsById, rpcUrl, }: CreatePimlicoAAProviderOptions<TAccount>): (calls: AAWalletCall[] | null, localPrivateKey: `0x${string}` | null) => AAState<TAccount>;
|
|
733
735
|
|
|
734
|
-
type
|
|
736
|
+
type SdkSmartAccount = {
|
|
735
737
|
provider: string;
|
|
736
|
-
mode:
|
|
738
|
+
mode: AAMode;
|
|
737
739
|
smartAccountAddress: Hex;
|
|
738
740
|
delegationAddress?: Hex;
|
|
739
|
-
sendTransaction: (call:
|
|
740
|
-
sendBatchTransaction: (calls:
|
|
741
|
+
sendTransaction: (call: AACallPayload, options?: unknown) => Promise<TransactionReceipt>;
|
|
742
|
+
sendBatchTransaction: (calls: AACallPayload[], options?: unknown) => Promise<TransactionReceipt>;
|
|
741
743
|
};
|
|
742
744
|
/**
|
|
743
|
-
* Bridges
|
|
744
|
-
*
|
|
745
|
+
* Bridges the provider SDK smart-account shape into the library's
|
|
746
|
+
* SmartAccount interface:
|
|
745
747
|
* - Maps `smartAccountAddress` → `AAAddress`
|
|
746
748
|
* - Unwraps `TransactionReceipt` → `{ transactionHash }`
|
|
747
749
|
*/
|
|
748
|
-
declare function adaptSmartAccount(account:
|
|
750
|
+
declare function adaptSmartAccount(account: SdkSmartAccount): SmartAccount;
|
|
749
751
|
/**
|
|
750
752
|
* Detects Alchemy gas sponsorship quota errors.
|
|
751
753
|
*/
|
|
752
754
|
declare function isAlchemySponsorshipLimitError(error: unknown): boolean;
|
|
753
755
|
|
|
754
|
-
interface
|
|
755
|
-
calls: WalletExecutionCall[] | null;
|
|
756
|
-
localPrivateKey?: `0x${string}` | null;
|
|
757
|
-
accountAbstractionConfig?: AAConfig;
|
|
758
|
-
chainsById: Record<number, Chain>;
|
|
759
|
-
chainSlugById?: Record<number, string>;
|
|
760
|
-
getPreferredRpcUrl?: (chain: Chain) => string;
|
|
761
|
-
modeOverride?: AAExecutionMode;
|
|
762
|
-
publicOnly?: boolean;
|
|
763
|
-
throwOnMissingConfig?: boolean;
|
|
764
|
-
/**
|
|
765
|
-
* Pre-resolved API key. Use this in Next.js client-side code where
|
|
766
|
-
* dynamic `process.env[name]` access doesn't work.
|
|
767
|
-
*/
|
|
768
|
-
apiKey?: string;
|
|
769
|
-
gasPolicyId?: string;
|
|
770
|
-
}
|
|
771
|
-
interface AlchemyResolvedConfig {
|
|
772
|
-
chainConfig: AAChainConfig;
|
|
773
|
-
plan: AAExecutionPlan;
|
|
774
|
-
apiKey: string;
|
|
775
|
-
chain: Chain;
|
|
776
|
-
rpcUrl: string;
|
|
777
|
-
gasPolicyId?: string;
|
|
778
|
-
mode: AAExecutionMode;
|
|
779
|
-
}
|
|
780
|
-
declare function resolveAlchemyConfig(options: AlchemyResolveOptions): AlchemyResolvedConfig | null;
|
|
781
|
-
interface PimlicoResolveOptions {
|
|
782
|
-
calls: WalletExecutionCall[] | null;
|
|
783
|
-
localPrivateKey?: `0x${string}` | null;
|
|
784
|
-
accountAbstractionConfig?: AAConfig;
|
|
785
|
-
chainsById: Record<number, Chain>;
|
|
786
|
-
rpcUrl?: string;
|
|
787
|
-
modeOverride?: AAExecutionMode;
|
|
788
|
-
publicOnly?: boolean;
|
|
789
|
-
throwOnMissingConfig?: boolean;
|
|
790
|
-
/**
|
|
791
|
-
* Pre-resolved API key. Use this in Next.js client-side code where
|
|
792
|
-
* dynamic `process.env[name]` access doesn't work.
|
|
793
|
-
*/
|
|
794
|
-
apiKey?: string;
|
|
795
|
-
}
|
|
796
|
-
interface PimlicoResolvedConfig {
|
|
797
|
-
chainConfig: AAChainConfig;
|
|
798
|
-
plan: AAExecutionPlan;
|
|
799
|
-
apiKey: string;
|
|
800
|
-
chain: Chain;
|
|
801
|
-
rpcUrl?: string;
|
|
802
|
-
mode: AAExecutionMode;
|
|
803
|
-
}
|
|
804
|
-
declare function resolvePimlicoConfig(options: PimlicoResolveOptions): PimlicoResolvedConfig | null;
|
|
805
|
-
|
|
806
|
-
type CreateAAOwner = {
|
|
807
|
-
kind: "direct";
|
|
808
|
-
privateKey: `0x${string}`;
|
|
809
|
-
} | {
|
|
810
|
-
kind: "session";
|
|
811
|
-
adapter: string;
|
|
812
|
-
session: unknown;
|
|
813
|
-
signer?: unknown;
|
|
814
|
-
address?: Hex;
|
|
815
|
-
};
|
|
816
|
-
interface CreateAAProviderStateOptions {
|
|
756
|
+
interface CreateAAStateOptions {
|
|
817
757
|
provider: AAProvider;
|
|
818
758
|
chain: Chain;
|
|
819
|
-
owner:
|
|
759
|
+
owner: AAOwner;
|
|
820
760
|
rpcUrl: string;
|
|
821
|
-
callList:
|
|
822
|
-
mode?:
|
|
761
|
+
callList: AAWalletCall[];
|
|
762
|
+
mode?: AAMode;
|
|
823
763
|
apiKey?: string;
|
|
824
764
|
gasPolicyId?: string;
|
|
825
765
|
sponsored?: boolean;
|
|
766
|
+
/** Backend proxy base URL for Alchemy. Used when apiKey is omitted. */
|
|
767
|
+
proxyBaseUrl?: string;
|
|
826
768
|
}
|
|
827
769
|
/**
|
|
828
|
-
* Creates an
|
|
829
|
-
*
|
|
830
|
-
*
|
|
831
|
-
* This is the single entry-point for async (non-hook) AA provider state creation.
|
|
770
|
+
* Creates an AA state by instantiating the appropriate smart account via
|
|
771
|
+
* `@getpara/aa-alchemy` or `@getpara/aa-pimlico`.
|
|
832
772
|
*/
|
|
833
|
-
declare function createAAProviderState(options:
|
|
773
|
+
declare function createAAProviderState(options: CreateAAStateOptions): Promise<AAState>;
|
|
834
774
|
|
|
835
|
-
export { type
|
|
775
|
+
export { type AACallPayload, type AAChainConfig, type AAConfig, type AAMode, type AAOwner, type AAProvider, type AAResolvedConfig, type AASponsorship, type AAState, type AAWalletCall, type AlchemyHookParams, type AomiChatResponse, type AomiClearSecretsResponse, AomiClient, type AomiClientOptions, type AomiClientType, type AomiCreateThreadResponse, type AomiIngestSecretsResponse, type AomiInterruptResponse, type AomiMessage, type AomiSSEEvent, type AomiSSEEventType, type AomiSimulateFee, type AomiSimulateResponse, type AomiStateResponse, type AomiSystemEvent, type AomiSystemResponse, type AomiThread, type AtomicBatchArgs, CLIENT_TYPE_TS_CLI, CLIENT_TYPE_WEB_UI, type CreateAAStateOptions, type CreateAlchemyAAProviderOptions, type CreatePimlicoAAProviderOptions, DEFAULT_AA_CONFIG, type ExecuteWalletCallsParams, type ExecutionResult, type Logger, type PimlicoHookParams, type PimlicoResolveOptions, type PimlicoResolvedConfig, type SendResult, ClientSession as Session, type SessionEventMap, type SessionOptions, type SmartAccount, TypedEventEmitter, type UnwrappedEvent, type UseAlchemyAAHook, type UsePimlicoAAHook, type UserState, type ViemSignTypedDataArgs, type WalletAtomicCapability, type WalletEip712Payload, type WalletRequest, type WalletRequestKind, type WalletRequestResult, type WalletTxPayload, adaptSmartAccount, addUserStateExt, buildAAExecutionPlan, createAAProviderState, createAlchemyAAProvider, createPimlicoAAProvider, executeWalletCalls, getAAChainConfig, getWalletExecutorReady, isAlchemySponsorshipLimitError, isAsyncCallback, isInlineCall, isSystemError, isSystemNotice, normalizeEip712Payload, normalizeTxPayload, resolvePimlicoConfig, toAAWalletCall, toViemSignTypedDataArgs, unwrapSystemEvent };
|