@bosonprotocol/core-sdk 1.47.0-alpha.4 → 1.47.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/cjs/meta-tx/handler.d.ts +186 -0
  2. package/dist/cjs/meta-tx/handler.d.ts.map +1 -1
  3. package/dist/cjs/meta-tx/handler.js +170 -30
  4. package/dist/cjs/meta-tx/handler.js.map +1 -1
  5. package/dist/cjs/meta-tx/mixin.d.ts +182 -31
  6. package/dist/cjs/meta-tx/mixin.d.ts.map +1 -1
  7. package/dist/cjs/meta-tx/mixin.js +157 -169
  8. package/dist/cjs/meta-tx/mixin.js.map +1 -1
  9. package/dist/cjs/native-meta-tx/handler.d.ts +16 -3
  10. package/dist/cjs/native-meta-tx/handler.d.ts.map +1 -1
  11. package/dist/cjs/native-meta-tx/handler.js +16 -5
  12. package/dist/cjs/native-meta-tx/handler.js.map +1 -1
  13. package/dist/cjs/native-meta-tx/mixin.d.ts +11 -3
  14. package/dist/cjs/native-meta-tx/mixin.d.ts.map +1 -1
  15. package/dist/cjs/native-meta-tx/mixin.js +7 -9
  16. package/dist/cjs/native-meta-tx/mixin.js.map +1 -1
  17. package/dist/esm/meta-tx/handler.d.ts +186 -0
  18. package/dist/esm/meta-tx/handler.d.ts.map +1 -1
  19. package/dist/esm/meta-tx/handler.js +229 -48
  20. package/dist/esm/meta-tx/handler.js.map +1 -1
  21. package/dist/esm/meta-tx/mixin.d.ts +182 -31
  22. package/dist/esm/meta-tx/mixin.d.ts.map +1 -1
  23. package/dist/esm/meta-tx/mixin.js +380 -169
  24. package/dist/esm/meta-tx/mixin.js.map +1 -1
  25. package/dist/esm/native-meta-tx/handler.d.ts +16 -3
  26. package/dist/esm/native-meta-tx/handler.d.ts.map +1 -1
  27. package/dist/esm/native-meta-tx/handler.js +26 -6
  28. package/dist/esm/native-meta-tx/handler.js.map +1 -1
  29. package/dist/esm/native-meta-tx/mixin.d.ts +11 -3
  30. package/dist/esm/native-meta-tx/mixin.d.ts.map +1 -1
  31. package/dist/esm/native-meta-tx/mixin.js +12 -8
  32. package/dist/esm/native-meta-tx/mixin.js.map +1 -1
  33. package/package.json +2 -2
  34. package/src/meta-tx/handler.ts +808 -93
  35. package/src/meta-tx/mixin.ts +839 -64
  36. package/src/native-meta-tx/handler.ts +68 -18
  37. package/src/native-meta-tx/mixin.ts +30 -4
@@ -4,53 +4,88 @@ import { getOfferById } from "../offers/subgraph";
4
4
  import { BaseCoreSDK } from "./../mixins/base-core-sdk";
5
5
  import { accounts } from "..";
6
6
  export class MetaTxMixin extends BaseCoreSDK {
7
- /* -------------------------------------------------------------------------- */
8
- /* Meta Tx related methods */
9
- /* -------------------------------------------------------------------------- */
10
- /**
11
- * Encodes and signs a meta transaction that can be relayed.
12
- * @param args - Meta transaction args.
13
- * @returns Signature.
14
- */
7
+ // Implementation
15
8
  async signMetaTx(args) {
9
+ if (args.returnTypedDataToSign) {
10
+ return handler.signMetaTx({
11
+ web3Lib: this._web3Lib,
12
+ metaTxHandlerAddress: this._protocolDiamond,
13
+ chainId: this._chainId,
14
+ ...args,
15
+ returnTypedDataToSign: true
16
+ });
17
+ }
16
18
  return handler.signMetaTx({
17
19
  web3Lib: this._web3Lib,
18
20
  metaTxHandlerAddress: this._protocolDiamond,
19
21
  chainId: this._chainId,
20
- ...args
22
+ ...args,
23
+ returnTypedDataToSign: false
21
24
  });
22
25
  }
23
- /**
24
- * Encodes and signs a meta transaction for `createSeller` that can be relayed.
25
- * @param args - Meta transaction args.
26
- * @returns Signature.
27
- */
26
+ // Implementation
28
27
  async signMetaTxCreateSeller(args) {
28
+ if (args.returnTypedDataToSign) {
29
+ return handler.signMetaTxCreateSeller({
30
+ web3Lib: this._web3Lib,
31
+ theGraphStorage: this._theGraphStorage,
32
+ metadataStorage: this._metadataStorage,
33
+ metaTxHandlerAddress: this._protocolDiamond,
34
+ chainId: this._chainId,
35
+ ...args,
36
+ returnTypedDataToSign: true
37
+ });
38
+ }
29
39
  return handler.signMetaTxCreateSeller({
30
40
  web3Lib: this._web3Lib,
31
41
  theGraphStorage: this._theGraphStorage,
32
42
  metadataStorage: this._metadataStorage,
33
43
  metaTxHandlerAddress: this._protocolDiamond,
34
44
  chainId: this._chainId,
35
- ...args
45
+ ...args,
46
+ returnTypedDataToSign: false
36
47
  });
37
48
  }
49
+ // Implementation
38
50
  async signMetaTxUpdateSeller(args) {
51
+ if (args.returnTypedDataToSign) {
52
+ return handler.signMetaTxUpdateSeller({
53
+ web3Lib: this._web3Lib,
54
+ theGraphStorage: this._theGraphStorage,
55
+ metadataStorage: this._metadataStorage,
56
+ metaTxHandlerAddress: this._protocolDiamond,
57
+ chainId: this._chainId,
58
+ ...args,
59
+ returnTypedDataToSign: true
60
+ });
61
+ }
39
62
  return handler.signMetaTxUpdateSeller({
40
63
  web3Lib: this._web3Lib,
41
64
  theGraphStorage: this._theGraphStorage,
42
65
  metadataStorage: this._metadataStorage,
43
66
  metaTxHandlerAddress: this._protocolDiamond,
44
67
  chainId: this._chainId,
45
- ...args
68
+ ...args,
69
+ returnTypedDataToSign: false
46
70
  });
47
71
  }
72
+ // Implementation
48
73
  async signMetaTxOptInToSellerUpdate(args) {
74
+ if (args.returnTypedDataToSign) {
75
+ return handler.signMetaTxOptInToSellerUpdate({
76
+ web3Lib: this._web3Lib,
77
+ metaTxHandlerAddress: this._protocolDiamond,
78
+ chainId: this._chainId,
79
+ ...args,
80
+ returnTypedDataToSign: true
81
+ });
82
+ }
49
83
  return handler.signMetaTxOptInToSellerUpdate({
50
84
  web3Lib: this._web3Lib,
51
85
  metaTxHandlerAddress: this._protocolDiamond,
52
86
  chainId: this._chainId,
53
- ...args
87
+ ...args,
88
+ returnTypedDataToSign: false
54
89
  });
55
90
  }
56
91
  async signMetaTxUpdateSellerAndOptIn(sellerUpdates) {
@@ -119,51 +154,86 @@ export class MetaTxMixin extends BaseCoreSDK {
119
154
  // If there is nothing to optIn from the current account, then return the response from updateSeller
120
155
  return updateTx;
121
156
  }
122
- /**
123
- * Encodes and signs a meta transaction for `createOffer` that can be relayed.
124
- * @param args - Meta transaction args.
125
- * @returns Signature.
126
- */
157
+ // Implementation
127
158
  async signMetaTxCreateOffer(args) {
159
+ if (args.returnTypedDataToSign) {
160
+ return handler.signMetaTxCreateOffer({
161
+ web3Lib: this._web3Lib,
162
+ theGraphStorage: this._theGraphStorage,
163
+ metadataStorage: this._metadataStorage,
164
+ metaTxHandlerAddress: this._protocolDiamond,
165
+ chainId: this._chainId,
166
+ ...args,
167
+ returnTypedDataToSign: true
168
+ });
169
+ }
128
170
  return handler.signMetaTxCreateOffer({
129
171
  web3Lib: this._web3Lib,
130
172
  theGraphStorage: this._theGraphStorage,
131
173
  metadataStorage: this._metadataStorage,
132
174
  metaTxHandlerAddress: this._protocolDiamond,
133
175
  chainId: this._chainId,
134
- ...args
176
+ ...args,
177
+ returnTypedDataToSign: false
135
178
  });
136
179
  }
137
- /**
138
- * Encodes and signs a meta transaction for `createOfferBatch` that can be relayed.
139
- * @param args - Meta transaction args.
140
- * @returns Signature.
141
- */
180
+ // Implementation
142
181
  async signMetaTxCreateOfferBatch(args) {
182
+ if (args.returnTypedDataToSign) {
183
+ return handler.signMetaTxCreateOfferBatch({
184
+ web3Lib: this._web3Lib,
185
+ theGraphStorage: this._theGraphStorage,
186
+ metadataStorage: this._metadataStorage,
187
+ metaTxHandlerAddress: this._protocolDiamond,
188
+ chainId: this._chainId,
189
+ ...args,
190
+ returnTypedDataToSign: true
191
+ });
192
+ }
143
193
  return handler.signMetaTxCreateOfferBatch({
144
194
  web3Lib: this._web3Lib,
145
195
  theGraphStorage: this._theGraphStorage,
146
196
  metadataStorage: this._metadataStorage,
147
197
  metaTxHandlerAddress: this._protocolDiamond,
148
198
  chainId: this._chainId,
149
- ...args
199
+ ...args,
200
+ returnTypedDataToSign: false
150
201
  });
151
202
  }
152
- /**
153
- * Encodes and signs a meta transaction for `createGroup` that can be relayed.
154
- * @param args - Meta transaction args.
155
- * @returns Signature.
156
- */
203
+ // Implementation
157
204
  async signMetaTxCreateGroup(args) {
205
+ if (args.returnTypedDataToSign) {
206
+ return handler.signMetaTxCreateGroup({
207
+ web3Lib: this._web3Lib,
208
+ metaTxHandlerAddress: this._protocolDiamond,
209
+ chainId: this._chainId,
210
+ ...args,
211
+ returnTypedDataToSign: true
212
+ });
213
+ }
158
214
  return handler.signMetaTxCreateGroup({
159
215
  web3Lib: this._web3Lib,
160
216
  metaTxHandlerAddress: this._protocolDiamond,
161
217
  chainId: this._chainId,
162
- ...args
218
+ ...args,
219
+ returnTypedDataToSign: false
163
220
  });
164
221
  }
222
+ // Implementation
165
223
  async signMetaTxReserveRange(args) {
166
224
  const offer = await getOfferById(this._subgraphUrl, args.offerId);
225
+ if (args.returnTypedDataToSign) {
226
+ return handler.signMetaTxReserveRange({
227
+ web3Lib: this._web3Lib,
228
+ metaTxHandlerAddress: this._protocolDiamond,
229
+ chainId: this._chainId,
230
+ ...args,
231
+ to: args.to === "contract"
232
+ ? offer.seller.voucherCloneAddress
233
+ : offer.seller.assistant,
234
+ returnTypedDataToSign: true
235
+ });
236
+ }
167
237
  return handler.signMetaTxReserveRange({
168
238
  web3Lib: this._web3Lib,
169
239
  metaTxHandlerAddress: this._protocolDiamond,
@@ -171,7 +241,8 @@ export class MetaTxMixin extends BaseCoreSDK {
171
241
  ...args,
172
242
  to: args.to === "contract"
173
243
  ? offer.seller.voucherCloneAddress
174
- : offer.seller.assistant
244
+ : offer.seller.assistant,
245
+ returnTypedDataToSign: false
175
246
  });
176
247
  }
177
248
  async signMetaTxPreMint(args, overrides = {}) {
@@ -262,302 +333,442 @@ export class MetaTxMixin extends BaseCoreSDK {
262
333
  }
263
334
  });
264
335
  }
265
- /**
266
- * Encodes and signs a meta transaction for `createOfferWithCondition` that can be relayed.
267
- * @param args - Meta transaction args.
268
- * @returns Signature.
269
- */
336
+ // Implementation
270
337
  async signMetaTxCreateOfferWithCondition(args) {
338
+ if (args.returnTypedDataToSign) {
339
+ return handler.signMetaTxCreateOfferWithCondition({
340
+ web3Lib: this._web3Lib,
341
+ theGraphStorage: this._theGraphStorage,
342
+ metadataStorage: this._metadataStorage,
343
+ metaTxHandlerAddress: this._protocolDiamond,
344
+ chainId: this._chainId,
345
+ ...args,
346
+ returnTypedDataToSign: true
347
+ });
348
+ }
271
349
  return handler.signMetaTxCreateOfferWithCondition({
272
350
  web3Lib: this._web3Lib,
273
351
  theGraphStorage: this._theGraphStorage,
274
352
  metadataStorage: this._metadataStorage,
275
353
  metaTxHandlerAddress: this._protocolDiamond,
276
354
  chainId: this._chainId,
277
- ...args
355
+ ...args,
356
+ returnTypedDataToSign: false
278
357
  });
279
358
  }
280
- /**
281
- * Encodes and signs a meta transaction for `voidOffer` that can be relayed.
282
- * @param args - Meta transaction args.
283
- * @returns Signature.
284
- */
359
+ // Implementation
285
360
  async signMetaTxVoidOffer(args) {
361
+ if (args.returnTypedDataToSign) {
362
+ return handler.signMetaTxVoidOffer({
363
+ web3Lib: this._web3Lib,
364
+ metaTxHandlerAddress: this._protocolDiamond,
365
+ chainId: this._chainId,
366
+ ...args,
367
+ returnTypedDataToSign: true
368
+ });
369
+ }
286
370
  return handler.signMetaTxVoidOffer({
287
371
  web3Lib: this._web3Lib,
288
372
  metaTxHandlerAddress: this._protocolDiamond,
289
373
  chainId: this._chainId,
290
- ...args
374
+ ...args,
375
+ returnTypedDataToSign: false
291
376
  });
292
377
  }
293
- /**
294
- * Encodes and signs a meta transaction for `voidOfferBatch` that can be relayed.
295
- * @param args - Meta transaction args.
296
- * @returns Signature.
297
- */
378
+ // Implementation
298
379
  async signMetaTxVoidOfferBatch(args) {
380
+ if (args.returnTypedDataToSign) {
381
+ return handler.signMetaTxVoidOfferBatch({
382
+ web3Lib: this._web3Lib,
383
+ metaTxHandlerAddress: this._protocolDiamond,
384
+ chainId: this._chainId,
385
+ ...args,
386
+ returnTypedDataToSign: true
387
+ });
388
+ }
299
389
  return handler.signMetaTxVoidOfferBatch({
300
390
  web3Lib: this._web3Lib,
301
391
  metaTxHandlerAddress: this._protocolDiamond,
302
392
  chainId: this._chainId,
303
- ...args
393
+ ...args,
394
+ returnTypedDataToSign: false
304
395
  });
305
396
  }
306
- /**
307
- * Encodes and signs a meta transaction for `extendOffer` that can be relayed.
308
- * @param args - Meta transaction args.
309
- * @returns Signature.
310
- */
397
+ // Implementation
311
398
  async signMetaTxExtendOffer(args) {
399
+ if (args.returnTypedDataToSign) {
400
+ return handler.signMetaTxExtendOffer({
401
+ web3Lib: this._web3Lib,
402
+ metaTxHandlerAddress: this._protocolDiamond,
403
+ chainId: this._chainId,
404
+ ...args,
405
+ returnTypedDataToSign: true
406
+ });
407
+ }
312
408
  return handler.signMetaTxExtendOffer({
313
409
  web3Lib: this._web3Lib,
314
410
  metaTxHandlerAddress: this._protocolDiamond,
315
411
  chainId: this._chainId,
316
- ...args
412
+ ...args,
413
+ returnTypedDataToSign: false
317
414
  });
318
415
  }
319
- /**
320
- * Encodes and signs a meta transaction for `extendOfferBatch` that can be relayed.
321
- * @param args - Meta transaction args.
322
- * @returns Signature.
323
- */
416
+ // Implementation
324
417
  async signMetaTxExtendOfferBatch(args) {
418
+ if (args.returnTypedDataToSign) {
419
+ return handler.signMetaTxExtendOfferBatch({
420
+ web3Lib: this._web3Lib,
421
+ metaTxHandlerAddress: this._protocolDiamond,
422
+ chainId: this._chainId,
423
+ ...args,
424
+ returnTypedDataToSign: true
425
+ });
426
+ }
325
427
  return handler.signMetaTxExtendOfferBatch({
326
428
  web3Lib: this._web3Lib,
327
429
  metaTxHandlerAddress: this._protocolDiamond,
328
430
  chainId: this._chainId,
329
- ...args
431
+ ...args,
432
+ returnTypedDataToSign: false
330
433
  });
331
434
  }
332
- /**
333
- * Encodes and signs a meta transaction for `completeExchangeBatch` that can be relayed.
334
- * @param args - Meta transaction args.
335
- * @returns Signature.
336
- */
435
+ // Implementation
337
436
  async signMetaTxCompleteExchange(args) {
437
+ if (args.returnTypedDataToSign) {
438
+ return handler.signMetaTxCompleteExchange({
439
+ web3Lib: this._web3Lib,
440
+ metaTxHandlerAddress: this._protocolDiamond,
441
+ chainId: this._chainId,
442
+ ...args,
443
+ returnTypedDataToSign: true
444
+ });
445
+ }
338
446
  return handler.signMetaTxCompleteExchange({
339
447
  web3Lib: this._web3Lib,
340
448
  metaTxHandlerAddress: this._protocolDiamond,
341
449
  chainId: this._chainId,
342
- ...args
450
+ ...args,
451
+ returnTypedDataToSign: false
343
452
  });
344
453
  }
345
- /**
346
- * Encodes and signs a meta transaction for `completeExchangeBatch` that can be relayed.
347
- * @param args - Meta transaction args.
348
- * @returns Signature.
349
- */
454
+ // Implementation
350
455
  async signMetaTxCompleteExchangeBatch(args) {
456
+ if (args.returnTypedDataToSign) {
457
+ return handler.signMetaTxCompleteExchangeBatch({
458
+ web3Lib: this._web3Lib,
459
+ metaTxHandlerAddress: this._protocolDiamond,
460
+ chainId: this._chainId,
461
+ ...args,
462
+ returnTypedDataToSign: true
463
+ });
464
+ }
351
465
  return handler.signMetaTxCompleteExchangeBatch({
352
466
  web3Lib: this._web3Lib,
353
467
  metaTxHandlerAddress: this._protocolDiamond,
354
468
  chainId: this._chainId,
355
- ...args
469
+ ...args,
470
+ returnTypedDataToSign: false
356
471
  });
357
472
  }
358
- /**
359
- * Encodes and signs a meta transaction for `commitToOffer` that can be relayed.
360
- * @param args - Meta transaction args.
361
- * @returns Signature.
362
- */
473
+ // Implementation
363
474
  async signMetaTxCommitToOffer(args) {
364
475
  const offer = await getOfferById(this._subgraphUrl, args.offerId);
365
476
  if (offer.condition) {
366
477
  // keep compatibility with previous version
367
- return this.signMetaTxCommitToConditionalOffer({
478
+ // Using type assertion because TypeScript can't resolve overloads inside the implementation body
479
+ // when the args type comes from a complex Omit<Parameters<...>[0], ...> expression
480
+ const self = this;
481
+ const conditionalArgs = {
368
482
  ...args,
369
483
  tokenId: offer.condition.minTokenId
484
+ };
485
+ return self.signMetaTxCommitToConditionalOffer(conditionalArgs);
486
+ }
487
+ if (args.returnTypedDataToSign) {
488
+ return handler.signMetaTxCommitToOffer({
489
+ web3Lib: this._web3Lib,
490
+ metaTxHandlerAddress: this._protocolDiamond,
491
+ chainId: this._chainId,
492
+ ...args,
493
+ returnTypedDataToSign: true
370
494
  });
371
495
  }
372
496
  return handler.signMetaTxCommitToOffer({
373
497
  web3Lib: this._web3Lib,
374
498
  metaTxHandlerAddress: this._protocolDiamond,
375
499
  chainId: this._chainId,
376
- ...args
500
+ ...args,
501
+ returnTypedDataToSign: false
377
502
  });
378
503
  }
379
- /**
380
- * Encodes and signs a meta transaction for `commitToConditionalOffer` that can be relayed.
381
- * @param args - Meta transaction args.
382
- * @returns Signature.
383
- */
504
+ // Implementation
384
505
  async signMetaTxCommitToConditionalOffer(args) {
506
+ if (args.returnTypedDataToSign) {
507
+ return handler.signMetaTxCommitToConditionalOffer({
508
+ web3Lib: this._web3Lib,
509
+ metaTxHandlerAddress: this._protocolDiamond,
510
+ chainId: this._chainId,
511
+ ...args,
512
+ returnTypedDataToSign: true
513
+ });
514
+ }
385
515
  return handler.signMetaTxCommitToConditionalOffer({
386
516
  web3Lib: this._web3Lib,
387
517
  metaTxHandlerAddress: this._protocolDiamond,
388
518
  chainId: this._chainId,
389
- ...args
519
+ ...args,
520
+ returnTypedDataToSign: false
390
521
  });
391
522
  }
392
- /**
393
- * Encodes and signs a meta transaction for `commitToBuyerOffer` that can be relayed.
394
- * @param args - Meta transaction args.
395
- * @returns Signature.
396
- */
523
+ // Implementation
397
524
  async signMetaTxCommitToBuyerOffer(args) {
525
+ if (args.returnTypedDataToSign) {
526
+ return handler.signMetaTxCommitToBuyerOffer({
527
+ web3Lib: this._web3Lib,
528
+ metaTxHandlerAddress: this._protocolDiamond,
529
+ chainId: this._chainId,
530
+ ...args,
531
+ returnTypedDataToSign: true
532
+ });
533
+ }
398
534
  return handler.signMetaTxCommitToBuyerOffer({
399
535
  web3Lib: this._web3Lib,
400
536
  metaTxHandlerAddress: this._protocolDiamond,
401
537
  chainId: this._chainId,
402
- ...args
538
+ ...args,
539
+ returnTypedDataToSign: false
403
540
  });
404
541
  }
405
- /**
406
- * Encodes and signs a meta transaction for `createOfferAndCommit` that can be relayed.
407
- * @param args - Meta transaction args.
408
- * @returns Signature.
409
- */
542
+ // Implementation
410
543
  async signMetaTxCreateOfferAndCommit(args) {
544
+ if (args.returnTypedDataToSign) {
545
+ return handler.signMetaTxCreateOfferAndCommit({
546
+ web3Lib: this._web3Lib,
547
+ theGraphStorage: this._theGraphStorage,
548
+ metadataStorage: this._metadataStorage,
549
+ metaTxHandlerAddress: this._protocolDiamond,
550
+ chainId: this._chainId,
551
+ ...args,
552
+ returnTypedDataToSign: true
553
+ });
554
+ }
411
555
  return handler.signMetaTxCreateOfferAndCommit({
412
556
  web3Lib: this._web3Lib,
413
557
  theGraphStorage: this._theGraphStorage,
414
558
  metadataStorage: this._metadataStorage,
415
559
  metaTxHandlerAddress: this._protocolDiamond,
416
560
  chainId: this._chainId,
417
- ...args
561
+ ...args,
562
+ returnTypedDataToSign: false
418
563
  });
419
564
  }
420
- /**
421
- * Encodes and signs a meta transaction for `cancelVoucher` that can be relayed.
422
- * @param args - Meta transaction args.
423
- * @returns Signature.
424
- */
565
+ // Implementation
425
566
  async signMetaTxCancelVoucher(args) {
567
+ if (args.returnTypedDataToSign) {
568
+ return handler.signMetaTxCancelVoucher({
569
+ web3Lib: this._web3Lib,
570
+ metaTxHandlerAddress: this._protocolDiamond,
571
+ chainId: this._chainId,
572
+ ...args,
573
+ returnTypedDataToSign: true
574
+ });
575
+ }
426
576
  return handler.signMetaTxCancelVoucher({
427
577
  web3Lib: this._web3Lib,
428
578
  metaTxHandlerAddress: this._protocolDiamond,
429
579
  chainId: this._chainId,
430
- ...args
580
+ ...args,
581
+ returnTypedDataToSign: false
431
582
  });
432
583
  }
433
- /**
434
- * Encodes and signs a meta transaction for `redeemVoucher` that can be relayed.
435
- * @param args - Meta transaction args.
436
- * @returns Signature.
437
- */
584
+ // Implementation
438
585
  async signMetaTxRedeemVoucher(args) {
586
+ if (args.returnTypedDataToSign) {
587
+ return handler.signMetaTxRedeemVoucher({
588
+ web3Lib: this._web3Lib,
589
+ metaTxHandlerAddress: this._protocolDiamond,
590
+ chainId: this._chainId,
591
+ ...args,
592
+ returnTypedDataToSign: true
593
+ });
594
+ }
439
595
  return handler.signMetaTxRedeemVoucher({
440
596
  web3Lib: this._web3Lib,
441
597
  metaTxHandlerAddress: this._protocolDiamond,
442
598
  chainId: this._chainId,
443
- ...args
599
+ ...args,
600
+ returnTypedDataToSign: false
444
601
  });
445
602
  }
446
- /**
447
- * Encodes and signs a meta transaction for `expireVoucher` that can be relayed.
448
- * @param args - Meta transaction args.
449
- * @returns Signature.
450
- */
603
+ // Implementation
451
604
  async signMetaTxExpireVoucher(args) {
605
+ if (args.returnTypedDataToSign) {
606
+ return handler.signMetaTxExpireVoucher({
607
+ web3Lib: this._web3Lib,
608
+ metaTxHandlerAddress: this._protocolDiamond,
609
+ chainId: this._chainId,
610
+ ...args,
611
+ returnTypedDataToSign: true
612
+ });
613
+ }
452
614
  return handler.signMetaTxExpireVoucher({
453
615
  web3Lib: this._web3Lib,
454
616
  metaTxHandlerAddress: this._protocolDiamond,
455
617
  chainId: this._chainId,
456
- ...args
618
+ ...args,
619
+ returnTypedDataToSign: false
457
620
  });
458
621
  }
459
- /**
460
- * Encodes and signs a meta transaction for `revokeVoucher` that can be relayed.
461
- * @param args - Meta transaction args.
462
- * @returns Signature.
463
- */
622
+ // Implementation
464
623
  async signMetaTxRevokeVoucher(args) {
624
+ if (args.returnTypedDataToSign) {
625
+ return handler.signMetaTxRevokeVoucher({
626
+ web3Lib: this._web3Lib,
627
+ metaTxHandlerAddress: this._protocolDiamond,
628
+ chainId: this._chainId,
629
+ ...args,
630
+ returnTypedDataToSign: true
631
+ });
632
+ }
465
633
  return handler.signMetaTxRevokeVoucher({
466
634
  web3Lib: this._web3Lib,
467
635
  metaTxHandlerAddress: this._protocolDiamond,
468
636
  chainId: this._chainId,
469
- ...args
637
+ ...args,
638
+ returnTypedDataToSign: false
470
639
  });
471
640
  }
472
- /**
473
- * Encodes and signs a meta transaction for `retractDispute` that can be relayed.
474
- * @param args - Meta transaction args.
475
- * @returns Signature.
476
- */
641
+ // Implementation
477
642
  async signMetaTxRetractDispute(args) {
643
+ if (args.returnTypedDataToSign) {
644
+ return handler.signMetaTxRetractDispute({
645
+ web3Lib: this._web3Lib,
646
+ metaTxHandlerAddress: this._protocolDiamond,
647
+ chainId: this._chainId,
648
+ ...args,
649
+ returnTypedDataToSign: true
650
+ });
651
+ }
478
652
  return handler.signMetaTxRetractDispute({
479
653
  web3Lib: this._web3Lib,
480
654
  metaTxHandlerAddress: this._protocolDiamond,
481
655
  chainId: this._chainId,
482
- ...args
656
+ ...args,
657
+ returnTypedDataToSign: false
483
658
  });
484
659
  }
485
- /**
486
- * Encodes and signs a meta transaction for `escalateDispute` that can be relayed.
487
- * @param args - Meta transaction args.
488
- * @returns Signature.
489
- */
660
+ // Implementation
490
661
  async signMetaTxEscalateDispute(args) {
662
+ if (args.returnTypedDataToSign) {
663
+ return handler.signMetaTxEscalateDispute({
664
+ web3Lib: this._web3Lib,
665
+ metaTxHandlerAddress: this._protocolDiamond,
666
+ chainId: this._chainId,
667
+ ...args,
668
+ returnTypedDataToSign: true
669
+ });
670
+ }
491
671
  return handler.signMetaTxEscalateDispute({
492
672
  web3Lib: this._web3Lib,
493
673
  metaTxHandlerAddress: this._protocolDiamond,
494
674
  chainId: this._chainId,
495
- ...args
675
+ ...args,
676
+ returnTypedDataToSign: false
496
677
  });
497
678
  }
498
- /**
499
- * Encodes and signs a meta transaction for `raiseDispute` that can be relayed.
500
- * @param args - Meta transaction args.
501
- * @returns Signature.
502
- */
679
+ // Implementation
503
680
  async signMetaTxRaiseDispute(args) {
681
+ if (args.returnTypedDataToSign) {
682
+ return handler.signMetaTxRaiseDispute({
683
+ web3Lib: this._web3Lib,
684
+ metaTxHandlerAddress: this._protocolDiamond,
685
+ chainId: this._chainId,
686
+ ...args,
687
+ returnTypedDataToSign: true
688
+ });
689
+ }
504
690
  return handler.signMetaTxRaiseDispute({
505
691
  web3Lib: this._web3Lib,
506
692
  metaTxHandlerAddress: this._protocolDiamond,
507
693
  chainId: this._chainId,
508
- ...args
694
+ ...args,
695
+ returnTypedDataToSign: false
509
696
  });
510
697
  }
511
- /**
512
- * Encodes and signs a meta transaction for `resolveDispute` that can be relayed.
513
- * @param args - Meta transaction args.
514
- * @returns Signature.
515
- */
698
+ // Implementation
516
699
  async signMetaTxResolveDispute(args) {
700
+ if (args.returnTypedDataToSign) {
701
+ return handler.signMetaTxResolveDispute({
702
+ web3Lib: this._web3Lib,
703
+ metaTxHandlerAddress: this._protocolDiamond,
704
+ chainId: this._chainId,
705
+ ...args,
706
+ returnTypedDataToSign: true
707
+ });
708
+ }
517
709
  return handler.signMetaTxResolveDispute({
518
710
  web3Lib: this._web3Lib,
519
711
  metaTxHandlerAddress: this._protocolDiamond,
520
712
  chainId: this._chainId,
521
- ...args
713
+ ...args,
714
+ returnTypedDataToSign: false
522
715
  });
523
716
  }
524
- /**
525
- * Encodes and signs a meta transaction for `extendDisputeTimeout` that can be relayed.
526
- * @param args - Meta transaction args.
527
- * @returns Signature.
528
- */
717
+ // Implementation
529
718
  async signMetaTxExtendDisputeTimeout(args) {
719
+ if (args.returnTypedDataToSign) {
720
+ return handler.signMetaTxExtendDisputeTimeout({
721
+ web3Lib: this._web3Lib,
722
+ metaTxHandlerAddress: this._protocolDiamond,
723
+ chainId: this._chainId,
724
+ ...args,
725
+ returnTypedDataToSign: true
726
+ });
727
+ }
530
728
  return handler.signMetaTxExtendDisputeTimeout({
531
729
  web3Lib: this._web3Lib,
532
730
  metaTxHandlerAddress: this._protocolDiamond,
533
731
  chainId: this._chainId,
534
- ...args
732
+ ...args,
733
+ returnTypedDataToSign: false
535
734
  });
536
735
  }
537
- /**
538
- * Encodes and signs a meta transaction for `withdrawFunds` that can be relayed.
539
- * @param args - Meta transaction args.
540
- * @returns Signature.
541
- */
736
+ // Implementation
542
737
  async signMetaTxWithdrawFunds(args) {
738
+ if (args.returnTypedDataToSign) {
739
+ return handler.signMetaTxWithdrawFunds({
740
+ web3Lib: this._web3Lib,
741
+ metaTxHandlerAddress: this._protocolDiamond,
742
+ chainId: this._chainId,
743
+ ...args,
744
+ returnTypedDataToSign: true
745
+ });
746
+ }
543
747
  return handler.signMetaTxWithdrawFunds({
544
748
  web3Lib: this._web3Lib,
545
749
  metaTxHandlerAddress: this._protocolDiamond,
546
750
  chainId: this._chainId,
547
- ...args
751
+ ...args,
752
+ returnTypedDataToSign: false
548
753
  });
549
754
  }
550
- /**
551
- * Encodes and signs a meta transaction for `depositFunds` that can be relayed.
552
- * @param args - Meta transaction args.
553
- * @returns Signature.
554
- */
755
+ // Implementation
555
756
  async signMetaTxDepositFunds(args) {
757
+ if (args.returnTypedDataToSign) {
758
+ return handler.signMetaTxDepositFunds({
759
+ web3Lib: this._web3Lib,
760
+ metaTxHandlerAddress: this._protocolDiamond,
761
+ chainId: this._chainId,
762
+ ...args,
763
+ returnTypedDataToSign: true
764
+ });
765
+ }
556
766
  return handler.signMetaTxDepositFunds({
557
767
  web3Lib: this._web3Lib,
558
768
  metaTxHandlerAddress: this._protocolDiamond,
559
769
  chainId: this._chainId,
560
- ...args
770
+ ...args,
771
+ returnTypedDataToSign: false
561
772
  });
562
773
  }
563
774
  /**