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: add ability to hash data representation of message #610

Merged
merged 3 commits into from
Jun 1, 2023

Conversation

jxom
Copy link
Member

@jxom jxom commented May 30, 2023

PR-Codex overview

This PR adds the ability to hash data representation of messages in sign, verify, and recover functions. It also updates related functions to accept a SignableMessage type instead of a string.

await walletClient.signMessage({
  message: { raw: '0x68656c6c6f20776f726c64' }
})

Detailed summary

  • Adds SignableMessage type to misc.ts
  • Adds raw attribute to SignableMessage
  • Updates signMessage, verifyMessage, and recoverMessageAddress to accept SignableMessage
  • Updates hashMessage to accept SignableMessage
  • Adds support for hashing bytes data values in hashMessage
  • Updates verifyMessage to accept SignableMessage and adds example for using raw attribute in verification
  • Updates ethersWalletToAccount to support SignableMessage in signMessage
  • Updates signMessage to support SignableMessage and adds example for using raw attribute in signing
  • Updates related tests to use SignableMessage and test raw attribute

The following files were skipped due to too many changes: src/utils/signature/hashMessage.test.ts, site/docs/actions/wallet/signMessage.md, site/docs/actions/public/verifyMessage.md

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

@changeset-bot
Copy link

changeset-bot bot commented May 30, 2023

🦋 Changeset detected

Latest commit: 6fc2f08

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

@vercel
Copy link

vercel bot commented May 30, 2023

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

Name Status Preview Comments Updated (UTC)
viem ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 1, 2023 4:03am

@github-actions
Copy link
Contributor

github-actions bot commented May 30, 2023

Size Change: +454 B (0%)

Total Size: 254 kB

Filename Size Change
dist/cjs/actions/wallet/signMessage.js 517 B +75 B (+17%) ⚠️
dist/cjs/adapters/ethers.js 710 B +75 B (+12%) ⚠️
dist/cjs/utils/signature/hashMessage.js 421 B +75 B (+22%) 🚨
dist/esm/actions/wallet/signMessage.js 434 B +78 B (+22%) 🚨
dist/esm/adapters/ethers.js 632 B +77 B (+14%) ⚠️
dist/esm/utils/signature/hashMessage.js 330 B +74 B (+29%) 🚨
ℹ️ 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 742 B
dist/cjs/accounts/mnemonicToAccount.js 296 B
dist/cjs/accounts/privateKeyToAccount.js 496 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/publicKeyToAddress.js 298 B
dist/cjs/accounts/utils/sign.js 332 B
dist/cjs/accounts/utils/signatureToHex.js 331 B
dist/cjs/accounts/utils/signMessage.js 302 B
dist/cjs/accounts/utils/signTransaction.js 331 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 707 B
dist/cjs/actions/ens/getEnsAvatar.js 390 B
dist/cjs/actions/ens/getEnsName.js 786 B
dist/cjs/actions/ens/getEnsResolver.js 599 B
dist/cjs/actions/ens/getEnsText.js 691 B
dist/cjs/actions/getContract.js 1.07 kB
dist/cjs/actions/public/call.js 1.82 kB
dist/cjs/actions/public/createBlockFilter.js 320 B
dist/cjs/actions/public/createContractEventFilter.js 541 B
dist/cjs/actions/public/createEventFilter.js 585 B
dist/cjs/actions/public/createPendingTransactionFilter.js 326 B
dist/cjs/actions/public/estimateContractGas.js 507 B
dist/cjs/actions/public/estimateGas.js 843 B
dist/cjs/actions/public/getBalance.js 350 B
dist/cjs/actions/public/getBlock.js 523 B
dist/cjs/actions/public/getBlockNumber.js 388 B
dist/cjs/actions/public/getBlockTransactionCount.js 429 B
dist/cjs/actions/public/getBytecode.js 369 B
dist/cjs/actions/public/getChainId.js 280 B
dist/cjs/actions/public/getFeeHistory.js 406 B
dist/cjs/actions/public/getFilterChanges.js 489 B
dist/cjs/actions/public/getFilterLogs.js 464 B
dist/cjs/actions/public/getGasPrice.js 232 B
dist/cjs/actions/public/getLogs.js 656 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 384 B
dist/cjs/actions/public/multicall.js 1.16 kB
dist/cjs/actions/public/readContract.js 477 B
dist/cjs/actions/public/simulateContract.js 631 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 337 B
dist/cjs/actions/public/waitForTransactionReceipt.js 1.2 kB
dist/cjs/actions/public/watchBlockNumber.js 887 B
dist/cjs/actions/public/watchBlocks.js 929 B
dist/cjs/actions/public/watchContractEvent.js 905 B
dist/cjs/actions/public/watchEvent.js 844 B
dist/cjs/actions/public/watchPendingTransactions.js 911 B
dist/cjs/actions/test/dropTransaction.js 233 B
dist/cjs/actions/test/getAutomine.js 218 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 299 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 311 B
dist/cjs/actions/test/setAutomine.js 227 B
dist/cjs/actions/test/setBalance.js 293 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 952 B
dist/cjs/actions/wallet/signTypedData.js 739 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.js 1.6 kB
dist/cjs/clients/createClient.js 347 B
dist/cjs/clients/createPublicClient.js 357 B
dist/cjs/clients/createTestClient.js 353 B
dist/cjs/clients/createWalletClient.js 431 B
dist/cjs/clients/decorators/public.js 1.08 kB
dist/cjs/clients/decorators/test.js 890 B
dist/cjs/clients/decorators/wallet.js 518 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 563 B
dist/cjs/clients/transports/webSocket.js 836 B
dist/cjs/constants/abis.js 604 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/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.13 kB
dist/cjs/errors/account.js 422 B
dist/cjs/errors/address.js 300 B
dist/cjs/errors/base.js 975 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 1.85 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.61 kB
dist/cjs/errors/request.js 691 B
dist/cjs/errors/rpc.js 1.51 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 150 B
dist/cjs/ethers.js 224 B
dist/cjs/index.js 4.75 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/formatter.js 127 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.02 kB
dist/cjs/utils/abi/decodeFunctionData.js 525 B
dist/cjs/utils/abi/decodeFunctionResult.js 484 B
dist/cjs/utils/abi/encodeAbiParameters.js 1.75 kB
dist/cjs/utils/abi/encodeDeployData.js 470 B
dist/cjs/utils/abi/encodeErrorResult.js 570 B
dist/cjs/utils/abi/encodeEventTopics.js 850 B
dist/cjs/utils/abi/encodeFunctionData.js 566 B
dist/cjs/utils/abi/encodeFunctionResult.js 512 B
dist/cjs/utils/abi/encodePacked.js 889 B
dist/cjs/utils/abi/formatAbiItem.js 488 B
dist/cjs/utils/abi/formatAbiItemWithArgs.js 386 B
dist/cjs/utils/abi/getAbiItem.js 920 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 966 B
dist/cjs/utils/ccip.js 1.26 kB
dist/cjs/utils/chain.js 465 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.07 kB
dist/cjs/utils/ens/labelhash.js 318 B
dist/cjs/utils/ens/namehash.js 427 B
dist/cjs/utils/ens/normalize.js 217 B
dist/cjs/utils/ens/packetToBytes.js 440 B
dist/cjs/utils/errors/getCallError.js 317 B
dist/cjs/utils/errors/getContractError.js 585 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 508 B
dist/cjs/utils/formatters/extract.js 280 B
dist/cjs/utils/formatters/feeHistory.js 273 B
dist/cjs/utils/formatters/format.js 309 B
dist/cjs/utils/formatters/log.js 306 B
dist/cjs/utils/formatters/transaction.js 611 B
dist/cjs/utils/formatters/transactionReceipt.js 556 B
dist/cjs/utils/formatters/transactionRequest.js 402 B
dist/cjs/utils/hash/getEventSelector.js 210 B
dist/cjs/utils/hash/getFunctionSelector.js 235 B
dist/cjs/utils/hash/hashFunction.js 359 B
dist/cjs/utils/hash/isHash.js 239 B
dist/cjs/utils/hash/keccak256.js 354 B
dist/cjs/utils/index.js 2.92 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 520 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.68 kB
dist/cjs/utils/signature/hashTypedData.js 1.35 kB
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/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 876 B
dist/cjs/utils/transaction/serializeTransaction.js 1.07 kB
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 465 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 146 B
dist/esm/accounts/generatePrivateKey.js 185 B
dist/esm/accounts/hdKeyToAccount.js 290 B
dist/esm/accounts/index.js 326 B
dist/esm/accounts/mnemonicToAccount.js 214 B
dist/esm/accounts/privateKeyToAccount.js 386 B
dist/esm/accounts/toAccount.js 313 B
dist/esm/accounts/types.js 64 B
dist/esm/accounts/utils/parseAccount.js 157 B
dist/esm/accounts/utils/publicKeyToAddress.js 214 B
dist/esm/accounts/utils/sign.js 252 B
dist/esm/accounts/utils/signatureToHex.js 244 B
dist/esm/accounts/utils/signMessage.js 213 B
dist/esm/accounts/utils/signTransaction.js 239 B
dist/esm/accounts/utils/signTypedData.js 226 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 601 B
dist/esm/actions/ens/getEnsAvatar.js 308 B
dist/esm/actions/ens/getEnsName.js 694 B
dist/esm/actions/ens/getEnsResolver.js 507 B
dist/esm/actions/ens/getEnsText.js 591 B
dist/esm/actions/getContract.js 956 B
dist/esm/actions/public/call.js 1.66 kB
dist/esm/actions/public/createBlockFilter.js 240 B
dist/esm/actions/public/createContractEventFilter.js 451 B
dist/esm/actions/public/createEventFilter.js 494 B
dist/esm/actions/public/createPendingTransactionFilter.js 246 B
dist/esm/actions/public/estimateContractGas.js 410 B
dist/esm/actions/public/estimateGas.js 728 B
dist/esm/actions/public/getBalance.js 277 B
dist/esm/actions/public/getBlock.js 430 B
dist/esm/actions/public/getBlockNumber.js 306 B
dist/esm/actions/public/getBlockTransactionCount.js 345 B
dist/esm/actions/public/getBytecode.js 296 B
dist/esm/actions/public/getChainId.js 199 B
dist/esm/actions/public/getFeeHistory.js 326 B
dist/esm/actions/public/getFilterChanges.js 408 B
dist/esm/actions/public/getFilterLogs.js 382 B
dist/esm/actions/public/getGasPrice.js 164 B
dist/esm/actions/public/getLogs.js 560 B
dist/esm/actions/public/getStorageAt.js 283 B
dist/esm/actions/public/getTransaction.js 472 B
dist/esm/actions/public/getTransactionConfirmations.js 283 B
dist/esm/actions/public/getTransactionCount.js 276 B
dist/esm/actions/public/getTransactionReceipt.js 301 B
dist/esm/actions/public/multicall.js 1.06 kB
dist/esm/actions/public/readContract.js 381 B
dist/esm/actions/public/simulateContract.js 535 B
dist/esm/actions/public/uninstallFilter.js 164 B
dist/esm/actions/public/verifyHash.js 455 B
dist/esm/actions/public/verifyMessage.js 228 B
dist/esm/actions/public/verifyTypedData.js 254 B
dist/esm/actions/public/waitForTransactionReceipt.js 1.1 kB
dist/esm/actions/public/watchBlockNumber.js 791 B
dist/esm/actions/public/watchBlocks.js 838 B
dist/esm/actions/public/watchContractEvent.js 799 B
dist/esm/actions/public/watchEvent.js 747 B
dist/esm/actions/public/watchPendingTransactions.js 820 B
dist/esm/actions/test/dropTransaction.js 163 B
dist/esm/actions/test/getAutomine.js 150 B
dist/esm/actions/test/getTxpoolContent.js 149 B
dist/esm/actions/test/getTxpoolStatus.js 232 B
dist/esm/actions/test/impersonateAccount.js 170 B
dist/esm/actions/test/increaseTime.js 210 B
dist/esm/actions/test/inspectTxpool.js 146 B
dist/esm/actions/test/mine.js 224 B
dist/esm/actions/test/removeBlockTimestampInterval.js 159 B
dist/esm/actions/test/reset.js 193 B
dist/esm/actions/test/revert.js 151 B
dist/esm/actions/test/sendUnsignedTransaction.js 233 B
dist/esm/actions/test/setAutomine.js 157 B
dist/esm/actions/test/setBalance.js 218 B
dist/esm/actions/test/setBlockGasLimit.js 209 B
dist/esm/actions/test/setBlockTimestampInterval.js 176 B
dist/esm/actions/test/setCode.js 169 B
dist/esm/actions/test/setCoinbase.js 165 B
dist/esm/actions/test/setIntervalMining.js 164 B
dist/esm/actions/test/setLoggingEnabled.js 166 B
dist/esm/actions/test/setMinGasPrice.js 212 B
dist/esm/actions/test/setNextBlockBaseFeePerGas.js 227 B
dist/esm/actions/test/setNextBlockTimestamp.js 216 B
dist/esm/actions/test/setNonce.js 215 B
dist/esm/actions/test/setRpcUrl.js 161 B
dist/esm/actions/test/setStorageAt.js 257 B
dist/esm/actions/test/snapshot.js 140 B
dist/esm/actions/test/stopImpersonatingAccount.js 175 B
dist/esm/actions/wallet/addChain.js 357 B
dist/esm/actions/wallet/deployContract.js 244 B
dist/esm/actions/wallet/getAddresses.js 207 B
dist/esm/actions/wallet/getPermissions.js 157 B
dist/esm/actions/wallet/requestAddresses.js 203 B
dist/esm/actions/wallet/requestPermissions.js 161 B
dist/esm/actions/wallet/sendTransaction.js 829 B
dist/esm/actions/wallet/signTypedData.js 648 B
dist/esm/actions/wallet/switchChain.js 232 B
dist/esm/actions/wallet/watchAsset.js 168 B
dist/esm/actions/wallet/writeContract.js 305 B
dist/esm/chains.js 1.16 kB
dist/esm/clients/createClient.js 273 B
dist/esm/clients/createPublicClient.js 275 B
dist/esm/clients/createTestClient.js 271 B
dist/esm/clients/createWalletClient.js 339 B
dist/esm/clients/decorators/public.js 864 B
dist/esm/clients/decorators/test.js 712 B
dist/esm/clients/decorators/wallet.js 407 B
dist/esm/clients/transports/createTransport.js 235 B
dist/esm/clients/transports/custom.js 265 B
dist/esm/clients/transports/fallback.js 1.24 kB
dist/esm/clients/transports/http.js 487 B
dist/esm/clients/transports/webSocket.js 759 B
dist/esm/constants/abis.js 520 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/solidity.js 486 B
dist/esm/constants/unit.js 127 B
dist/esm/contract.js 388 B
dist/esm/ens.js 189 B
dist/esm/errors/abi.js 1.78 kB
dist/esm/errors/account.js 361 B
dist/esm/errors/address.js 245 B
dist/esm/errors/base.js 921 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.69 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.46 kB
dist/esm/errors/request.js 587 B
dist/esm/errors/rpc.js 1.22 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 83 B
dist/esm/ethers.js 104 B
dist/esm/index.js 2.29 kB
dist/esm/public.js 382 B
dist/esm/test.js 431 B
dist/esm/types/account.js 88 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 238 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/formatter.js 68 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 1.48 kB
dist/esm/utils/abi/decodeDeployData.js 388 B
dist/esm/utils/abi/decodeErrorResult.js 502 B
dist/esm/utils/abi/decodeEventLog.js 946 B
dist/esm/utils/abi/decodeFunctionData.js 426 B
dist/esm/utils/abi/decodeFunctionResult.js 404 B
dist/esm/utils/abi/encodeAbiParameters.js 1.64 kB
dist/esm/utils/abi/encodeDeployData.js 389 B
dist/esm/utils/abi/encodeErrorResult.js 476 B
dist/esm/utils/abi/encodeEventTopics.js 742 B
dist/esm/utils/abi/encodeFunctionData.js 462 B
dist/esm/utils/abi/encodeFunctionResult.js 429 B
dist/esm/utils/abi/encodePacked.js 819 B
dist/esm/utils/abi/formatAbiItem.js 400 B
dist/esm/utils/abi/formatAbiItemWithArgs.js 307 B
dist/esm/utils/abi/getAbiItem.js 835 B
dist/esm/utils/accounts.js 127 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 938 B
dist/esm/utils/ccip.js 1.14 kB
dist/esm/utils/chain.js 376 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 176 B
dist/esm/utils/data/slice.js 485 B
dist/esm/utils/data/trim.js 350 B
dist/esm/utils/encoding/fromBytes.js 512 B
dist/esm/utils/encoding/fromHex.js 661 B
dist/esm/utils/encoding/fromRlp.js 835 B
dist/esm/utils/encoding/toBytes.js 647 B
dist/esm/utils/encoding/toHex.js 814 B
dist/esm/utils/encoding/toRlp.js 444 B
dist/esm/utils/ens/avatar/parseAvatarRecord.js 553 B
dist/esm/utils/ens/avatar/utils.js 1.95 kB
dist/esm/utils/ens/labelhash.js 234 B
dist/esm/utils/ens/namehash.js 331 B
dist/esm/utils/ens/normalize.js 138 B
dist/esm/utils/ens/packetToBytes.js 360 B
dist/esm/utils/errors/getCallError.js 240 B
dist/esm/utils/errors/getContractError.js 521 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 268 B
dist/esm/utils/formatters/block.js 433 B
dist/esm/utils/formatters/extract.js 224 B
dist/esm/utils/formatters/feeHistory.js 206 B
dist/esm/utils/formatters/format.js 234 B
dist/esm/utils/formatters/log.js 236 B
dist/esm/utils/formatters/transaction.js 534 B
dist/esm/utils/formatters/transactionReceipt.js 473 B
dist/esm/utils/formatters/transactionRequest.js 328 B
dist/esm/utils/hash/getEventSelector.js 132 B
dist/esm/utils/hash/getFunctionSelector.js 158 B
dist/esm/utils/hash/hashFunction.js 274 B
dist/esm/utils/hash/isHash.js 154 B
dist/esm/utils/hash/keccak256.js 266 B
dist/esm/utils/index.js 1.15 kB
dist/esm/utils/observe.js 468 B
dist/esm/utils/poll.js 309 B
dist/esm/utils/promise/createBatchScheduler.js 562 B
dist/esm/utils/promise/withCache.js 441 B
dist/esm/utils/promise/withRetry.js 382 B
dist/esm/utils/promise/withTimeout.js 358 B
dist/esm/utils/regex.js 224 B
dist/esm/utils/rpc.js 1.59 kB
dist/esm/utils/signature/hashTypedData.js 1.25 kB
dist/esm/utils/signature/recoverAddress.js 198 B
dist/esm/utils/signature/recoverMessageAddress.js 180 B
dist/esm/utils/signature/recoverPublicKey.js 388 B
dist/esm/utils/signature/recoverTypedDataAddress.js 223 B
dist/esm/utils/signature/verifyMessage.js 207 B
dist/esm/utils/signature/verifyTypedData.js 250 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 768 B
dist/esm/utils/transaction/serializeTransaction.js 958 B
dist/esm/utils/typedData.js 667 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 396 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 May 30, 2023

Codecov Report

Merging #610 (6fc2f08) into main (c47bf19) will decrease coverage by 0.02%.
The diff coverage is 92.50%.

@@            Coverage Diff             @@
##             main     #610      +/-   ##
==========================================
- Coverage   99.92%   99.91%   -0.02%     
==========================================
  Files         259      259              
  Lines       24151    24173      +22     
  Branches     2006     2013       +7     
==========================================
+ Hits        24134    24153      +19     
- Misses         17       20       +3     
Impacted Files Coverage Δ
src/adapters/ethers.ts 94.94% <57.14%> (-2.93%) ⬇️
src/accounts/types.ts 100.00% <100.00%> (ø)
src/accounts/utils/signMessage.ts 100.00% <100.00%> (ø)
src/actions/public/verifyMessage.ts 100.00% <100.00%> (ø)
src/actions/wallet/signMessage.ts 100.00% <100.00%> (ø)
src/types/misc.ts 100.00% <100.00%> (ø)
src/utils/signature/hashMessage.ts 100.00% <100.00%> (ø)
src/utils/signature/recoverMessageAddress.ts 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

@jxom jxom requested a review from tmm May 30, 2023 23:48
@moldy530
Copy link
Contributor

this is great! thanks for tackling this so quickly

@jxom jxom changed the base branch from 1.0 to main June 1, 2023 03:52
@jxom jxom merged commit 06ee89c into main Jun 1, 2023
@jxom jxom deleted the jxom/hash-data-message branch June 1, 2023 21:07
@github-actions github-actions bot mentioned this pull request Jun 1, 2023
jxom added a commit that referenced this pull request Jun 2, 2023
* feat: add ability to hash data representation of message

Co-authored-by: moldy <[email protected]>

* chore: changeset

* feat: ethers adapter

---------

Co-authored-by: moldy <[email protected]>
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