|
1 |
| -// ethers.utils.solidityKeccak256( |
| 1 | +import { utils, BigNumber } from 'ethers'; |
| 2 | + |
| 3 | +// utils.solidityKeccak256( |
2 | 4 | // ['string'],
|
3 | 5 | // ['PaymentOption(bytes32 id,uint256 price,address asset)'],
|
4 | 6 | // );
|
5 | 7 | export const PAYMENT_OPTION_TYPE_HASH =
|
6 | 8 | '0x2f8fc0b3ad3f58f6deb367673d38e4112a3c8c64de033c5b780b84ef8f67cde6';
|
7 | 9 |
|
8 |
| -// ethers.utils.solidityKeccak256( |
| 10 | +// utils.solidityKeccak256( |
9 | 11 | // ['string'],
|
10 | 12 | // ['CancelOption(uint256 time,uint256 penalty)'],
|
11 | 13 | // );
|
12 | 14 | export const CANCEL_OPTION_TYPE_HASH =
|
13 | 15 | '0x8ea27057ea8a0239f02c8b75748218a035a5a2a2a0785b53aaa99af91ff538c5';
|
14 | 16 |
|
15 |
| -// ethers.utils.solidityKeccak256( |
| 17 | +// utils.solidityKeccak256( |
16 | 18 | // ['string'],
|
17 | 19 | // [
|
18 | 20 | // 'Offer(bytes32 id,uint256 expire,bytes32 supplierId,uint256 chainId,bytes32 requestHash,bytes32 optionsHash,bytes32 paymentHash,bytes32 cancelHash,bool transferable,uint256 checkIn)',
|
19 | 21 | // ],
|
20 | 22 | // );
|
21 | 23 | export const OFFER_TYPE_HASH =
|
22 | 24 | '0xcf2addd2f89a78825d3f130a17e47b4e9963adfd09837fa9c454569faa073354';
|
| 25 | + |
| 26 | +// utils.solidityKeccak256( |
| 27 | +// ['string'], |
| 28 | +// [ |
| 29 | +// 'Voucher(bytes32 id,address signer)', |
| 30 | +// ], |
| 31 | +// ); |
| 32 | +export const CHECK_IN_TYPE_HASH = |
| 33 | + '0xf811d7f3ddb148410001929e2cbfb7fea8779b9349b7c2f650fa91840528d69c'; |
| 34 | + |
| 35 | +// Protocol entities types (kinds) as object |
| 36 | +export const kinds = { |
| 37 | + supplier: utils.formatBytes32String('supplier'), |
| 38 | + retailer: utils.formatBytes32String('retailer'), |
| 39 | +}; |
| 40 | + |
| 41 | +// Protocol entities types (kinds) as values array |
| 42 | +export const kindsArr = Object.values(kinds); |
| 43 | + |
| 44 | +// Protocol defaults |
| 45 | +export const eip712name = 'Market'; |
| 46 | +export const eip712version = '1'; |
| 47 | +export const minDeposit = BigNumber.from('1000000000000000000000'); |
| 48 | +export const claimPeriod = BigNumber.from('60'); |
| 49 | +export const protocolFee = BigNumber.from('1'); |
| 50 | +export const retailerFee = BigNumber.from('1'); |
0 commit comments