import { ContractReceipt } from "ethers"; import { Bundle } from "./signer"; type TransactionFailure = { type: "invalid-format"; description: string; } | { type: "invalid-signature"; description: string; } | { type: "duplicate-nonce"; description: string; } | { type: "insufficient-reward"; description: string; } | { type: "unpredictable-gas-limit"; description: string; } | { type: "invalid-creation"; description: string; }; export type ActionDataDto = { ethValue: string; contractAddress: string; encodedFunction: string; }; export type OperationDto = { nonce: string; actions: ActionDataDto[]; }; export type BundleDto = { senderPublicKeys: [string, string, string, string][]; operations: OperationDto[]; signature: [string, string]; }; export type EstimateFeeResponse = { feeType: string; feeDetected: string; feeRequired: string; successes: boolean[]; }; export type BundleReceiptError = { submitError: string | undefined; }; /** * The BLS Wallet specific values in a {@link BundleReceipt}. */ export type BlsBundleReceipt = { bundleHash: string; }; /** * The bundle receipt returned from a BLS Wallet Aggregator instance. It is a combination of an ethers {@link ContractReceipt} and a {@link BlsBundleReceipt} type. */ export type BundleReceipt = ContractReceipt & BlsBundleReceipt; /** * Client used to interact with a BLS Wallet Aggregator instance */ export default class Aggregator { private readonly fetchImpl; origin: string; /** * Constructs an Aggregator object * * @param url URL of the aggregator instance */ constructor(url: string); /** * Sends a bundle to the aggregator * * @param bundle Bundle to send * @returns The hash of the bundle or an array of failures if the aggregator did not accept the bundle */ add(bundle: Bundle): Promise<{ hash: string; } | { failures: TransactionFailure[]; }>; /** * Estimates the fee required for a bundle by the aggreagtor to submit it. * * @param bundle Bundle to estimates the fee for * @returns Estimate of the fee needed to submit the bundle */ estimateFee(bundle: Bundle): Promise; /** * Looks for a transaction receipt for a Bundle sent to the aggregator. * This will return undefined if the bundle has not yet been submitted by the aggregator. * * @param hash Hash of the bundle to find a transaction receipt for. * @returns The bundle receipt, a submission error if the aggregator was unable to submit the bundle on chain, or undefined if the receipt was not found. */ lookupReceipt(hash: string): Promise; jsonPost(path: string, body: unknown): Promise; private jsonGet; } export {}; //# sourceMappingURL=Aggregator.d.ts.map