Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support eth_subscribe over websockets for watchEvent and watchContractEvent #1012

Merged
merged 6 commits into from
Aug 10, 2023

Conversation

jxom
Copy link
Member

@jxom jxom commented Aug 10, 2023

dupe of #985


PR-Codex overview

Detailed summary:

  • Added a new poll option to the watchEvent and watchContractEvent functions.
  • The poll option allows clients to use a polling mechanism to check for new logs instead of a WebSocket subscription.
  • The default value for poll is false for WebSocket clients and true for non-WebSocket clients.
  • When poll is true and the RPC Provider supports eth_newFilter, the functions will call eth_newFilter to create a filter and eth_getFilterChanges on a polling interval to get new logs.
  • When poll is true and the RPC Provider does not support eth_newFilter, the functions will call eth_getLogs for each block between the polling interval to get new logs.
  • When poll is false and the WebSocket Transport is used, the functions will use a WebSocket subscription via eth_subscribe and the "logs" event to get new logs.
  • Added the pollingInterval option to specify the polling frequency in milliseconds. The default value is the client's pollingInterval config.
  • Updated the documentation for watchEvent and watchContractEvent to include information about the new poll option and the different behaviors based on the RPC Provider support and WebSocket Transport usage.

The following files were skipped due to too many changes: src/actions/public/watchContractEvent.ts, src/actions/public/watchEvent.ts, src/actions/public/watchEvent.test.ts, src/actions/public/watchContractEvent.test.ts

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@changeset-bot
Copy link

changeset-bot bot commented Aug 10, 2023

⚠️ No Changeset found

Latest commit: aa84445

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Aug 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
viem ✅ Ready (Inspect) Visit Preview Aug 10, 2023 4:55am

@github-actions
Copy link
Contributor

github-actions bot commented Aug 10, 2023

Size Change: +2.53 kB (+1%)

Total Size: 319 kB

Filename Size Change
dist/cjs/actions/public/watchContractEvent.js 1.52 kB +549 B (+56%) 🆘
dist/cjs/actions/public/watchEvent.js 1.55 kB +623 B (+67%) 🆘
dist/esm/actions/public/watchContractEvent.js 2.34 kB +638 B (+37%) 🚨
dist/esm/actions/public/watchEvent.js 2.38 kB +719 B (+43%) 🚨
ℹ️ View Unchanged
Filename Size
dist/cjs/abi.js 376 B
dist/cjs/accounts/generateMnemonic.js 220 B
dist/cjs/accounts/generatePrivateKey.js 267 B
dist/cjs/accounts/hdKeyToAccount.js 375 B
dist/cjs/accounts/index.js 841 B
dist/cjs/accounts/mnemonicToAccount.js 296 B
dist/cjs/accounts/privateKeyToAccount.js 511 B
dist/cjs/accounts/toAccount.js 393 B
dist/cjs/accounts/types.js 124 B
dist/cjs/accounts/utils/parseAccount.js 225 B
dist/cjs/accounts/utils/privateKeyToAddress.js 319 B
dist/cjs/accounts/utils/publicKeyToAddress.js 298 B
dist/cjs/accounts/utils/sign.js 332 B
dist/cjs/accounts/utils/signMessage.js 303 B
dist/cjs/accounts/utils/signTransaction.js 333 B
dist/cjs/accounts/utils/signTypedData.js 313 B
dist/cjs/accounts/wordlists/czech.js 222 B
dist/cjs/accounts/wordlists/english.js 223 B
dist/cjs/accounts/wordlists/french.js 223 B
dist/cjs/accounts/wordlists/italian.js 223 B
dist/cjs/accounts/wordlists/japanese.js 225 B
dist/cjs/accounts/wordlists/korean.js 223 B
dist/cjs/accounts/wordlists/simplifiedChinese.js 242 B
dist/cjs/accounts/wordlists/spanish.js 223 B
dist/cjs/accounts/wordlists/traditionalChinese.js 242 B
dist/cjs/actions/ens/getEnsAddress.js 826 B
dist/cjs/actions/ens/getEnsAvatar.js 390 B
dist/cjs/actions/ens/getEnsName.js 646 B
dist/cjs/actions/ens/getEnsResolver.js 599 B
dist/cjs/actions/ens/getEnsText.js 752 B
dist/cjs/actions/getContract.js 1.07 kB
dist/cjs/actions/index.js 2.13 kB
dist/cjs/actions/public/call.js 1.8 kB
dist/cjs/actions/public/createBlockFilter.js 320 B
dist/cjs/actions/public/createContractEventFilter.js 548 B
dist/cjs/actions/public/createEventFilter.js 652 B
dist/cjs/actions/public/createPendingTransactionFilter.js 326 B
dist/cjs/actions/public/estimateContractGas.js 504 B
dist/cjs/actions/public/estimateGas.js 828 B
dist/cjs/actions/public/getBalance.js 350 B
dist/cjs/actions/public/getBlock.js 534 B
dist/cjs/actions/public/getBlockNumber.js 394 B
dist/cjs/actions/public/getBlockTransactionCount.js 427 B
dist/cjs/actions/public/getBytecode.js 369 B
dist/cjs/actions/public/getChainId.js 282 B
dist/cjs/actions/public/getFeeHistory.js 406 B
dist/cjs/actions/public/getFilterChanges.js 656 B
dist/cjs/actions/public/getFilterLogs.js 636 B
dist/cjs/actions/public/getGasPrice.js 232 B
dist/cjs/actions/public/getLogs.js 890 B
dist/cjs/actions/public/getStorageAt.js 359 B
dist/cjs/actions/public/getTransaction.js 563 B
dist/cjs/actions/public/getTransactionConfirmations.js 367 B
dist/cjs/actions/public/getTransactionCount.js 355 B
dist/cjs/actions/public/getTransactionReceipt.js 372 B
dist/cjs/actions/public/multicall.js 1.16 kB
dist/cjs/actions/public/readContract.js 477 B
dist/cjs/actions/public/simulateContract.js 639 B
dist/cjs/actions/public/uninstallFilter.js 232 B
dist/cjs/actions/public/verifyHash.js 542 B
dist/cjs/actions/public/verifyMessage.js 311 B
dist/cjs/actions/public/verifyTypedData.js 336 B
dist/cjs/actions/public/waitForTransactionReceipt.js 1.19 kB
dist/cjs/actions/public/watchBlockNumber.js 889 B
dist/cjs/actions/public/watchBlocks.js 997 B
dist/cjs/actions/public/watchPendingTransactions.js 911 B
dist/cjs/actions/test/dropTransaction.js 233 B
dist/cjs/actions/test/getAutomine.js 255 B
dist/cjs/actions/test/getTxpoolContent.js 218 B
dist/cjs/actions/test/getTxpoolStatus.js 312 B
dist/cjs/actions/test/impersonateAccount.js 238 B
dist/cjs/actions/test/increaseTime.js 287 B
dist/cjs/actions/test/inspectTxpool.js 214 B
dist/cjs/actions/test/mine.js 346 B
dist/cjs/actions/test/removeBlockTimestampInterval.js 226 B
dist/cjs/actions/test/reset.js 261 B
dist/cjs/actions/test/revert.js 217 B
dist/cjs/actions/test/sendUnsignedTransaction.js 473 B
dist/cjs/actions/test/setAutomine.js 283 B
dist/cjs/actions/test/setBalance.js 337 B
dist/cjs/actions/test/setBlockGasLimit.js 288 B
dist/cjs/actions/test/setBlockTimestampInterval.js 243 B
dist/cjs/actions/test/setCode.js 236 B
dist/cjs/actions/test/setCoinbase.js 233 B
dist/cjs/actions/test/setIntervalMining.js 230 B
dist/cjs/actions/test/setLoggingEnabled.js 235 B
dist/cjs/actions/test/setMinGasPrice.js 289 B
dist/cjs/actions/test/setNextBlockBaseFeePerGas.js 301 B
dist/cjs/actions/test/setNextBlockTimestamp.js 291 B
dist/cjs/actions/test/setNonce.js 291 B
dist/cjs/actions/test/setRpcUrl.js 229 B
dist/cjs/actions/test/setStorageAt.js 331 B
dist/cjs/actions/test/snapshot.js 209 B
dist/cjs/actions/test/stopImpersonatingAccount.js 241 B
dist/cjs/actions/wallet/addChain.js 427 B
dist/cjs/actions/wallet/deployContract.js 324 B
dist/cjs/actions/wallet/getAddresses.js 282 B
dist/cjs/actions/wallet/getPermissions.js 222 B
dist/cjs/actions/wallet/requestAddresses.js 279 B
dist/cjs/actions/wallet/requestPermissions.js 228 B
dist/cjs/actions/wallet/sendTransaction.js 958 B
dist/cjs/actions/wallet/signMessage.js 517 B
dist/cjs/actions/wallet/signTypedData.js 758 B
dist/cjs/actions/wallet/switchChain.js 309 B
dist/cjs/actions/wallet/watchAsset.js 235 B
dist/cjs/actions/wallet/writeContract.js 386 B
dist/cjs/chains/celo/formatters.js 641 B
dist/cjs/chains/celo/serializers.js 1.19 kB
dist/cjs/chains/celo/types.js 124 B
dist/cjs/chains/index.js 1.55 kB
dist/cjs/chains/optimism/fees.js 170 B
dist/cjs/chains/optimism/formatters.js 650 B
dist/cjs/chains/optimism/types.js 124 B
dist/cjs/chains/utils.js 304 B
dist/cjs/clients/createClient.js 570 B
dist/cjs/clients/createPublicClient.js 318 B
dist/cjs/clients/createTestClient.js 347 B
dist/cjs/clients/createWalletClient.js 356 B
dist/cjs/clients/decorators/public.js 1.1 kB
dist/cjs/clients/decorators/test.js 937 B
dist/cjs/clients/decorators/wallet.js 535 B
dist/cjs/clients/transports/createTransport.js 308 B
dist/cjs/clients/transports/custom.js 341 B
dist/cjs/clients/transports/fallback.js 1.34 kB
dist/cjs/clients/transports/http.js 805 B
dist/cjs/clients/transports/webSocket.js 894 B
dist/cjs/constants/abis.js 750 B
dist/cjs/constants/address.js 154 B
dist/cjs/constants/contract.js 167 B
dist/cjs/constants/contracts.js 1.32 kB
dist/cjs/constants/number.js 975 B
dist/cjs/constants/solidity.js 552 B
dist/cjs/constants/unit.js 198 B
dist/cjs/contract.js 837 B
dist/cjs/ens.js 414 B
dist/cjs/errors/abi.js 2.18 kB
dist/cjs/errors/account.js 422 B
dist/cjs/errors/address.js 300 B
dist/cjs/errors/base.js 723 B
dist/cjs/errors/block.js 372 B
dist/cjs/errors/ccip.js 776 B
dist/cjs/errors/chain.js 853 B
dist/cjs/errors/contract.js 2.12 kB
dist/cjs/errors/data.js 474 B
dist/cjs/errors/encoding.js 900 B
dist/cjs/errors/ens.js 661 B
dist/cjs/errors/estimateGas.js 693 B
dist/cjs/errors/log.js 310 B
dist/cjs/errors/node.js 1.62 kB
dist/cjs/errors/request.js 691 B
dist/cjs/errors/rpc.js 1.69 kB
dist/cjs/errors/transaction.js 1.91 kB
dist/cjs/errors/transport.js 296 B
dist/cjs/errors/utils.js 256 B
dist/cjs/errors/version.js 149 B
dist/cjs/index.js 6.08 kB
dist/cjs/public.js 881 B
dist/cjs/test.js 950 B
dist/cjs/types/account.js 125 B
dist/cjs/types/block.js 125 B
dist/cjs/types/chain.js 125 B
dist/cjs/types/contract.js 128 B
dist/cjs/types/eip1193.js 285 B
dist/cjs/types/ens.js 123 B
dist/cjs/types/fee.js 123 B
dist/cjs/types/filter.js 125 B
dist/cjs/types/log.js 124 B
dist/cjs/types/misc.js 124 B
dist/cjs/types/multicall.js 127 B
dist/cjs/types/rpc.js 123 B
dist/cjs/types/transaction.js 128 B
dist/cjs/types/transport.js 128 B
dist/cjs/types/typedData.js 128 B
dist/cjs/types/utils.js 124 B
dist/cjs/types/window.js 126 B
dist/cjs/utils/abi/decodeAbiParameters.js 1.58 kB
dist/cjs/utils/abi/decodeDeployData.js 462 B
dist/cjs/utils/abi/decodeErrorResult.js 595 B
dist/cjs/utils/abi/decodeEventLog.js 1.11 kB
dist/cjs/utils/abi/decodeFunctionData.js 525 B
dist/cjs/utils/abi/decodeFunctionResult.js 484 B
dist/cjs/utils/abi/encodeAbiParameters.js 1.78 kB
dist/cjs/utils/abi/encodeDeployData.js 470 B
dist/cjs/utils/abi/encodeErrorResult.js 570 B
dist/cjs/utils/abi/encodeEventTopics.js 888 B
dist/cjs/utils/abi/encodeFunctionData.js 566 B
dist/cjs/utils/abi/encodeFunctionResult.js 512 B
dist/cjs/utils/abi/encodePacked.js 907 B
dist/cjs/utils/abi/formatAbiItem.js 488 B
dist/cjs/utils/abi/formatAbiItemWithArgs.js 386 B
dist/cjs/utils/abi/getAbiItem.js 929 B
dist/cjs/utils/accounts.js 262 B
dist/cjs/utils/address/getAddress.js 571 B
dist/cjs/utils/address/getContractAddress.js 616 B
dist/cjs/utils/address/isAddress.js 215 B
dist/cjs/utils/address/isAddressEqual.js 296 B
dist/cjs/utils/buildRequest.js 1.01 kB
dist/cjs/utils/ccip.js 1.26 kB
dist/cjs/utils/chain.js 530 B
dist/cjs/utils/contract/extractFunctionParts.js 463 B
dist/cjs/utils/data/concat.js 381 B
dist/cjs/utils/data/isBytes.js 273 B
dist/cjs/utils/data/isBytesEqual.js 288 B
dist/cjs/utils/data/isHex.js 263 B
dist/cjs/utils/data/pad.js 578 B
dist/cjs/utils/data/size.js 250 B
dist/cjs/utils/data/slice.js 583 B
dist/cjs/utils/data/trim.js 413 B
dist/cjs/utils/encoding/fromBytes.js 640 B
dist/cjs/utils/encoding/fromHex.js 810 B
dist/cjs/utils/encoding/fromRlp.js 915 B
dist/cjs/utils/encoding/toBytes.js 781 B
dist/cjs/utils/encoding/toHex.js 936 B
dist/cjs/utils/encoding/toRlp.js 543 B
dist/cjs/utils/ens/avatar/parseAvatarRecord.js 626 B
dist/cjs/utils/ens/avatar/utils.js 2.08 kB
dist/cjs/utils/ens/encodedLabelToLabelhash.js 303 B
dist/cjs/utils/ens/encodeLabelhash.js 193 B
dist/cjs/utils/ens/errors.js 465 B
dist/cjs/utils/ens/labelhash.js 349 B
dist/cjs/utils/ens/namehash.js 487 B
dist/cjs/utils/ens/normalize.js 217 B
dist/cjs/utils/ens/packetToBytes.js 490 B
dist/cjs/utils/errors/getCallError.js 317 B
dist/cjs/utils/errors/getContractError.js 589 B
dist/cjs/utils/errors/getEstimateGasError.js 321 B
dist/cjs/utils/errors/getNodeError.js 693 B
dist/cjs/utils/errors/getTransactionError.js 317 B
dist/cjs/utils/filters/createFilterRequestScope.js 332 B
dist/cjs/utils/formatters/block.js 509 B
dist/cjs/utils/formatters/extract.js 273 B
dist/cjs/utils/formatters/feeHistory.js 273 B
dist/cjs/utils/formatters/formatter.js 307 B
dist/cjs/utils/formatters/log.js 308 B
dist/cjs/utils/formatters/transaction.js 622 B
dist/cjs/utils/formatters/transactionReceipt.js 559 B
dist/cjs/utils/formatters/transactionRequest.js 401 B
dist/cjs/utils/hash/getEventSelector.js 256 B
dist/cjs/utils/hash/getFunctionSelector.js 282 B
dist/cjs/utils/hash/hashFunction.js 414 B
dist/cjs/utils/hash/isHash.js 239 B
dist/cjs/utils/hash/keccak256.js 354 B
dist/cjs/utils/index.js 2.96 kB
dist/cjs/utils/observe.js 542 B
dist/cjs/utils/poll.js 384 B
dist/cjs/utils/promise/createBatchScheduler.js 626 B
dist/cjs/utils/promise/withCache.js 517 B
dist/cjs/utils/promise/withRetry.js 457 B
dist/cjs/utils/promise/withTimeout.js 422 B
dist/cjs/utils/regex.js 293 B
dist/cjs/utils/rpc.js 1.67 kB
dist/cjs/utils/signature/hashMessage.js 421 B
dist/cjs/utils/signature/hashTypedData.js 1.36 kB
dist/cjs/utils/signature/hexToSignature.js 340 B
dist/cjs/utils/signature/recoverAddress.js 279 B
dist/cjs/utils/signature/recoverMessageAddress.js 265 B
dist/cjs/utils/signature/recoverPublicKey.js 481 B
dist/cjs/utils/signature/recoverTypedDataAddress.js 311 B
dist/cjs/utils/signature/signatureToHex.js 331 B
dist/cjs/utils/signature/verifyMessage.js 298 B
dist/cjs/utils/signature/verifyTypedData.js 338 B
dist/cjs/utils/stringify.js 258 B
dist/cjs/utils/transaction/assertRequest.js 537 B
dist/cjs/utils/transaction/assertTransaction.js 646 B
dist/cjs/utils/transaction/getSerializedTransactionType.js 384 B
dist/cjs/utils/transaction/getTransactionType.js 358 B
dist/cjs/utils/transaction/parseTransaction.js 1.51 kB
dist/cjs/utils/transaction/prepareRequest.js 944 B
dist/cjs/utils/transaction/serializeAccessList.js 459 B
dist/cjs/utils/transaction/serializeTransaction.js 879 B
dist/cjs/utils/typedData.js 756 B
dist/cjs/utils/uid.js 316 B
dist/cjs/utils/unit/formatEther.js 251 B
dist/cjs/utils/unit/formatGwei.js 250 B
dist/cjs/utils/unit/formatUnits.js 360 B
dist/cjs/utils/unit/parseEther.js 251 B
dist/cjs/utils/unit/parseGwei.js 250 B
dist/cjs/utils/unit/parseUnits.js 542 B
dist/cjs/utils/wait.js 197 B
dist/cjs/wallet.js 467 B
dist/cjs/window.js 143 B
dist/esm/abi.js 175 B
dist/esm/accounts/generateMnemonic.js 239 B
dist/esm/accounts/generatePrivateKey.js 231 B
dist/esm/accounts/hdKeyToAccount.js 335 B
dist/esm/accounts/index.js 368 B
dist/esm/accounts/mnemonicToAccount.js 263 B
dist/esm/accounts/privateKeyToAccount.js 453 B
dist/esm/accounts/toAccount.js 370 B
dist/esm/accounts/types.js 64 B
dist/esm/accounts/utils/parseAccount.js 157 B
dist/esm/accounts/utils/privateKeyToAddress.js 302 B
dist/esm/accounts/utils/publicKeyToAddress.js 282 B
dist/esm/accounts/utils/sign.js 327 B
dist/esm/accounts/utils/signMessage.js 354 B
dist/esm/accounts/utils/signTransaction.js 243 B
dist/esm/accounts/utils/signTypedData.js 382 B
dist/esm/accounts/wordlists/czech.js 107 B
dist/esm/accounts/wordlists/english.js 107 B
dist/esm/accounts/wordlists/french.js 106 B
dist/esm/accounts/wordlists/italian.js 109 B
dist/esm/accounts/wordlists/japanese.js 110 B
dist/esm/accounts/wordlists/korean.js 108 B
dist/esm/accounts/wordlists/simplifiedChinese.js 125 B
dist/esm/accounts/wordlists/spanish.js 109 B
dist/esm/accounts/wordlists/traditionalChinese.js 126 B
dist/esm/actions/ens/getEnsAddress.js 1.3 kB
dist/esm/actions/ens/getEnsAvatar.js 918 B
dist/esm/actions/ens/getEnsName.js 935 B
dist/esm/actions/ens/getEnsResolver.js 1.1 kB
dist/esm/actions/ens/getEnsText.js 1.22 kB
dist/esm/actions/getContract.js 1.53 kB
dist/esm/actions/index.js 890 B
dist/esm/actions/public/call.js 2.25 kB
dist/esm/actions/public/createBlockFilter.js 601 B
dist/esm/actions/public/createContractEventFilter.js 784 B
dist/esm/actions/public/createEventFilter.js 939 B
dist/esm/actions/public/createPendingTransactionFilter.js 622 B
dist/esm/actions/public/estimateContractGas.js 846 B
dist/esm/actions/public/estimateGas.js 1.18 kB
dist/esm/actions/public/getBalance.js 718 B
dist/esm/actions/public/getBlock.js 820 B
dist/esm/actions/public/getBlockNumber.js 659 B
dist/esm/actions/public/getBlockTransactionCount.js 671 B
dist/esm/actions/public/getBytecode.js 619 B
dist/esm/actions/public/getChainId.js 481 B
dist/esm/actions/public/getFeeHistory.js 622 B
dist/esm/actions/public/getFilterChanges.js 1.39 kB
dist/esm/actions/public/getFilterLogs.js 1.08 kB
dist/esm/actions/public/getGasPrice.js 434 B
dist/esm/actions/public/getLogs.js 1.24 kB
dist/esm/actions/public/getStorageAt.js 631 B
dist/esm/actions/public/getTransaction.js 911 B
dist/esm/actions/public/getTransactionConfirmations.js 741 B
dist/esm/actions/public/getTransactionCount.js 639 B
dist/esm/actions/public/getTransactionReceipt.js 721 B
dist/esm/actions/public/multicall.js 1.59 kB
dist/esm/actions/public/readContract.js 1.07 kB
dist/esm/actions/public/simulateContract.js 1.2 kB
dist/esm/actions/public/uninstallFilter.js 568 B
dist/esm/actions/public/verifyHash.js 694 B
dist/esm/actions/public/verifyMessage.js 465 B
dist/esm/actions/public/verifyTypedData.js 406 B
dist/esm/actions/public/waitForTransactionReceipt.js 2.22 kB
dist/esm/actions/public/watchBlockNumber.js 1.41 kB
dist/esm/actions/public/watchBlocks.js 1.56 kB
dist/esm/actions/public/watchPendingTransactions.js 1.35 kB
dist/esm/actions/test/dropTransaction.js 441 B
dist/esm/actions/test/getAutomine.js 425 B
dist/esm/actions/test/getTxpoolContent.js 443 B
dist/esm/actions/test/getTxpoolStatus.js 517 B
dist/esm/actions/test/impersonateAccount.js 490 B
dist/esm/actions/test/increaseTime.js 447 B
dist/esm/actions/test/inspectTxpool.js 447 B
dist/esm/actions/test/mine.js 477 B
dist/esm/actions/test/removeBlockTimestampInterval.js 358 B
dist/esm/actions/test/reset.js 421 B
dist/esm/actions/test/revert.js 384 B
dist/esm/actions/test/sendUnsignedTransaction.js 841 B
dist/esm/actions/test/setAutomine.js 443 B
dist/esm/actions/test/setBalance.js 540 B
dist/esm/actions/test/setBlockGasLimit.js 432 B
dist/esm/actions/test/setBlockTimestampInterval.js 467 B
dist/esm/actions/test/setCode.js 511 B
dist/esm/actions/test/setCoinbase.js 440 B
dist/esm/actions/test/setIntervalMining.js 421 B
dist/esm/actions/test/setLoggingEnabled.js 361 B
dist/esm/actions/test/setMinGasPrice.js 525 B
dist/esm/actions/test/setNextBlockBaseFeePerGas.js 462 B
dist/esm/actions/test/setNextBlockTimestamp.js 440 B
dist/esm/actions/test/setNonce.js 493 B
dist/esm/actions/test/setRpcUrl.js 389 B
dist/esm/actions/test/setStorageAt.js 538 B
dist/esm/actions/test/snapshot.js 336 B
dist/esm/actions/test/stopImpersonatingAccount.js 473 B
dist/esm/actions/wallet/addChain.js 599 B
dist/esm/actions/wallet/deployContract.js 657 B
dist/esm/actions/wallet/getAddresses.js 487 B
dist/esm/actions/wallet/getPermissions.js 417 B
dist/esm/actions/wallet/requestAddresses.js 613 B
dist/esm/actions/wallet/requestPermissions.js 458 B
dist/esm/actions/wallet/sendTransaction.js 1.48 kB
dist/esm/actions/wallet/signMessage.js 1.04 kB
dist/esm/actions/wallet/signTypedData.js 1.51 kB
dist/esm/actions/wallet/switchChain.js 489 B
dist/esm/actions/wallet/watchAsset.js 577 B
dist/esm/actions/wallet/writeContract.js 1.1 kB
dist/esm/chains/celo/formatters.js 574 B
dist/esm/chains/celo/serializers.js 1.41 kB
dist/esm/chains/celo/types.js 64 B
dist/esm/chains/index.js 1.11 kB
dist/esm/chains/optimism/fees.js 125 B
dist/esm/chains/optimism/formatters.js 592 B
dist/esm/chains/optimism/types.js 64 B
dist/esm/chains/utils.js 150 B
dist/esm/clients/createClient.js 499 B
dist/esm/clients/createPublicClient.js 238 B
dist/esm/clients/createTestClient.js 261 B
dist/esm/clients/createWalletClient.js 271 B
dist/esm/clients/decorators/public.js 875 B
dist/esm/clients/decorators/test.js 766 B
dist/esm/clients/decorators/wallet.js 414 B
dist/esm/clients/transports/createTransport.js 280 B
dist/esm/clients/transports/custom.js 327 B
dist/esm/clients/transports/fallback.js 1.46 kB
dist/esm/clients/transports/http.js 792 B
dist/esm/clients/transports/webSocket.js 888 B
dist/esm/constants/abis.js 826 B
dist/esm/constants/address.js 87 B
dist/esm/constants/contract.js 104 B
dist/esm/constants/contracts.js 1.24 kB
dist/esm/constants/number.js 636 B
dist/esm/constants/solidity.js 550 B
dist/esm/constants/unit.js 127 B
dist/esm/contract.js 380 B
dist/esm/ens.js 189 B
dist/esm/errors/abi.js 1.83 kB
dist/esm/errors/account.js 361 B
dist/esm/errors/address.js 245 B
dist/esm/errors/base.js 665 B
dist/esm/errors/block.js 317 B
dist/esm/errors/ccip.js 682 B
dist/esm/errors/chain.js 746 B
dist/esm/errors/contract.js 1.95 kB
dist/esm/errors/data.js 403 B
dist/esm/errors/encoding.js 757 B
dist/esm/errors/ens.js 565 B
dist/esm/errors/estimateGas.js 619 B
dist/esm/errors/log.js 254 B
dist/esm/errors/node.js 1.62 kB
dist/esm/errors/request.js 587 B
dist/esm/errors/rpc.js 1.75 kB
dist/esm/errors/transaction.js 1.72 kB
dist/esm/errors/transport.js 224 B
dist/esm/errors/utils.js 162 B
dist/esm/errors/version.js 82 B
dist/esm/index.js 2.34 kB
dist/esm/public.js 382 B
dist/esm/test.js 433 B
dist/esm/types/account.js 66 B
dist/esm/types/block.js 64 B
dist/esm/types/chain.js 64 B
dist/esm/types/contract.js 67 B
dist/esm/types/eip1193.js 249 B
dist/esm/types/ens.js 62 B
dist/esm/types/fee.js 62 B
dist/esm/types/filter.js 65 B
dist/esm/types/log.js 62 B
dist/esm/types/misc.js 63 B
dist/esm/types/multicall.js 68 B
dist/esm/types/rpc.js 62 B
dist/esm/types/transaction.js 70 B
dist/esm/types/transport.js 66 B
dist/esm/types/typedData.js 68 B
dist/esm/types/utils.js 64 B
dist/esm/types/window.js 65 B
dist/esm/utils/abi/decodeAbiParameters.js 2.04 kB
dist/esm/utils/abi/decodeDeployData.js 388 B
dist/esm/utils/abi/decodeErrorResult.js 502 B
dist/esm/utils/abi/decodeEventLog.js 1.07 kB
dist/esm/utils/abi/decodeFunctionData.js 426 B
dist/esm/utils/abi/decodeFunctionResult.js 404 B
dist/esm/utils/abi/encodeAbiParameters.js 1.91 kB
dist/esm/utils/abi/encodeDeployData.js 389 B
dist/esm/utils/abi/encodeErrorResult.js 476 B
dist/esm/utils/abi/encodeEventTopics.js 778 B
dist/esm/utils/abi/encodeFunctionData.js 462 B
dist/esm/utils/abi/encodeFunctionResult.js 429 B
dist/esm/utils/abi/encodePacked.js 838 B
dist/esm/utils/abi/formatAbiItem.js 400 B
dist/esm/utils/abi/formatAbiItemWithArgs.js 307 B
dist/esm/utils/abi/getAbiItem.js 1.01 kB
dist/esm/utils/accounts.js 276 B
dist/esm/utils/address/getAddress.js 470 B
dist/esm/utils/address/getContractAddress.js 468 B
dist/esm/utils/address/isAddress.js 144 B
dist/esm/utils/address/isAddressEqual.js 217 B
dist/esm/utils/buildRequest.js 1.11 kB
dist/esm/utils/ccip.js 1.14 kB
dist/esm/utils/chain.js 437 B
dist/esm/utils/contract/extractFunctionParts.js 364 B
dist/esm/utils/data/concat.js 295 B
dist/esm/utils/data/isBytes.js 206 B
dist/esm/utils/data/isBytesEqual.js 209 B
dist/esm/utils/data/isHex.js 201 B
dist/esm/utils/data/pad.js 489 B
dist/esm/utils/data/size.js 255 B
dist/esm/utils/data/slice.js 600 B
dist/esm/utils/data/trim.js 350 B
dist/esm/utils/encoding/fromBytes.js 902 B
dist/esm/utils/encoding/fromHex.js 1.12 kB
dist/esm/utils/encoding/fromRlp.js 835 B
dist/esm/utils/encoding/toBytes.js 1.1 kB
dist/esm/utils/encoding/toHex.js 1.25 kB
dist/esm/utils/encoding/toRlp.js 444 B
dist/esm/utils/ens/avatar/parseAvatarRecord.js 697 B
dist/esm/utils/ens/avatar/utils.js 2.27 kB
dist/esm/utils/ens/encodedLabelToLabelhash.js 227 B
dist/esm/utils/ens/encodeLabelhash.js 119 B
dist/esm/utils/ens/errors.js 478 B
dist/esm/utils/ens/labelhash.js 609 B
dist/esm/utils/ens/namehash.js 804 B
dist/esm/utils/ens/normalize.js 352 B
dist/esm/utils/ens/packetToBytes.js 538 B
dist/esm/utils/errors/getCallError.js 239 B
dist/esm/utils/errors/getContractError.js 526 B
dist/esm/utils/errors/getEstimateGasError.js 244 B
dist/esm/utils/errors/getNodeError.js 637 B
dist/esm/utils/errors/getTransactionError.js 239 B
dist/esm/utils/filters/createFilterRequestScope.js 349 B
dist/esm/utils/formatters/block.js 446 B
dist/esm/utils/formatters/extract.js 303 B
dist/esm/utils/formatters/feeHistory.js 206 B
dist/esm/utils/formatters/formatter.js 242 B
dist/esm/utils/formatters/log.js 238 B
dist/esm/utils/formatters/transaction.js 553 B
dist/esm/utils/formatters/transactionReceipt.js 486 B
dist/esm/utils/formatters/transactionRequest.js 337 B
dist/esm/utils/hash/getEventSelector.js 183 B
dist/esm/utils/hash/getFunctionSelector.js 205 B
dist/esm/utils/hash/hashFunction.js 312 B
dist/esm/utils/hash/isHash.js 154 B
dist/esm/utils/hash/keccak256.js 266 B
dist/esm/utils/index.js 1.18 kB
dist/esm/utils/observe.js 589 B
dist/esm/utils/poll.js 345 B
dist/esm/utils/promise/createBatchScheduler.js 576 B
dist/esm/utils/promise/withCache.js 691 B
dist/esm/utils/promise/withRetry.js 382 B
dist/esm/utils/promise/withTimeout.js 358 B
dist/esm/utils/regex.js 322 B
dist/esm/utils/rpc.js 1.86 kB
dist/esm/utils/signature/hashMessage.js 330 B
dist/esm/utils/signature/hashTypedData.js 1.42 kB
dist/esm/utils/signature/hexToSignature.js 461 B
dist/esm/utils/signature/recoverAddress.js 198 B
dist/esm/utils/signature/recoverMessageAddress.js 180 B
dist/esm/utils/signature/recoverPublicKey.js 498 B
dist/esm/utils/signature/recoverTypedDataAddress.js 223 B
dist/esm/utils/signature/signatureToHex.js 457 B
dist/esm/utils/signature/verifyMessage.js 457 B
dist/esm/utils/signature/verifyTypedData.js 498 B
dist/esm/utils/stringify.js 195 B
dist/esm/utils/transaction/assertRequest.js 451 B
dist/esm/utils/transaction/assertTransaction.js 537 B
dist/esm/utils/transaction/getSerializedTransactionType.js 301 B
dist/esm/utils/transaction/getTransactionType.js 286 B
dist/esm/utils/transaction/parseTransaction.js 1.39 kB
dist/esm/utils/transaction/prepareRequest.js 905 B
dist/esm/utils/transaction/serializeAccessList.js 515 B
dist/esm/utils/transaction/serializeTransaction.js 779 B
dist/esm/utils/typedData.js 738 B
dist/esm/utils/uid.js 251 B
dist/esm/utils/unit/formatEther.js 171 B
dist/esm/utils/unit/formatGwei.js 171 B
dist/esm/utils/unit/formatUnits.js 298 B
dist/esm/utils/unit/parseEther.js 170 B
dist/esm/utils/unit/parseGwei.js 171 B
dist/esm/utils/unit/parseUnits.js 522 B
dist/esm/utils/wait.js 131 B
dist/esm/wallet.js 217 B
dist/esm/window.js 75 B

compressed-size-action

@codecov
Copy link

codecov bot commented Aug 10, 2023

Codecov Report

Merging #1012 (cc33614) into main (e1032c7) will increase coverage by 0.06%.
Report is 1 commits behind head on main.
The diff coverage is 98.60%.

❗ Current head cc33614 differs from pull request most recent head aa84445. Consider uploading reports for the commit aa84445 to get more accurate results

@@            Coverage Diff             @@
##             main    #1012      +/-   ##
==========================================
+ Coverage   94.85%   94.92%   +0.06%     
==========================================
  Files         262      262              
  Lines       25798    26033     +235     
  Branches     1823     1855      +32     
==========================================
+ Hits        24471    24711     +240     
+ Misses       1315     1309       -6     
- Partials       12       13       +1     
Files Changed Coverage Δ
src/actions/public/watchContractEvent.ts 99.06% <98.50%> (-0.94%) ⬇️
src/actions/public/watchEvent.ts 99.17% <98.69%> (-0.83%) ⬇️

... and 3 files with indirect coverage changes

@jxom jxom force-pushed the feature/subscribe-logs branch from cc33614 to aa84445 Compare August 10, 2023 04:53
@jxom jxom merged commit ef66afc into main Aug 10, 2023
@jxom jxom deleted the feature/subscribe-logs branch August 10, 2023 04:58
aaronmgdr pushed a commit to celo-org/viem that referenced this pull request Aug 18, 2023
…chContractEvent` (wevm#1012)

* Support eth_subscribe in watchContractEvent

* Complete test suite for watchContractEvent

* Support eth_subscribe in watchEvent and add tests

* Update docs

* chore: add tests

* chore: update docs

---------

Co-authored-by: Simone <simone@nemo.ventures>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants