lukso-network / tools-eip191-signer

Used to sign an EIP191 Execute Relay Call transaction.
Apache License 2.0
2 stars 4 forks source link

Allow passing multiple parameters to be hashed #17

Open CallumGrindle opened 2 years ago

CallumGrindle commented 2 years ago

Feature Request

When signing an LSP6ExecuteRelayCall transaction it would be useful to be able to pass multiple parameters to be hashed.

Currently sign only accepts 1 string parameter to be signed which means developers need to hash executeRelayCall parameters using some other soliditySha3 utils function from a separate library before using lsp6-signer.js.

e.g:

const message = web3.utils.soliditySha3(chainId, keyManagerAddress, nonce, {
  t: 'bytes',
  v: abiPayload,
});

const signature = lsp6Signer.sign(message, PRIVATE_KEY);

It would be useful if lsp6-signer could do all of this so the separate library was not needed

e.g.

const signature = lsp6Signer.hashAndSign(chainId, keyManagerAddress, nonce, abiPayload, PRIVATE_KEY)
Hugoo commented 2 years ago

Let's ask @frozeman feedback