FRE-600: Fix code review blockers

- Consolidated duplicate UndoManagers to single instance
- Fixed connection promise to only resolve on 'connected' status
- Fixed WebSocketProvider import (WebsocketProvider)
- Added proper doc.destroy() cleanup
- Renamed isPresenceInitialized property to avoid conflict

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
2026-04-25 00:08:01 -04:00
parent 65b552bb08
commit 7c684a42cc
48450 changed files with 5679671 additions and 383 deletions

50
node_modules/viem/utils/transaction/assertRequest.ts generated vendored Normal file
View File

@@ -0,0 +1,50 @@
import {
type ParseAccountErrorType,
parseAccount,
} from '../../accounts/utils/parseAccount.js'
import type { SendTransactionParameters } from '../../actions/wallet/sendTransaction.js'
import { maxUint256 } from '../../constants/number.js'
import {
InvalidAddressError,
type InvalidAddressErrorType,
} from '../../errors/address.js'
import {
FeeCapTooHighError,
type FeeCapTooHighErrorType,
TipAboveFeeCapError,
type TipAboveFeeCapErrorType,
} from '../../errors/node.js'
import type { FeeConflictErrorType } from '../../errors/transaction.js'
import type { ErrorType } from '../../errors/utils.js'
import type { Chain } from '../../types/chain.js'
import type { ExactPartial } from '../../types/utils.js'
import { isAddress } from '../address/isAddress.js'
export type AssertRequestParameters = ExactPartial<
SendTransactionParameters<Chain>
>
export type AssertRequestErrorType =
| InvalidAddressErrorType
| FeeConflictErrorType
| FeeCapTooHighErrorType
| ParseAccountErrorType
| TipAboveFeeCapErrorType
| ErrorType
export function assertRequest(args: AssertRequestParameters) {
const { account: account_, maxFeePerGas, maxPriorityFeePerGas, to } = args
const account = account_ ? parseAccount(account_) : undefined
if (account && !isAddress(account.address))
throw new InvalidAddressError({ address: account.address })
if (to && !isAddress(to)) throw new InvalidAddressError({ address: to })
if (maxFeePerGas && maxFeePerGas > maxUint256)
throw new FeeCapTooHighError({ maxFeePerGas })
if (
maxPriorityFeePerGas &&
maxFeePerGas &&
maxPriorityFeePerGas > maxFeePerGas
)
throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas })
}