Implement a utility helper class that ease dealing with Ethereum Signature and support something similar to `ethers.Signature.from({r, s, v} | string)`
Implement a utility helper class that ease dealing with Ethereum Signature and support something similar to `ethers.Signature.from({r, s, v} | string).
(The new class would be used at: https://github.com/web3/web3-plugin-zksync/blob/758df6f2cf324a7c8e17730672f2ce0a831d407b/src/utils.ts#L499 and https://github.com/web3/web3-plugin-zksync/blob/758df6f2cf324a7c8e17730672f2ce0a831d407b/src/utils.ts#L737)
hello sir, sir are { r, s, v } signature variables generated from Externally Owned Accounts's private keys and used for digital signature creation and verification?
and are asking for a helper class sort of like this
class SignatureHelper { static from(input) { if (typeof input === 'string') { return this.fromString(input); } else if (typeof input === 'object' && input.r && input.s && input.v !== undefined) { return this.fromObject(input); } else { throw new Error('Invalid input format for Signature'); } }
Add outside test cases
For reference: SignatureObject
And: https://docs.ethers.org/v6/api/crypto/#Signature_from
Need to add to this the migration guide, next.