Skip to content

Commit e44e3e5

Browse files
committed
feat: 🎸 Added EIP712 typed data schema for Offer and Voucher
1 parent e244f17 commit e44e3e5

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

package/src/constants.ts

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,67 @@ export const OFFER_TYPE_HASH =
3737
// );
3838
export const CHECK_IN_TYPE_HASH =
3939
'0xf811d7f3ddb148410001929e2cbfb7fea8779b9349b7c2f650fa91840528d69c';
40+
41+
/** EIP-712 JSON schema types for offer */
42+
export const offerEip712Types = {
43+
Offer: [
44+
{
45+
name: 'id',
46+
type: 'bytes32',
47+
},
48+
{
49+
name: 'expire',
50+
type: 'uint256',
51+
},
52+
{
53+
name: 'supplierId',
54+
type: 'bytes32',
55+
},
56+
{
57+
name: 'chainId',
58+
type: 'uint256',
59+
},
60+
{
61+
name: 'requestHash',
62+
type: 'bytes32',
63+
},
64+
{
65+
name: 'optionsHash',
66+
type: 'bytes32',
67+
},
68+
{
69+
name: 'paymentHash',
70+
type: 'bytes32',
71+
},
72+
{
73+
name: 'cancelHash',
74+
type: 'bytes32',
75+
},
76+
{
77+
name: 'transferable',
78+
type: 'bool',
79+
},
80+
{
81+
name: 'checkIn',
82+
type: 'uint256',
83+
},
84+
{
85+
name: 'checkOut',
86+
type: 'uint256',
87+
},
88+
],
89+
} as const;
90+
91+
/** EIP-712 JSON schema types for checkIn/Out voucher */
92+
export const checkInOutEip712Types = {
93+
Voucher: [
94+
{
95+
name: 'id',
96+
type: 'bytes32',
97+
},
98+
{
99+
name: 'signer',
100+
type: 'address',
101+
},
102+
],
103+
} as const;

0 commit comments

Comments
 (0)