import { ContractTransaction, Provider, TransactionRequest, Log, Authorization } from 'ethers'; import { TransactionReceiptLog } from '../../../models/formatted-types'; import { ShieldRequestStruct } from '../../../abi/typechain/RailgunSmartWallet'; import { TransactionStructV2 } from '../../../models/transaction-types'; import { RelayAdapt7702ExecutionType } from '../../../transaction/relay-adapt-7702-signature'; export declare const RETURN_DATA_RELAY_ADAPT_STRING_PREFIX = "0x5c0dee5d"; export declare const RETURN_DATA_STRING_PREFIX = "0x08c379a0"; export declare class RelayAdapt7702Contract { private readonly contract; private readonly provider; private readonly relayAdapt7702Interface; private readonly executionType; readonly address: string; /** * Connect to Railgun instance on network * @param relayAdaptV2ContractAddress - address of Railgun relay adapt contract * @param provider - Network provider */ constructor(relayAdaptV2ContractAddress: string, provider: Provider, executionType?: RelayAdapt7702ExecutionType); populateShieldBaseToken(shieldRequest: ShieldRequestStruct, authorization?: Authorization, signature?: string, random31Bytes?: string, ephemeralAddress?: string, executeNonce?: bigint): Promise; getOrderedCallsForShieldBaseToken(shieldRequest: ShieldRequestStruct, ephemeralAddress?: string): Promise; populateMulticall(calls: ContractTransaction[], shieldRequests: ShieldRequestStruct[]): Promise; /** * @returns Populated transaction */ private populateRelayShields; getOrderedCallsForUnshieldBaseToken(unshieldAddress: string, ephemeralAddress?: string): Promise; getRelayAdaptParamsUnshieldBaseToken(dummyTransactions: TransactionStructV2[], unshieldAddress: string, random: string, sendWithPublicWallet: boolean, ephemeralAddress?: string): Promise; populateUnshieldBaseToken(transactions: TransactionStructV2[], unshieldAddress: string, random31Bytes: string, _useDummyProof: boolean, sendWithPublicWallet: boolean, authorization?: Authorization, signature?: string, ephemeralAddress?: string, executeNonce?: bigint): Promise; /** * @returns Populated transaction */ private populateRelayTransfers; getOrderedCallsForCrossContractCalls(crossContractCalls: ContractTransaction[], relayShieldRequests: ShieldRequestStruct[]): Promise; private static shouldRequireSuccessForCrossContractCalls; getRelayAdaptParamsCrossContractCalls(dummyUnshieldTransactions: TransactionStructV2[], crossContractCalls: ContractTransaction[], relayShieldRequests: ShieldRequestStruct[], random: string, isBroadcasterTransaction: boolean, minGasLimit?: bigint, ephemeralAddress?: string): Promise; populateCrossContractCalls(unshieldTransactions: TransactionStructV2[], crossContractCalls: ContractTransaction[], relayShieldRequests: ShieldRequestStruct[], random31Bytes: string, isGasEstimate: boolean, isBroadcasterTransaction: boolean, minGasLimit?: bigint, authorization?: Authorization, signature?: string, ephemeralAddress?: string, executeNonce?: bigint): Promise; static getMinimumGasLimitForContract(minimumGasLimit: bigint): bigint; static estimateGasWithErrorHandler(provider: Provider, transaction: ContractTransaction | TransactionRequest): Promise; static extractGasEstimateCallFailedIndexAndErrorText(caught: Error | string): { callFailedIndexString: string; errorMessage: string; }; /** * Generates Relay multicall given a list of ordered calls. * @returns populated transaction */ private populateRelayMulticall; /** * Generates Relay multicall given a list of transactions and ordered calls. * @returns populated transaction */ private populateRelay; /** * Reads the RelayAdapt7702 execute nonce for the executing account. Callers * MUST read this once and pass the same value to both the execution signature * (RelayAdapt7702Helper.signExecutionAuthorization, via executionDetails.executeNonce) * and populateCrossContractCalls (executeNonce). Otherwise the signed nonce and * the encoded nonce diverge for any nonce > 0 and on-chain execution reverts. */ getExecuteNonce(ephemeralAddress?: string): Promise; private static getCallErrorTopic; static getRelayAdaptCallError(receiptLogs: TransactionReceiptLog[] | readonly Log[]): Optional; static parseRelayAdaptReturnValue(returnValue: string): Optional<{ callIndex?: number; error: string; }>; private static customRelayAdaptErrorParse; private static parseRelayAdaptStringError; }