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

feat: signTransaction, sendRawTransaction, prepareTransactionRequest #1058

Merged
merged 6 commits into from
Aug 27, 2023

Conversation

jxom
Copy link
Member

@jxom jxom commented Aug 24, 2023

Added prepareTransactionRequest, signTransaction, and sendRawTransaction.

Ref: #785


PR-Codex overview

Focus of this PR:

Adding new functions prepareTransactionRequest, signTransaction, and sendRawTransaction to the codebase.

Detailed summary:

  • Added prepareTransactionRequest, signTransaction, and sendRawTransaction functions.
  • Updated imports and types in multiple files.
  • Deprecated prepareRequest function and replaced it with prepareTransactionRequest in exports.
  • Updated documentation and sidebar links.

The following files were skipped due to too many changes: src/actions/public/getBlock.test.ts, src/index.ts, src/types/chain.ts, src/actions/public/watchContractEvent.ts, src/actions/wallet/sendTransaction.ts, src/clients/decorators/public.test.ts, src/actions/public/estimateFeesPerGas.ts, site/docs/actions/wallet/sendRawTransaction.md, src/actions/wallet/sendRawTransaction.ts, src/clients/createPublicClient.test.ts, src/clients/decorators/wallet.test.ts, src/chains/celo/formatters.ts, src/utils/formatters/transactionRequest.test.ts, src/clients/createWalletClient.test.ts, src/clients/decorators/public.ts, src/chains/celo/types.ts, src/actions/wallet/signTransaction.ts, src/chains/celo/formatters.test-d.ts, src/clients/decorators/wallet.ts, src/utils/transaction/prepareRequest.ts, site/docs/actions/wallet/signTransaction.md, site/docs/actions/wallet/prepareTransactionRequest.md, src/actions/wallet/signTransaction.test.ts, src/utils/transaction/prepareRequest.test.ts

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

@vercel
Copy link

vercel bot commented Aug 24, 2023

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

Name Status Preview Updated (UTC)
viem ✅ Ready (Inspect) Visit Preview Aug 25, 2023 2:21am

@changeset-bot
Copy link

changeset-bot bot commented Aug 24, 2023

🦋 Changeset detected

Latest commit: 7def68c

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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

@github-actions
Copy link
Contributor

github-actions bot commented Aug 24, 2023

Size Change: +3.81 kB (+1%)

Total Size: 329 kB

Filename Size Change
dist/cjs/actions/index.js 2.22 kB +90 B (+4%)
dist/cjs/actions/public/estimateFeesPerGas.js 788 B +11 B (+1%)
dist/cjs/actions/public/estimateGas.js 836 B +8 B (+1%)
dist/cjs/actions/public/watchContractEvent.js 1.55 kB +32 B (+2%)
dist/cjs/actions/wallet/sendTransaction.js 965 B +7 B (+1%)
dist/cjs/chains/celo/formatters.js 684 B +43 B (+7%) 🔍
dist/cjs/clients/decorators/public.js 1.21 kB +61 B (+5%) 🔍
dist/cjs/clients/decorators/wallet.js 593 B +58 B (+11%) ⚠️
dist/cjs/index.js 6.16 kB -13 B (0%)
dist/cjs/utils/data/isBytesEqual.js 302 B +14 B (+5%) 🔍
dist/cjs/utils/ens/encodedLabelToLabelhash.js 309 B +6 B (+2%)
dist/cjs/utils/formatters/transactionRequest.js 471 B +70 B (+17%) ⚠️
dist/cjs/utils/index.js 2.98 kB +12 B (0%)
dist/cjs/utils/transaction/prepareRequest.js 0 B -819 B (removed) 🏆
dist/esm/actions/index.js 918 B +28 B (+3%)
dist/esm/actions/public/estimateFeesPerGas.js 1.01 kB +9 B (+1%)
dist/esm/actions/public/estimateGas.js 1.18 kB +6 B (+1%)
dist/esm/actions/public/watchContractEvent.js 2.36 kB +20 B (+1%)
dist/esm/actions/wallet/sendTransaction.js 1.49 kB +9 B (+1%)
dist/esm/chains/celo/formatters.js 619 B +45 B (+8%) 🔍
dist/esm/clients/decorators/public.js 977 B +57 B (+6%) 🔍
dist/esm/clients/decorators/wallet.js 463 B +49 B (+12%) ⚠️
dist/esm/index.js 2.37 kB -3 B (0%)
dist/esm/utils/data/isBytesEqual.js 215 B +6 B (+3%)
dist/esm/utils/ens/encodedLabelToLabelhash.js 232 B +5 B (+2%)
dist/esm/utils/formatters/transactionRequest.js 403 B +66 B (+20%) 🚨
dist/esm/utils/index.js 1.23 kB +56 B (+5%) 🔍
dist/esm/utils/transaction/prepareRequest.js 0 B -752 B (removed) 🏆
dist/cjs/actions/wallet/prepareTransactionRequest.js 890 B +890 B (new file) 🆕
dist/cjs/actions/wallet/sendRawTransaction.js 237 B +237 B (new file) 🆕
dist/cjs/actions/wallet/signTransaction.js 691 B +691 B (new file) 🆕
dist/esm/actions/wallet/prepareTransactionRequest.js 1.17 kB +1.17 kB (new file) 🆕
dist/esm/actions/wallet/sendRawTransaction.js 614 B +614 B (new file) 🆕
dist/esm/actions/wallet/signTransaction.js 1.03 kB +1.03 kB (new file) 🆕
ℹ️ 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 821 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/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/estimateMaxPriorityFeePerGas.js 667 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.15 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.22 kB
dist/cjs/actions/public/watchBlockNumber.js 889 B
dist/cjs/actions/public/watchBlocks.js 997 B
dist/cjs/actions/public/watchEvent.js 1.55 kB
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/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/parsers.js 893 B
dist/cjs/chains/celo/serializers.js 1.2 kB
dist/cjs/chains/celo/types.js 124 B
dist/cjs/chains/index.js 1.56 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 331 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/test.js 937 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 995 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/fee.js 502 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/public.js 951 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/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/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/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/observe.js 542 B
dist/cjs/utils/poll.js 390 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.64 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.56 kB
dist/cjs/utils/transaction/serializeAccessList.js 459 B
dist/cjs/utils/transaction/serializeTransaction.js 879 B
dist/cjs/utils/typedData.js 755 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/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/estimateMaxPriorityFeePerGas.js 1.01 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.55 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.25 kB
dist/esm/actions/public/watchBlockNumber.js 1.41 kB
dist/esm/actions/public/watchBlocks.js 1.56 kB
dist/esm/actions/public/watchEvent.js 2.38 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/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/parsers.js 784 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 159 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/test.js 766 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 649 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/fee.js 416 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/public.js 411 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/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/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/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/observe.js 589 B
dist/esm/utils/poll.js 350 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.83 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.41 kB
dist/esm/utils/transaction/serializeAccessList.js 515 B
dist/esm/utils/transaction/serializeTransaction.js 779 B
dist/esm/utils/typedData.js 737 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 24, 2023

Codecov Report

Merging #1058 (7def68c) into main (9c0fbb8) will increase coverage by 8.96%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #1058      +/-   ##
==========================================
+ Coverage   90.86%   99.82%   +8.96%     
==========================================
  Files         260      272      +12     
  Lines       25848    27248    +1400     
  Branches     1535     2182     +647     
==========================================
+ Hits        23486    27200    +3714     
+ Misses       2343       43    -2300     
+ Partials       19        5      -14     
Files Changed Coverage Δ
src/actions/index.ts 100.00% <100.00%> (ø)
src/actions/public/estimateFeesPerGas.ts 100.00% <100.00%> (ø)
src/actions/public/estimateGas.ts 100.00% <100.00%> (+7.94%) ⬆️
src/actions/public/estimateMaxPriorityFeePerGas.ts 100.00% <100.00%> (+23.46%) ⬆️
src/actions/public/watchContractEvent.ts 99.69% <100.00%> (+34.37%) ⬆️
src/actions/wallet/prepareTransactionRequest.ts 100.00% <100.00%> (ø)
src/actions/wallet/sendRawTransaction.ts 100.00% <100.00%> (ø)
src/actions/wallet/sendTransaction.ts 100.00% <100.00%> (+22.51%) ⬆️
src/actions/wallet/signTransaction.ts 100.00% <100.00%> (ø)
src/chains/celo/formatters.ts 100.00% <100.00%> (+24.70%) ⬆️
... and 11 more

... and 115 files with indirect coverage changes

@insulineru
Copy link

It would be cool if the same could be done for writeContract methods. I came across this recently and couldn't think of anything better than to patch the estimateGas method in the library, because in one of the internal scripts it was necessary to increase the gas by 50% for all writeContract methods. Wrapping all calls to estimateGas + simulation + tx modifications turned out to be a big evil for me :D

@jxom
Copy link
Member Author

jxom commented Aug 25, 2023

@insulineru - could you call estimateContractGas, derive the gas from that, and then pass it to writeContract?

@jxom jxom merged commit 533b590 into main Aug 27, 2023
@jxom jxom deleted the jxom/sign-txn branch August 27, 2023 21:40
@github-actions github-actions bot mentioned this pull request Aug 27, 2023
@holic holic mentioned this pull request Oct 3, 2023
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