import { Wallet } from "@ethersproject/wallet"; import { JsonRpcSigner } from "@ethersproject/providers"; import { type Chain, WalletClient } from "viem"; import { IAbstractSigner } from "@polymarket/builder-abstract-signer"; import { HttpClient } from "./http-helpers"; import { DepositWalletCall, NoncePayload, RelayerTransaction, RelayerTransactionResponse, RelayerTxType, RelayPayload, Transaction } from "./types"; import { ContractConfig } from "./config"; import { BuilderConfig } from "@polymarket/builder-signing-sdk"; export interface RelayClientOptions { chain?: Chain; } export declare class RelayClient { readonly relayerUrl: string; readonly chainId: number; readonly relayTxType: RelayerTxType; readonly contractConfig: ContractConfig; readonly httpClient: HttpClient; private readonly publicClient; readonly signer?: IAbstractSigner; readonly builderConfig?: BuilderConfig; constructor(relayerUrl: string, chainId: number, signer?: Wallet | JsonRpcSigner | WalletClient, builderConfig?: BuilderConfig, relayTxType?: RelayerTxType, options?: RelayClientOptions); getNonce(signerAddress: string, signerType: string): Promise; getRelayPayload(signerAddress: string, signerType: string): Promise; getTransaction(transactionId: string): Promise; getTransactions(): Promise; /** * Executes a batch of transactions * @param txns * @param metadata * @returns */ execute(txns: Transaction[], metadata?: string): Promise; private executeProxyTransactions; private executeSafeTransactions; /** * Deploys a safe * @returns */ deploy(): Promise; private _deploy; getDeployed(address: string, type?: string): Promise; /** * Deploys a new deposit wallet * @returns */ deployDepositWallet(): Promise; /** * Executes a batch of calls on a deposit wallet * @param calls - Array of calls to execute * @param walletAddress - Address of the deposit wallet * @param deadline - Unix timestamp deadline for the batch signature * @returns */ executeDepositWalletBatch(calls: DepositWalletCall[], walletAddress: string, deadline: string): Promise; /** * Derives the expected deposit wallet address for the current signer * @returns The predicted deposit wallet address */ deriveDepositWalletAddress(): Promise; private isContractDeployed; private getDepositWalletFactoryBeacon; /** * Periodically polls the transaction id until it reaches a desired state * Returns the relayer transaction if it does each the desired state * Returns undefined if the transaction hits the failed state * Times out after maxPolls is reached * @param transactionId * @param states * @param failState * @param maxPolls * @param pollFrequency * @returns */ pollUntilState(transactionId: string, states: string[], failState?: string, maxPolls?: number, pollFrequency?: number): Promise; private sendAuthedRequest; private _generateBuilderHeaders; private canBuilderAuth; private send; private signerNeeded; private getExpectedSafe; }