File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,11 @@ export default class Order
31
31
{
32
32
return getOrderHash ( order ) ;
33
33
}
34
+
35
+ storeDatasInShortTerm ( hash , origin )
36
+ {
37
+ return storeDatasInShortTerm ( this . host , hash , origin ) ;
38
+ }
34
39
}
35
40
36
41
/**
@@ -172,3 +177,32 @@ export function getOrderHash (order)
172
177
] ;
173
178
return soliditySHA3 ( orderTypes , orderData ) ;
174
179
}
180
+
181
+ /**
182
+ * @description Submit some datas to relay that will store in a short term (24H)
183
+ * @param host
184
+ * @param hash
185
+ * @param origin
186
+ * @returns {Promise.<*> }
187
+ */
188
+ export function storeDatasInShortTerm ( host , hash , origin )
189
+ {
190
+ try
191
+ {
192
+ validator . validate ( { value : hash , type : 'STRING' } ) ;
193
+ validator . validate ( { value : origin , type : 'STRING' } ) ;
194
+ }
195
+ catch ( e )
196
+ {
197
+ return Promise . resolve ( new Response ( code . PARAM_INVALID . code , code . PARAM_INVALID . msg ) ) ;
198
+ }
199
+ const body = { } ;
200
+ body . method = 'loopring_setOrderTransfer' ;
201
+ body . params = [ { hash, origin} ] ;
202
+ body . id = id ( ) ;
203
+ body . jsonrpc = '2.0' ;
204
+ return request ( host , {
205
+ method : 'post' ,
206
+ body
207
+ } ) ;
208
+ }
You can’t perform that action at this time.
0 commit comments