@abstract-foundation/agw-client
Version:
Abstract Global Wallet Client SDK
56 lines • 1.67 kB
TypeScript
import type { Address, Hex, RpcTransactionReceipt } from 'viem';
declare enum CallStatus {
Pending = 100,
Confirmed = 200,
OffchainFailure = 400,
Reverted = 500,
PartiallyReverted = 600
}
interface PaymasterServiceCapability {
url: string;
}
interface AtomicCapabilityV1 {
supported: boolean;
}
interface AtomicCapabilityV2 {
status: 'supported' | 'ready' | 'unsupported';
}
interface ChainCapabilitiesV1 {
paymasterService?: PaymasterServiceCapability;
atomicBatch?: AtomicCapabilityV1;
}
interface ChainCapabilitiesV2 {
paymasterService?: PaymasterServiceCapability;
atomic?: AtomicCapabilityV2;
}
type WalletCapabilitiesV1 = Record<`0x${string}`, ChainCapabilitiesV1>;
export type WalletCapabilitiesV2 = Record<`0x${string}`, ChainCapabilitiesV2>;
export type SendCallsParams = SendCallsParamsV1 | SendCallsParamsV2;
export interface SendCallsParamsV1 {
version: '1.0';
from: Address;
calls: {
to?: Address | undefined;
data?: Hex | undefined;
value?: Hex | undefined;
chainId?: Hex | undefined;
}[];
capabilities?: WalletCapabilitiesV1 | undefined;
}
export interface SendCallsParamsV2 {
version: '2.0.0';
id: string;
from: Address;
chainId: Hex;
atomicRequired: boolean;
calls: {
to?: Address | undefined;
data?: Hex | undefined;
value?: Hex | undefined;
}[];
capabilities: Record<string, any>;
}
export declare const agwCapabilitiesV2: WalletCapabilitiesV2;
export declare function getReceiptStatus(receipt: RpcTransactionReceipt | undefined): CallStatus;
export {};
//# sourceMappingURL=eip5792.d.ts.map