Skip to content

Commit 19be638

Browse files
committed
FeeOptions do not sign calls
1 parent 96e35c3 commit 19be638

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

packages/wallet/dapp-client/src/ChainSessionManager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -714,11 +714,12 @@ export class ChainSessionManager {
714714

715715
/**
716716
* Fetches fee options for a set of transactions.
717+
* @param wallet The wallet address to use for the fee options.
717718
* @param calls The transactions to estimate fees for.
718719
* @returns A promise that resolves with an array of fee options.
719720
* @throws {FeeOptionError} If fetching fee options fails.
720721
*/
721-
async getFeeOptions(calls: Transaction[]): Promise<Relayer.FeeOption[]> {
722+
async getFeeOptions(wallet: Address.Address, calls: Transaction[]): Promise<Relayer.FeeOption[]> {
722723
const callsToSend = calls.map((tx) => ({
723724
to: tx.to,
724725
value: tx.value,
@@ -729,8 +730,7 @@ export class ChainSessionManager {
729730
behaviorOnError: tx.behaviorOnError ?? ('revert' as const),
730731
}))
731732
try {
732-
const signedCall = await this._buildAndSignCalls(callsToSend)
733-
const feeOptions = await this.relayer.feeOptions(signedCall.to, this.chainId, callsToSend)
733+
const feeOptions = await this.relayer.feeOptions(wallet, this.chainId, callsToSend)
734734
return feeOptions.options
735735
} catch (err) {
736736
throw new FeeOptionError(`Failed to get fee options: ${err instanceof Error ? err.message : String(err)}`)

packages/wallet/dapp-client/src/DappClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,11 +536,11 @@ export class DappClient {
536536
* }
537537
*/
538538
async getFeeOptions(chainId: number, transactions: Transaction[]): Promise<Relayer.FeeOption[]> {
539-
if (!this.isInitialized) throw new InitializationError('Not initialized')
539+
if (!this.isInitialized || !this.walletAddress) throw new InitializationError('Not initialized')
540540
const chainSessionManager = this.getChainSessionManager(chainId)
541541
if (!chainSessionManager.isInitialized)
542542
throw new InitializationError(`ChainSessionManager for chain ${chainId} is not initialized.`)
543-
return await chainSessionManager.getFeeOptions(transactions)
543+
return await chainSessionManager.getFeeOptions(this.walletAddress, transactions)
544544
}
545545

546546
/**

0 commit comments

Comments
 (0)