abstractionkit
Version:
Account Abstraction 4337 SDK by Candidelabs
193 lines • 5.42 kB
TypeScript
export interface BaseUserOperation {
sender: string;
nonce: bigint;
callData: string;
callGasLimit: bigint;
verificationGasLimit: bigint;
preVerificationGas: bigint;
maxFeePerGas: bigint;
maxPriorityFeePerGas: bigint;
signature: string;
}
export interface UserOperationV6 extends BaseUserOperation {
initCode: string;
paymasterAndData: string;
}
export interface UserOperationV7 extends BaseUserOperation {
factory: string | null;
factoryData: string | null;
paymaster: string | null;
paymasterVerificationGasLimit: bigint | null;
paymasterPostOpGasLimit: bigint | null;
paymasterData: string | null;
}
export type AbiInputValue = string | bigint | number | boolean | AbiInputValue[];
export type JsonRpcParam = string | bigint | boolean | object | JsonRpcParam[];
export type JsonRpcResponse = {
id: number | null;
jsonrpc: string;
result?: JsonRpcResult;
error?: JsonRpcError;
};
export type ChainIdResult = string;
export type SupportedEntryPointsResult = string[];
export type JsonRpcResult = ChainIdResult | SupportedEntryPointsResult | GasEstimationResult | UserOperationByHashResult | UserOperationReceipt | UserOperationReceiptResult | SupportedERC20TokensAndMetadataV7 | SupportedERC20TokensAndMetadataV6 | PmUserOperationV7Result | PmUserOperationV6Result;
export type JsonRpcError = {
code: number;
message: string;
data: object;
};
export type GasEstimationResult = {
callGasLimit: bigint;
preVerificationGas: bigint;
verificationGasLimit: bigint;
};
export type UserOperationByHashResult = {
userOperation: UserOperationV6 | UserOperationV7;
entryPoint: string;
blockNumber: bigint | null;
blockHash: string | null;
transactionHash: string | null;
} | null;
export type UserOperationReceipt = {
blockHash: string;
blockNumber: bigint;
from: string;
cumulativeGasUsed: bigint;
gasUsed: bigint;
logs: string;
logsBloom: string;
transactionHash: string;
transactionIndex: bigint;
effectiveGasPrice?: bigint;
};
export type UserOperationReceiptResult = {
userOpHash: string;
entryPoint: string;
sender: string;
nonce: bigint;
paymaster: string;
actualGasCost: bigint;
actualGasUsed: bigint;
success: boolean;
logs: string;
receipt: UserOperationReceipt;
} | null;
export type SponsorMetadata = {
name: string;
description: string;
url: string;
icons: string[];
};
export type PmUserOperationV7Result = {
paymaster: string;
paymasterVerificationGasLimit: bigint;
paymasterPostOpGasLimit: bigint;
paymasterData: string;
callGasLimit?: bigint;
verificationGasLimit?: bigint;
preVerificationGas?: bigint;
maxFeePerGas?: bigint;
maxPriorityFeePerGas?: bigint;
sponsorMetadata?: SponsorMetadata;
};
export type PmUserOperationV6Result = {
paymasterAndData: string;
callGasLimit?: bigint;
preVerificationGas?: bigint;
verificationGasLimit?: bigint;
maxFeePerGas?: bigint;
maxPriorityFeePerGas?: bigint;
sponsorMetadata?: SponsorMetadata;
};
export declare enum Operation {
Call = 0,
Delegate = 1
}
export interface MetaTransaction {
to: string;
value: bigint;
data: string;
operation?: Operation;
}
export interface ERC20Token {
name: string;
symbol: string;
address: string;
decimals: number;
}
export interface ERC20TokenWithExchangeRate extends ERC20Token {
exchangeRate: bigint;
}
interface BasePaymasterMetadata {
name: string;
description: string;
icons: string[];
address: string;
sponsoredEventTopic: string;
}
export interface PaymasterMetadataV7 extends BasePaymasterMetadata {
dummyPaymasterAndData: {
paymaster: string;
paymasterVerificationGasLimit: bigint;
paymasterPostOpGasLimit: bigint;
paymasterData: string;
};
}
export interface PaymasterMetadataV6 extends BasePaymasterMetadata {
dummyPaymasterAndData: string;
}
export interface SupportedERC20TokensAndMetadataV7 {
paymasterMetadata: PaymasterMetadataV7;
tokens: ERC20Token[];
}
export interface SupportedERC20TokensAndMetadataV6 {
paymasterMetadata: PaymasterMetadataV6;
tokens: ERC20Token[];
}
export interface SupportedERC20TokensAndMetadataV7WithExchangeRate {
paymasterMetadata: PaymasterMetadataV7;
tokens: ERC20TokenWithExchangeRate[];
}
export interface SupportedERC20TokensAndMetadataV6WithExchangeRate {
paymasterMetadata: PaymasterMetadataV6;
tokens: ERC20TokenWithExchangeRate[];
}
export interface Dictionary<T> {
[Key: string]: T;
}
export type AddressToState = {
balance?: bigint;
nonce?: bigint;
code?: string;
state?: Dictionary<string>;
stateDiff?: Dictionary<string>;
};
export type StateOverrideSet = {
[key: string]: AddressToState;
};
export declare enum GasOption {
Slow = 1,
Medium = 1.2,
Fast = 1.5
}
export declare enum PolygonChain {
Mainnet = "v2",
ZkMainnet = "zkevm",
Amoy = "amoy",
Cardona = "cardona"
}
export type GasPrice = {
maxPriorityFee: number;
maxFee: number;
};
export type PolygonGasStationJsonRpcResponse = {
safeLow: GasPrice;
standard: GasPrice;
fast: GasPrice;
estimatedBaseFee: string;
blockTime: number;
blockNumber: number;
};
export {};
//# sourceMappingURL=types.d.ts.map