maintain nonce for users
Opened this issue · 3 comments
0xmountaintop commented
maintain nonce for users
lispc commented
in restapi or matchengine? Do we need to add this feature in our first demo version?
0xmountaintop commented
for demo, no.
But for L2 transfer/withdraw we need to sign the nonce.
0xmountaintop commented
BTW we also need to maintain "last_order_id" for user. so that he can sign
OrderInput
...
hash(): bigint {
// although there is no 'TxType.PlaceOrder' now, we can see it as a 'SignType'
let data = hash([TxType.PlaceOrder, this.orderId, this.tokenSell, this.tokenBuy, this.totalSell, this.totalBuy]);
//data = hash([data, accountID, nonce]);
// nonce and orderID seems redundant?
data = hash([data, this.accountID]);
return data;
}
signWith(account: Account) {
this.sig = account.signHash(this.hash());
}