-
Notifications
You must be signed in to change notification settings - Fork 123
feat: add signMessage utility with multi-chain support #34
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
base: main
Are you sure you want to change the base?
Conversation
Hi @0binna-oss , this looks good! But can you follow the same pattern as the existing method? Please put the sign for Solana in |
|
Good day @iamnotstatic , will look into it as soon as possible. |
|
Good day @iamnotstatic , I've restructured the code as requested. Please review |
| } | ||
| ``` | ||
|
|
||
| ### Signing Message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @0binna-oss, this readme is not following the existing structure Can you update it ?
README.md
Outdated
| const solanaSignature = await signMessage("hello", solanaKey, "solana"); | ||
|
|
||
|
|
||
| ### Updated Implementation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i beleive this was suppose to be a commit message not for the documentation
src/utils/signMessage.js
Outdated
| import { ethers } from "ethers"; | ||
| import { Keypair } from "@solana/web3.js"; | ||
|
|
||
| export async function signMessage(message, privateKey, chainType = "evm") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need this, it should reference the src/services/wallet/index.ts just like every other function
test/ethereumHelper.test.ts
Outdated
| @@ -0,0 +1,21 @@ | |||
| import { signEvmMessage } from "../src/common/helpers/ethereumHelper"; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let the test be directly in the dedicated test file for everything chain
wallet.ethereum.test.ts
wallet.solana.test.ts
Thanks for the update @0binna-oss, dropped some comments |
|
Good day @iamnotstatic, made updates as requested. |
Description
Adds a
signMessageutility to sign messages with a private key (EVM supported) .Please include a summary of the changes and be sure to follow our Contribution Guidelines.
Type of change/Updated Implementation:
ethereumHelper.tsandsolanaHelper.tsas requestedsignMessage.tsChecklist:
npm run testand my test cases cover all the lines and branches of the added code.npm run buildwith success.