This repository is an appendix to the official discussion taking place on the official forum. Please start by reading it at this address: https://community.starknet.io/t/snip-off-chain-signatures-a-la-eip712 This repository might not be up-to-date, which is why, in doubt, always refer to the official discussion and feel free to open an Issue/PR.
The purpose of this repository is NOT to establish a set of standard interfaces but rather to present different cases and how to produce a hash that is compatible with StarknetJS. Although I tried to stay as close as possible to the terms used in EIP-712 and in the StarknetJS documentation
Note that each file can be taken as a standalone, which is why there some code is duplicated. The most simple case can be found here
Prerequisite: Have scarb installed through ASDF, a package manager, and node version <20
Check that you have the correct version of Scarb installed by running:
scarb build
Install the modules:
yarn
Once this is done, you can run the scarb test to make sure it is correct.
scarb test
If you need to see the hash produced by StarknetJS, refer to the Scarb.tom file:
scarb run SimpleStruct
This repository is released under the MIT License.