Closed wraitii closed 2 years ago
it's definitely something for starknet.js as we just implement their interface But this most likely won't change, as we want to allow apps to use structured signatures, so we don't have such a mess like they have in Ethereum world right now :)
But this most likely won't change, as we want to allow apps to use structured signatures, so we don't have such a mess like they have in Ethereum world right now :)
Then perhaps the typing should be more obvious? I couldn't find any 'doc' for this except for the usage in ArgentX :)
Here you go: https://eips.ethereum.org/EIPS/eip-712 Github discussion: https://github.com/argentlabs/argent-x/discussions/14
The
signMessage
API of the argent-X signer (I mean the in-browser JS code of the extension) requires passing a TypedData struct, of the following format:This is un-necessarily complex: the wallet should probably just take a message (possibly a domain name?). Furthermore, the UI fails to report errors if the wrong type of data is passed (it simply hangs). The UI also shows the whole struct when signing the message, but I assume that is somewhat related to this unexpected behaviour in the first place.
Edit: I should note that
starknet.js
Signer also expects TypedData, so maybe the API should instead be abstracted there somewhat?