import { ethers } from 'ethers'; import type Proposal from '../../Proposal'; export interface SafeTransaction { safe: string; to: string; sender?: string; operation?: number; value?: string; data?: string; dataDecoded?: { method: string; parameters: Array<{ name: string; type: string; value: string; }>; }; nonce?: number; safeTxGas?: number; safeTxHash?: string; transactionHash?: string; baseGas?: number; confirmations?: Array; confirmationsRequired?: number; gasPrice?: string; gasToken?: string; executionDate?: string; submissionDate?: string; blockNumber?: number; isExecuted?: boolean; isSuccessful?: boolean; origin?: string; refundReceiver?: string; } export interface Confirmation { owner: string; submissionDate: string; transactionHash?: string; signature: string; signatureType: string; } export interface Safe { address: string; nonce: number; threshold: number; owners: string[]; masterCopy: string; modules: string[]; fallbackHandler: string; guard: string; version: string; isOrcaEnabled?: boolean; isPod?: boolean; hasToken?: boolean; } /** * Decodes transaction given an ABI and the data and parses it to match Gnosis's dataDecoded field * @param abi * @param data * @returns */ export declare function parseTransaction(abi: any, data: string): { method: string; parameters: Array<{ name: string; type: string; value: string; }>; }; /** * Populates the "dataDecoded" field of a transaction, if one does not exist. * @param transaction */ export declare function populateDataDecoded(safeTransaction: SafeTransaction): Promise; /** * Gets safe info from transaction service. * The Nonce we get from this call is the current nonce, i.e., the nonce of the active proposal. * * @param address - Address of the Safe. * @returns - Safe data. */ export declare function getSafeInfo(address: string): Promise; /** * Gets the gas estimation for a given transaction. * * @param transaction - Transaction object. * @returns - Gas */ export declare function getGasEstimation(transaction: SafeTransaction): Promise; /** * Get the safe transaction hash from the Gnosis Contract * * @param transaction - Transaction object that is missing a contractTransactionHash. * @returns - Safe transaction hash. */ export declare function getSafeTxHash(transaction: SafeTransaction): Promise; /** * Submits a new transaction to the transaction-service. * * @param {string} safeAddress - Address of Safe. * @param {Transaction} transaction - Transaction object received from populateTransaction. * @returns */ export declare function submitSafeTransactionToService(transaction: SafeTransaction): Promise; /** * Adds a confirmation/signature to an existing transaction (see submitTransactionToService). * * @param contractTransactionHash - ... * @param signedMessage - ... * @returns - Confirmed transaction. */ export declare function addConfirmationToSafeTransaction(contractTransactionHash: string, signedMessage: string): Promise; /** * Gets transactions for a safe. * * @param address - Address of the Safe. * @param [params] - Query params. * @returns - Array of transactions for the Safe. */ export declare function getSafeTransactionsBySafe(address: string, params?: Record): Promise; /** * Gets a transaction from the transaction service. * * @param contractTransactionHash * @returns - Safe transaction object. */ export declare function getSafeTransactionByHash(contractTransactionHash: string): Promise; /** * Approves transaction and submits approval to transaction-service * @param safeTransaction {SafeTransaction} * @param signer {ethers.Signer} */ export declare function approveSafeTransaction(safeTransaction: SafeTransaction, signer: ethers.Signer): Promise; /** * Creates a reject transaction on Gnosis * If provided a Signer, then this will auto-approve the tx. * @param safeTransaction * @param signerOrAddress - If provided a signer, it will approve. Address or signer must be safe owner. */ export declare function createRejectTransaction(safeTransaction: SafeTransaction, signerOrAddress: ethers.Signer | string): Promise; /** * Executes a transaction acquired from getSafeTransaction * @param safeTransaction * @returns */ export declare function executeSafeTransaction(safeTransaction: SafeTransaction, signer: ethers.Signer): Promise; /** * Executes a super proposal rejection * @param superProposalTxHash - Transaction hash of the original super proposal (not the reject super proposal) * @param subProposal - Proposal related to the superProposalTxHash * @param signer - Signer of sub proposal member */ export declare function executeRejectSuperProposal(superProposalTxHash: string, subProposal: Proposal, signer: ethers.Signer): Promise;