1
- import { ADDRESS , FELT , SIGNATURE , TXN_HASH } from '../api/components' ;
1
+ import { ADDRESS , FELT , SIGNATURE } from '../api/components' ;
2
+ import { OutsideExecutionTypedData , TIME_BOUNDS } from '../wallet-api' ;
2
3
3
4
// ******************
4
5
// * PRIMITIVES
@@ -9,15 +10,7 @@ import { ADDRESS, FELT, SIGNATURE, TXN_HASH } from '../api/components';
9
10
* @pattern ^0x(0|[a-fA-F1-9]{1}[a-fA-F0-9]{0,63})$
10
11
*/
11
12
export type u256 = string ;
12
- /**
13
- * A string representing an unsigned integer
14
- * @pattern ^(0|[1-9]{1}[0-9]*)$
15
- */
16
- export type NUMERIC = string ;
17
- /**
18
- * UNIX time
19
- */
20
- export type TIMESTAMP = NUMERIC ;
13
+
21
14
/**
22
15
* The object that defines an invocation of a function in a contract
23
16
*/
@@ -26,87 +19,15 @@ export type CALL = {
26
19
selector : FELT ;
27
20
calldata : FELT [ ] ;
28
21
} ;
29
- /**
30
- * The transaction hash
31
- */
32
- export type TRANSACTION_HASH = TXN_HASH ;
22
+
33
23
/**
34
24
* A unique identifier corresponding to an `execute` request to the paymaster
35
25
*/
36
26
export type TRACKING_ID = FELT ;
37
- /**
38
- * "A typed data object (in the sense of SNIP-12) which represents an outside execution payload, according to SNIP-9
39
- */
40
- export type OUTSIDE_EXECUTION_TYPED_DATA =
41
- | OUTSIDE_EXECUTION_TYPED_DATA_V1
42
- | OUTSIDE_EXECUTION_TYPED_DATA_V2 ;
43
- export type OUTSIDE_EXECUTION_TYPED_DATA_V1 = {
44
- types : Record < string , STARKNET_TYPE [ ] > ;
45
- primaryType : string ;
46
- domain : STARKNET_DOMAIN ;
47
- message : OUTSIDE_EXECUTION_MESSAGE_V1 ;
48
- } ;
49
- export type OUTSIDE_EXECUTION_TYPED_DATA_V2 = {
50
- types : Record < string , STARKNET_TYPE [ ] > ;
51
- primaryType : string ;
52
- domain : STARKNET_DOMAIN ;
53
- message : OUTSIDE_EXECUTION_MESSAGE_V2 ;
54
- } ;
55
- /**
56
- * A single type, as part of a struct. The `type` field can be any of the EIP-712 supported types
57
- */
58
- export type STARKNET_TYPE =
59
- | {
60
- name : string ;
61
- type : string ;
62
- }
63
- | STARKNET_ENUM_TYPE
64
- | STARKNET_MERKLE_TYPE ;
65
- export type STARKNET_ENUM_TYPE = {
66
- name : string ;
67
- type : 'enum' ;
68
- contains : string ;
69
- } ;
70
- export type STARKNET_MERKLE_TYPE = {
71
- name : string ;
72
- type : 'merkletree' ;
73
- contains : string ;
74
- } ;
75
- /**
76
- * A single type, as part of a struct. The `type` field can be any of the EIP-712 supported types
77
- */
78
- export type STARKNET_DOMAIN = {
79
- name ?: string ;
80
- version ?: string ;
81
- chainId ?: string | number ;
82
- revision ?: string | number ;
83
- } ;
84
- export type OUTSIDE_EXECUTION_MESSAGE_V1 = {
85
- caller : FELT ;
86
- nonce : FELT ;
87
- execute_after : FELT ;
88
- execute_before : FELT ;
89
- calls_len : FELT ;
90
- calls : OUTSIDE_CALL_V1 [ ] ;
91
- } ;
92
- export type OUTSIDE_CALL_V1 = {
93
- to : ADDRESS ;
94
- selector : FELT ;
95
- calldata_len : FELT [ ] ;
96
- calldata : FELT [ ] ;
97
- } ;
98
- export type OUTSIDE_EXECUTION_MESSAGE_V2 = {
99
- Caller : FELT ;
100
- Nonce : FELT ;
101
- 'Execute After' : FELT ;
102
- 'Execute Before' : FELT ;
103
- Calls : OUTSIDE_CALL_V2 [ ] ;
104
- } ;
105
- export type OUTSIDE_CALL_V2 = {
106
- To : ADDRESS ;
107
- Selector : FELT ;
108
- Calldata : FELT [ ] ;
109
- } ;
27
+
28
+ // ******************
29
+ // * SNIP-29
30
+ // ******************
110
31
111
32
/**
112
33
* User transaction
@@ -146,7 +67,7 @@ export type EXECUTABLE_USER_INVOKE_TRANSACTION = {
146
67
} ;
147
68
export type EXECUTABLE_USER_INVOKE = {
148
69
user_address : ADDRESS ;
149
- typed_data : OUTSIDE_EXECUTION_TYPED_DATA ;
70
+ typed_data : OutsideExecutionTypedData ;
150
71
signature : SIGNATURE ;
151
72
} ;
152
73
export type EXECUTABLE_USER_DEPLOY_AND_INVOKE_TRANSACTION = {
@@ -187,13 +108,7 @@ export type ACCOUNT_DEPLOYMENT_DATA = {
187
108
sigdata ?: FELT [ ] ;
188
109
version : 1 ;
189
110
} ;
190
- /**
191
- * Object containing timestamps corresponding to `Execute After` and `Execute Before`
192
- */
193
- export type TIME_BOUNDS = {
194
- execute_after : TIMESTAMP ;
195
- execute_before : TIMESTAMP ;
196
- } ;
111
+
197
112
/**
198
113
* Object containing data about the token: contract address, number of decimals and current price in STRK
199
114
*/
0 commit comments