import { ethers, BigNumber } from "ethers"; import { Deferrable } from "ethers/lib/utils"; import { ActionData, PublicKey } from "./signer/types"; import Aggregator from "./Aggregator"; import BlsSigner, { TransactionBatchResponse, UncheckedBlsSigner } from "./BlsSigner"; /** Public key linked to actions parsed from a bundle */ export type PublicKeyLinkedToActions = { publicKey: PublicKey; actions: Array; }; export default class BlsProvider extends ethers.providers.JsonRpcProvider { readonly aggregator: Aggregator; readonly verificationGatewayAddress: string; readonly aggregatorUtilitiesAddress: string; /** * @param aggregatorUrl The url for an aggregator instance * @param verificationGatewayAddress Verification gateway contract address * @param aggregatorUtilitiesAddress Aggregator utilities contract address * @param url Rpc url * @param network The network the provider should connect to */ constructor(aggregatorUrl: string, verificationGatewayAddress: string, aggregatorUtilitiesAddress: string, url?: string, network?: ethers.providers.Networkish); /** * @param transaction Transaction request object * @returns An estimate of the amount of gas that would be required to submit the transaction to the network */ estimateGas(transaction: Deferrable): Promise; /** * Sends transaction to be executed. Adds the signed bundle to the aggregator * * @param signedTransaction A signed bundle * @returns A transaction response object that can be awaited to get the transaction receipt */ sendTransaction(signedTransaction: string | Promise): Promise; /** * @param signedTransactionBatch A signed {@link TransactionBatch} * @returns A transaction batch response object that can be awaited to get the transaction receipt */ sendTransactionBatch(signedTransactionBatch: string): Promise; /** * @param privateKey Private key for the account the signer represents * @param addressOrIndex (Not Used) address or index of the account, managed by the connected Ethereum node * @returns A new BlsSigner instance */ getSigner(privateKey: string, addressOrIndex?: string | number): BlsSigner; /** * @param privateKey Private key for the account the signer represents * @param addressOrIndex (Not Used) address or index of the account, managed by the connected Ethereum node * @returns A new UncheckedBlsSigner instance */ getUncheckedSigner(privateKey: string, addressOrIndex?: string): UncheckedBlsSigner; /** * Gets the transaction receipt associated with the transaction (bundle) hash * * @remarks The transaction hash argument corresponds to a bundle hash and cannot be used on a block explorer. * Instead, the transaction hash returned in the transaction receipt from this method can be used in a block explorer. * * @param transactionHash The transaction hash returned from the BlsProvider and BlsSigner sendTransaction methods. This is technically a bundle hash * @returns The transaction receipt that corressponds to the transaction hash (bundle hash) */ getTransactionReceipt(transactionHash: string | Promise): Promise; /** * Gets the transaction receipt associated with the transaction (bundle) hash * * @remarks The transaction hash argument cannot be used on a block explorer. It instead corresponds to a bundle hash. * The transaction hash returned in the transaction receipt from this method can be used in a block explorer. * * @param transactionHash The transaction hash returned from sending a transaction. This is technically a bundle hash * @param confirmations (Not used) the number of confirmations to wait for before returning the transaction receipt * @param retries The number of retries to poll the receipt for * @returns */ waitForTransaction(transactionHash: string, confirmations?: number, retries?: number): Promise; /** * @param address The address that the method gets the transaction count from * @param blockTag The specific block tag to get the transaction count from * @returns The number of transactions an account has sent */ getTransactionCount(address: string | Promise, blockTag?: ethers.providers.BlockTag | Promise | undefined): Promise; _getTransactionReceipt(transactionHash: string, confirmations: number, retries: number): Promise; _addFeePaymentActionForFeeEstimation(actions: Array): Array; _addFeePaymentActionWithSafeFee(actions: Array, fee: BigNumber): Array; _constructTransactionResponse(action: ActionData, publicKey: PublicKey, hash: string, nonce?: BigNumber): Promise; _constructTransactionBatchResponse(publicKeysLinkedToActions: Array, hash: string, nonce?: BigNumber): Promise; } //# sourceMappingURL=BlsProvider.d.ts.map