mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-15 22:52:36 +03:00
fix: bigint errors fix: TS errors fix: gasLimit fetch fix: review comments fix: contracts errors chore: bump rc version fix: revert wrong fix fix: ts config fix: ts config fix: ts config feat: update signer
36 lines
635 B
TypeScript
36 lines
635 B
TypeScript
import { ethers } from 'ethers';
|
|
import type { Order } from '../types.js';
|
|
|
|
const hashOrder = (order: Order) => ethers.solidityPackedKeccak256(
|
|
[
|
|
'uint8',
|
|
'address',
|
|
'address',
|
|
'address',
|
|
'address',
|
|
'address',
|
|
'uint64',
|
|
'uint64',
|
|
'uint64',
|
|
'uint64',
|
|
'uint64',
|
|
'uint8',
|
|
],
|
|
[
|
|
'0x03',
|
|
order.senderAddress,
|
|
order.matcherAddress,
|
|
order.baseAsset,
|
|
order.quoteAsset,
|
|
order.matcherFeeAsset,
|
|
order.amount,
|
|
order.price,
|
|
order.matcherFee,
|
|
order.nonce,
|
|
order.expiration,
|
|
order.buySide === 1 ? '0x01' : '0x00',
|
|
],
|
|
);
|
|
|
|
export default hashOrder;
|