JavaScript Crypto helpers for Sorare
@sorare/crypto
is a JavaScript library (TypeScript types included) providing various crypto functions to be used to sign your Sorare LimitOrder objects in order to make a bid, create or accept an offer. It can be used in both NodeJS and Browser environments.
Functions
signLimitOrder
The signLimitOrder(privateKey, limitOrder)
function is used to sign a LimitOrder
object with a Sorare private key.
import { signLimitOrder } from '@sorare/crypto';
const privateKey = ;
const limitOrder = ;
const signature = signLimitOrder(privateKey, limitOrder);
C++ bindings
Starting from v1.2.0, C++ bindings can be used for faster verifyTransfer
and verifyLimitOrder
operations. It uses Starkware's crypto-cpp library and can be enabled by adding USE_STARKWARE_CRYPTO_CPP=true
to your env. Please also note that yarn install
will build C++ bindings (using node-gyp) starting from this version.
License
@sorare/crypto
is MIT licensed.