-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Expand file tree
/
Copy patheip712-types.js
More file actions
78 lines (76 loc) · 2.2 KB
/
eip712-types.js
File metadata and controls
78 lines (76 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
const { mapValues } = require('./iterate');
const formatType = schema => Object.entries(schema).map(([name, type]) => ({ name, type }));
module.exports = mapValues(
{
EIP712Domain: {
name: 'string',
version: 'string',
chainId: 'uint256',
verifyingContract: 'address',
salt: 'bytes32',
},
Permit: { owner: 'address', spender: 'address', value: 'uint256', nonce: 'uint256', deadline: 'uint256' },
TransferWithAuthorization: {
from: 'address',
to: 'address',
value: 'uint256',
validAfter: 'uint256',
validBefore: 'uint256',
nonce: 'bytes32',
},
ReceiveWithAuthorization: {
from: 'address',
to: 'address',
value: 'uint256',
validAfter: 'uint256',
validBefore: 'uint256',
nonce: 'bytes32',
},
CancelAuthorization: { authorizer: 'address', nonce: 'bytes32' },
Ballot: { proposalId: 'uint256', support: 'uint8', voter: 'address', nonce: 'uint256' },
ExtendedBallot: {
proposalId: 'uint256',
support: 'uint8',
voter: 'address',
nonce: 'uint256',
reason: 'string',
params: 'bytes',
},
OverrideBallot: { proposalId: 'uint256', support: 'uint8', voter: 'address', nonce: 'uint256', reason: 'string' },
Delegation: { delegatee: 'address', nonce: 'uint256', expiry: 'uint256' },
ForwardRequest: {
from: 'address',
to: 'address',
value: 'uint256',
gas: 'uint256',
nonce: 'uint256',
deadline: 'uint48',
data: 'bytes',
},
PackedUserOperation: {
sender: 'address',
nonce: 'uint256',
initCode: 'bytes',
callData: 'bytes',
accountGasLimits: 'bytes32',
preVerificationGas: 'uint256',
gasFees: 'bytes32',
paymasterAndData: 'bytes',
},
UserOperationRequest: {
sender: 'address',
nonce: 'uint256',
initCode: 'bytes',
callData: 'bytes',
accountGasLimits: 'bytes32',
preVerificationGas: 'uint256',
gasFees: 'bytes32',
paymasterVerificationGasLimit: 'uint256',
paymasterPostOpGasLimit: 'uint256',
validAfter: 'uint48',
validUntil: 'uint48',
},
},
formatType,
);
module.exports.formatType = formatType;