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

export signTransaction, update docs #984

Merged
merged 3 commits into from
Aug 10, 2023

Conversation

holic
Copy link
Contributor

@holic holic commented Aug 4, 2023

PR-Codex overview

Focus of this PR:

This PR focuses on adding new exports to the viem/accounts entrypoint, specifically signTransaction and privateKeyToAddress.

Detailed summary:

  • Added signTransaction and privateKeyToAddress exports to viem/accounts entrypoint.
  • Updated imports in site/docs/accounts/signMessage.md and site/docs/accounts/signTypedData.md.
  • Added new test for privateKeyToAddress in src/accounts/utils/privateKeyToAddress.test.ts.
  • Updated src/accounts/utils/signTransaction.ts to use SignTransactionParameters type.
  • Updated imports in site/docs/accounts/custom.md and site/docs/accounts/signTransaction.md.
  • Added privateKeyToAddress export to src/accounts/index.ts.

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

@changeset-bot
Copy link

changeset-bot bot commented Aug 4, 2023

🦋 Changeset detected

Latest commit: 55ccd86

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 Aug 4, 2023

@holic is attempting to deploy a commit to the wagmi Team on Vercel.

A member of the Team first needs to authorize it.

@@ -25,10 +25,9 @@ import { toAccount } from 'viem/accounts'
## Usage

```ts
import { createWalletClient, http } from 'viem'
import { toAccount } from 'viem/accounts' // [!code focus]
import { createWalletClient, getAddress, http } from 'viem'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved getAddress to a real import but this doesn't actually work for turning a private key into an address. Does viem need a helper for this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be worth adding a privateKeyToAddress util that just composes this. Similar to publicKeyToAddress.

@jxom jxom merged commit e1032c7 into wevm:main Aug 10, 2023
10 of 12 checks passed
@github-actions github-actions bot mentioned this pull request Aug 10, 2023
aaronmgdr pushed a commit to celo-org/viem that referenced this pull request Aug 18, 2023
)

* export signTransaction

* update docs

* refactor

---------

Co-authored-by: moxey.eth <[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