@0xsequence/provider 0.0.0-2021827201516 → 0.0.0-20220412184039

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 (42) hide show
  1. package/CHANGELOG.md +540 -9
  2. package/dist/0xsequence-provider.cjs.d.ts +11 -1
  3. package/dist/0xsequence-provider.cjs.js +15 -6
  4. package/package.json +14 -14
  5. package/src/provider.ts +17 -3
  6. package/src/transports/base-wallet-transport.ts +12 -2
  7. package/src/transports/extension-transport/base-injected-transport.ts +2 -1
  8. package/src/transports/extension-transport/extension-message-handler.ts +2 -1
  9. package/src/transports/mux-transport/mux-message-provider.ts +4 -0
  10. package/src/transports/wallet-request-handler.ts +143 -24
  11. package/src/transports/window-transport/window-message-handler.ts +2 -6
  12. package/src/transports/window-transport/window-message-provider.ts +18 -7
  13. package/src/types.ts +87 -44
  14. package/src/{commands → utils}/index.ts +10 -3
  15. package/src/utils.ts +82 -9
  16. package/src/wallet.ts +13 -4
  17. package/dist/0xsequence-provider.cjs.dev.js +0 -3545
  18. package/dist/0xsequence-provider.cjs.prod.js +0 -3545
  19. package/dist/0xsequence-provider.esm.js +0 -3513
  20. package/dist/declarations/src/commands/index.d.ts +0 -20
  21. package/dist/declarations/src/index.d.ts +0 -5
  22. package/dist/declarations/src/provider.d.ts +0 -59
  23. package/dist/declarations/src/transports/base-provider-transport.d.ts +0 -40
  24. package/dist/declarations/src/transports/base-wallet-transport.d.ts +0 -38
  25. package/dist/declarations/src/transports/extension-transport/base-injected-transport.d.ts +0 -18
  26. package/dist/declarations/src/transports/extension-transport/extension-message-handler.d.ts +0 -12
  27. package/dist/declarations/src/transports/extension-transport/extension-message-provider.d.ts +0 -11
  28. package/dist/declarations/src/transports/extension-transport/index.d.ts +0 -3
  29. package/dist/declarations/src/transports/index.d.ts +0 -7
  30. package/dist/declarations/src/transports/mux-transport/index.d.ts +0 -1
  31. package/dist/declarations/src/transports/mux-transport/mux-message-provider.d.ts +0 -23
  32. package/dist/declarations/src/transports/proxy-transport/index.d.ts +0 -3
  33. package/dist/declarations/src/transports/proxy-transport/proxy-message-channel.d.ts +0 -15
  34. package/dist/declarations/src/transports/proxy-transport/proxy-message-handler.d.ts +0 -12
  35. package/dist/declarations/src/transports/proxy-transport/proxy-message-provider.d.ts +0 -12
  36. package/dist/declarations/src/transports/wallet-request-handler.d.ts +0 -51
  37. package/dist/declarations/src/transports/window-transport/index.d.ts +0 -2
  38. package/dist/declarations/src/transports/window-transport/window-message-handler.d.ts +0 -15
  39. package/dist/declarations/src/transports/window-transport/window-message-provider.d.ts +0 -13
  40. package/dist/declarations/src/types.d.ts +0 -170
  41. package/dist/declarations/src/utils.d.ts +0 -15
  42. package/dist/declarations/src/wallet.d.ts +0 -99
package/CHANGELOG.md CHANGED
@@ -1,21 +1,552 @@
1
1
  # @0xsequence/provider
2
2
 
3
- ## 0.0.0-2021827201516
3
+ ## 0.0.0-20220412184039
4
+
5
+ ### Patch Changes
6
+
7
+ - @0xsequence/auth@0.0.0-20220412184039
8
+
9
+ ## 0.36.9
10
+
11
+ ### Patch Changes
12
+
13
+ - minor dev xp improvements
14
+ - Updated dependencies
15
+ - @0xsequence/abi@0.36.9
16
+ - @0xsequence/auth@0.36.9
17
+ - @0xsequence/config@0.36.9
18
+ - @0xsequence/network@0.36.9
19
+ - @0xsequence/transactions@0.36.9
20
+ - @0xsequence/utils@0.36.9
21
+ - @0xsequence/wallet@0.36.9
22
+
23
+ ## 0.36.8
24
+
25
+ ### Patch Changes
26
+
27
+ - more connect options (theme, payment providers, funding currencies)
28
+ - Updated dependencies
29
+ - @0xsequence/abi@0.36.8
30
+ - @0xsequence/auth@0.36.8
31
+ - @0xsequence/config@0.36.8
32
+ - @0xsequence/network@0.36.8
33
+ - @0xsequence/transactions@0.36.8
34
+ - @0xsequence/utils@0.36.8
35
+ - @0xsequence/wallet@0.36.8
36
+
37
+ ## 0.36.7
38
+
39
+ ### Patch Changes
40
+
41
+ - fix missing break
42
+ - Updated dependencies
43
+ - @0xsequence/abi@0.36.7
44
+ - @0xsequence/auth@0.36.7
45
+ - @0xsequence/config@0.36.7
46
+ - @0xsequence/network@0.36.7
47
+ - @0xsequence/transactions@0.36.7
48
+ - @0xsequence/utils@0.36.7
49
+ - @0xsequence/wallet@0.36.7
50
+
51
+ ## 0.36.6
52
+
53
+ ### Patch Changes
54
+
55
+ - wallet_switchEthereumChain support
56
+ - Updated dependencies
57
+ - @0xsequence/abi@0.36.6
58
+ - @0xsequence/auth@0.36.6
59
+ - @0xsequence/config@0.36.6
60
+ - @0xsequence/network@0.36.6
61
+ - @0xsequence/transactions@0.36.6
62
+ - @0xsequence/utils@0.36.6
63
+ - @0xsequence/wallet@0.36.6
64
+
65
+ ## 0.36.5
66
+
67
+ ### Patch Changes
68
+
69
+ - auth: bump ethauth to 0.7.0
70
+ network, wallet: don't assume position of auth network in list
71
+ api/indexer/metadata: trim trailing slash on hostname, and add endpoint urls
72
+ relayer: Allow to specify local relayer transaction parameters like gas price or gas limit
73
+ - Updated dependencies
74
+ - @0xsequence/abi@0.36.5
75
+ - @0xsequence/auth@0.36.5
76
+ - @0xsequence/config@0.36.5
77
+ - @0xsequence/network@0.36.5
78
+ - @0xsequence/transactions@0.36.5
79
+ - @0xsequence/utils@0.36.5
80
+ - @0xsequence/wallet@0.36.5
81
+
82
+ ## 0.36.4
83
+
84
+ ### Patch Changes
85
+
86
+ - Updating list of chain ids to include other ethereum compatible chains
87
+ - Updated dependencies
88
+ - @0xsequence/abi@0.36.4
89
+ - @0xsequence/auth@0.36.4
90
+ - @0xsequence/config@0.36.4
91
+ - @0xsequence/network@0.36.4
92
+ - @0xsequence/transactions@0.36.4
93
+ - @0xsequence/utils@0.36.4
94
+ - @0xsequence/wallet@0.36.4
95
+
96
+ ## 0.36.3
97
+
98
+ ### Patch Changes
99
+
100
+ - provider: pass connect options to prompter methods
101
+ - Updated dependencies
102
+ - @0xsequence/abi@0.36.3
103
+ - @0xsequence/auth@0.36.3
104
+ - @0xsequence/config@0.36.3
105
+ - @0xsequence/network@0.36.3
106
+ - @0xsequence/transactions@0.36.3
107
+ - @0xsequence/utils@0.36.3
108
+ - @0xsequence/wallet@0.36.3
109
+
110
+ ## 0.36.2
111
+
112
+ ### Patch Changes
113
+
114
+ - transactions: Setting target to 0x0 when empty to during SequenceTxAbiEncode
115
+ - Updated dependencies
116
+ - @0xsequence/abi@0.36.2
117
+ - @0xsequence/auth@0.36.2
118
+ - @0xsequence/config@0.36.2
119
+ - @0xsequence/network@0.36.2
120
+ - @0xsequence/transactions@0.36.2
121
+ - @0xsequence/utils@0.36.2
122
+ - @0xsequence/wallet@0.36.2
123
+
124
+ ## 0.36.1
125
+
126
+ ### Patch Changes
127
+
128
+ - metadata: update client with more fields
129
+ - Updated dependencies
130
+ - @0xsequence/abi@0.36.1
131
+ - @0xsequence/auth@0.36.1
132
+ - @0xsequence/config@0.36.1
133
+ - @0xsequence/network@0.36.1
134
+ - @0xsequence/transactions@0.36.1
135
+ - @0xsequence/utils@0.36.1
136
+ - @0xsequence/wallet@0.36.1
137
+
138
+ ## 0.36.0
4
139
 
5
140
  ### Minor Changes
6
141
 
7
- - next release
142
+ - relayer, wallet: fee quote support
143
+
144
+ ### Patch Changes
145
+
146
+ - Updated dependencies
147
+ - @0xsequence/abi@0.36.0
148
+ - @0xsequence/auth@0.36.0
149
+ - @0xsequence/config@0.36.0
150
+ - @0xsequence/network@0.36.0
151
+ - @0xsequence/transactions@0.36.0
152
+ - @0xsequence/utils@0.36.0
153
+ - @0xsequence/wallet@0.36.0
154
+
155
+ ## 0.35.12
156
+
157
+ ### Patch Changes
158
+
159
+ - provider: rename wallet.commands to wallet.utils
160
+ - Updated dependencies
161
+ - @0xsequence/abi@0.35.12
162
+ - @0xsequence/auth@0.35.12
163
+ - @0xsequence/config@0.35.12
164
+ - @0xsequence/network@0.35.12
165
+ - @0xsequence/transactions@0.35.12
166
+ - @0xsequence/utils@0.35.12
167
+ - @0xsequence/wallet@0.35.12
168
+
169
+ ## 0.35.11
170
+
171
+ ### Patch Changes
172
+
173
+ - provider/utils: smoother message validation
174
+ - Updated dependencies
175
+ - @0xsequence/abi@0.35.11
176
+ - @0xsequence/auth@0.35.11
177
+ - @0xsequence/config@0.35.11
178
+ - @0xsequence/network@0.35.11
179
+ - @0xsequence/transactions@0.35.11
180
+ - @0xsequence/utils@0.35.11
181
+ - @0xsequence/wallet@0.35.11
182
+
183
+ ## 0.35.10
184
+
185
+ ### Patch Changes
186
+
187
+ - upgrade deps
188
+ - Updated dependencies
189
+ - @0xsequence/abi@0.35.10
190
+ - @0xsequence/auth@0.35.10
191
+ - @0xsequence/config@0.35.10
192
+ - @0xsequence/network@0.35.10
193
+ - @0xsequence/transactions@0.35.10
194
+ - @0xsequence/utils@0.35.10
195
+ - @0xsequence/wallet@0.35.10
196
+
197
+ ## 0.35.9
198
+
199
+ ### Patch Changes
200
+
201
+ - provider: window-transport override event handlers with new wallet instance
202
+ - Updated dependencies
203
+ - @0xsequence/abi@0.35.9
204
+ - @0xsequence/auth@0.35.9
205
+ - @0xsequence/config@0.35.9
206
+ - @0xsequence/network@0.35.9
207
+ - @0xsequence/transactions@0.35.9
208
+ - @0xsequence/utils@0.35.9
209
+ - @0xsequence/wallet@0.35.9
210
+
211
+ ## 0.35.8
212
+
213
+ ### Patch Changes
214
+
215
+ - provider: async wallet sign in improvements
216
+ - Updated dependencies
217
+ - @0xsequence/abi@0.35.8
218
+ - @0xsequence/auth@0.35.8
219
+ - @0xsequence/config@0.35.8
220
+ - @0xsequence/network@0.35.8
221
+ - @0xsequence/transactions@0.35.8
222
+ - @0xsequence/utils@0.35.8
223
+ - @0xsequence/wallet@0.35.8
224
+
225
+ ## 0.35.7
226
+
227
+ ### Patch Changes
228
+
229
+ - config: cache wallet configs
230
+ - Updated dependencies
231
+ - @0xsequence/abi@0.35.7
232
+ - @0xsequence/auth@0.35.7
233
+ - @0xsequence/config@0.35.7
234
+ - @0xsequence/network@0.35.7
235
+ - @0xsequence/transactions@0.35.7
236
+ - @0xsequence/utils@0.35.7
237
+ - @0xsequence/wallet@0.35.7
238
+
239
+ ## 0.35.6
240
+
241
+ ### Patch Changes
242
+
243
+ - provider: support async signin of wallet request handler
244
+ - Updated dependencies
245
+ - @0xsequence/abi@0.35.6
246
+ - @0xsequence/auth@0.35.6
247
+ - @0xsequence/config@0.35.6
248
+ - @0xsequence/network@0.35.6
249
+ - @0xsequence/transactions@0.35.6
250
+ - @0xsequence/utils@0.35.6
251
+ - @0xsequence/wallet@0.35.6
252
+
253
+ ## 0.35.5
254
+
255
+ ### Patch Changes
256
+
257
+ - wallet: skip threshold check during fee estimation
258
+ - Updated dependencies
259
+ - @0xsequence/abi@0.35.5
260
+ - @0xsequence/auth@0.35.5
261
+ - @0xsequence/config@0.35.5
262
+ - @0xsequence/network@0.35.5
263
+ - @0xsequence/transactions@0.35.5
264
+ - @0xsequence/utils@0.35.5
265
+ - @0xsequence/wallet@0.35.5
266
+
267
+ ## 0.35.4
268
+
269
+ ### Patch Changes
270
+
271
+ - - browser extension mode, center window
272
+ - Updated dependencies
273
+ - @0xsequence/abi@0.35.4
274
+ - @0xsequence/auth@0.35.4
275
+ - @0xsequence/config@0.35.4
276
+ - @0xsequence/network@0.35.4
277
+ - @0xsequence/transactions@0.35.4
278
+ - @0xsequence/utils@0.35.4
279
+ - @0xsequence/wallet@0.35.4
280
+
281
+ ## 0.35.3
282
+
283
+ ### Patch Changes
284
+
285
+ - - update window position when in browser extension mode
286
+ - Updated dependencies
287
+ - @0xsequence/abi@0.35.3
288
+ - @0xsequence/auth@0.35.3
289
+ - @0xsequence/config@0.35.3
290
+ - @0xsequence/network@0.35.3
291
+ - @0xsequence/transactions@0.35.3
292
+ - @0xsequence/utils@0.35.3
293
+ - @0xsequence/wallet@0.35.3
294
+
295
+ ## 0.35.2
296
+
297
+ ### Patch Changes
298
+
299
+ - - provider: WindowMessageHandler accept optional windowHref
300
+ - Updated dependencies
301
+ - @0xsequence/abi@0.35.2
302
+ - @0xsequence/auth@0.35.2
303
+ - @0xsequence/config@0.35.2
304
+ - @0xsequence/network@0.35.2
305
+ - @0xsequence/transactions@0.35.2
306
+ - @0xsequence/utils@0.35.2
307
+ - @0xsequence/wallet@0.35.2
308
+
309
+ ## 0.35.1
310
+
311
+ ### Patch Changes
312
+
313
+ - wallet: update config on undeployed too
314
+ - Updated dependencies
315
+ - @0xsequence/abi@0.35.1
316
+ - @0xsequence/auth@0.35.1
317
+ - @0xsequence/config@0.35.1
318
+ - @0xsequence/network@0.35.1
319
+ - @0xsequence/transactions@0.35.1
320
+ - @0xsequence/utils@0.35.1
321
+ - @0xsequence/wallet@0.35.1
322
+
323
+ ## 0.35.0
324
+
325
+ ### Minor Changes
326
+
327
+ - - config: add buildStubSignature
328
+ - provider: add checks to signing cases for wallet deployment and config statuses
329
+ - provider: add prompt for wallet deployment
330
+ - relayer: add BaseRelayer.prependWalletDeploy
331
+ - relayer: add Relayer.feeOptions
332
+ - relayer: account for wallet deployment in fee estimation
333
+ - transactions: add fromTransactionish
334
+ - wallet: add Account.prependConfigUpdate
335
+ - wallet: add Account.getFeeOptions
336
+
337
+ ### Patch Changes
338
+
339
+ - Updated dependencies
340
+ - @0xsequence/abi@0.35.0
341
+ - @0xsequence/auth@0.35.0
342
+ - @0xsequence/config@0.35.0
343
+ - @0xsequence/network@0.35.0
344
+ - @0xsequence/transactions@0.35.0
345
+ - @0xsequence/utils@0.35.0
346
+ - @0xsequence/wallet@0.35.0
347
+
348
+ ## 0.34.1
349
+
350
+ ### Patch Changes
351
+
352
+ - Updated dependencies
353
+ - @0xsequence/auth@0.34.1
354
+
355
+ ## 0.34.0
356
+
357
+ ### Minor Changes
358
+
359
+ - - upgrade deps
360
+
361
+ ### Patch Changes
362
+
363
+ - Updated dependencies
364
+ - @0xsequence/abi@0.34.0
365
+ - @0xsequence/auth@0.34.0
366
+ - @0xsequence/config@0.34.0
367
+ - @0xsequence/network@0.34.0
368
+ - @0xsequence/transactions@0.34.0
369
+ - @0xsequence/utils@0.34.0
370
+ - @0xsequence/wallet@0.34.0
371
+
372
+ ## 0.33.3
373
+
374
+ ### Patch Changes
375
+
376
+ - Updated dependencies
377
+ - @0xsequence/wallet@0.33.3
378
+ - @0xsequence/auth@0.33.3
379
+
380
+ ## 0.33.2
381
+
382
+ ### Patch Changes
383
+
384
+ - Updated dependencies
385
+ - @0xsequence/transactions@0.33.2
386
+ - @0xsequence/wallet@0.33.2
387
+ - @0xsequence/auth@0.33.2
388
+
389
+ ## 0.33.1
390
+
391
+ ### Patch Changes
392
+
393
+ - @0xsequence/auth@0.33.1
394
+
395
+ ## 0.33.0
396
+
397
+ ### Patch Changes
398
+
399
+ - Updated dependencies
400
+ - @0xsequence/auth@0.33.0
401
+
402
+ ## 0.31.3
403
+
404
+ ### Patch Changes
405
+
406
+ - @0xsequence/auth@0.31.3
407
+
408
+ ## 0.31.1
409
+
410
+ ### Patch Changes
411
+
412
+ - @0xsequence/wallet@0.31.1
413
+ - @0xsequence/auth@0.31.1
414
+
415
+ ## 0.31.0
416
+
417
+ ### Minor Changes
418
+
419
+ - - upgrading to ethers v5.5
420
+
421
+ ### Patch Changes
422
+
423
+ - Updated dependencies
424
+ - @0xsequence/abi@0.31.0
425
+ - @0xsequence/auth@0.31.0
426
+ - @0xsequence/config@0.31.0
427
+ - @0xsequence/network@0.31.0
428
+ - @0xsequence/transactions@0.31.0
429
+ - @0xsequence/utils@0.31.0
430
+ - @0xsequence/wallet@0.31.0
431
+
432
+ ## 0.30.0
433
+
434
+ ### Minor Changes
435
+
436
+ - - upgrade most deps
437
+
438
+ ### Patch Changes
439
+
440
+ - Updated dependencies
441
+ - @0xsequence/abi@0.30.0
442
+ - @0xsequence/auth@0.30.0
443
+ - @0xsequence/config@0.30.0
444
+ - @0xsequence/network@0.30.0
445
+ - @0xsequence/transactions@0.30.0
446
+ - @0xsequence/utils@0.30.0
447
+ - @0xsequence/wallet@0.30.0
448
+
449
+ ## 0.29.9
450
+
451
+ ### Patch Changes
452
+
453
+ - @0xsequence/auth@0.29.9
454
+
455
+ ## 0.29.8
456
+
457
+ ### Patch Changes
458
+
459
+ - update api
460
+ - Updated dependencies [undefined]
461
+ - @0xsequence/abi@0.29.8
462
+ - @0xsequence/auth@0.29.8
463
+ - @0xsequence/config@0.29.8
464
+ - @0xsequence/network@0.29.8
465
+ - @0xsequence/transactions@0.29.8
466
+ - @0xsequence/utils@0.29.8
467
+ - @0xsequence/wallet@0.29.8
468
+
469
+ ## 0.29.7
470
+
471
+ ### Patch Changes
472
+
473
+ - Updated dependencies [undefined]
474
+ - @0xsequence/wallet@0.29.7
475
+ - @0xsequence/auth@0.29.7
476
+
477
+ ## 0.29.6
478
+
479
+ ### Patch Changes
480
+
481
+ - Updated dependencies [undefined]
482
+ - @0xsequence/network@0.29.6
483
+ - @0xsequence/auth@0.29.6
484
+ - @0xsequence/config@0.29.6
485
+ - @0xsequence/transactions@0.29.6
486
+ - @0xsequence/wallet@0.29.6
487
+
488
+ ## 0.29.5
489
+
490
+ ### Patch Changes
491
+
492
+ - Updated dependencies [undefined]
493
+ - @0xsequence/auth@0.29.5
494
+ - @0xsequence/config@0.29.5
495
+ - @0xsequence/wallet@0.29.5
496
+
497
+ ## 0.29.4
498
+
499
+ ### Patch Changes
500
+
501
+ - @0xsequence/auth@0.29.4
502
+
503
+ ## 0.29.3
504
+
505
+ ### Patch Changes
506
+
507
+ - @0xsequence/auth@0.29.3
508
+
509
+ ## 0.29.2
510
+
511
+ ### Patch Changes
512
+
513
+ - @0xsequence/wallet@0.29.2
514
+ - @0xsequence/auth@0.29.2
515
+
516
+ ## 0.29.1
517
+
518
+ ### Patch Changes
519
+
520
+ - @0xsequence/auth@0.29.1
521
+
522
+ ## 0.29.0
523
+
524
+ ### Minor Changes
525
+
526
+ - major architectural changes in Sequence design
527
+
528
+ - only one API instance, API is no longer a per-chain service
529
+ - separate per-chain indexer service, API no longer handles indexing
530
+ - single contract metadata service, API no longer serves metadata
531
+
532
+ chaind package has been removed, indexer and metadata packages have been added
533
+
534
+ stronger typing with new explicit ChainId type
535
+
536
+ multicall fixes and improvements
537
+
538
+ forbid "wait" transactions in sendTransactionBatch calls
8
539
 
9
540
  ### Patch Changes
10
541
 
11
542
  - Updated dependencies [undefined]
12
- - @0xsequence/auth@0.0.0-2021827201516
13
- - @0xsequence/config@0.0.0-2021827201516
14
- - @0xsequence/network@0.0.0-2021827201516
15
- - @0xsequence/transactions@0.0.0-2021827201516
16
- - @0xsequence/abi@0.0.0-2021827201516
17
- - @0xsequence/utils@0.0.0-2021827201516
18
- - @0xsequence/wallet@0.0.0-2021827201516
543
+ - @0xsequence/auth@0.29.0
544
+ - @0xsequence/config@0.29.0
545
+ - @0xsequence/network@0.29.0
546
+ - @0xsequence/transactions@0.29.0
547
+ - @0xsequence/abi@0.29.0
548
+ - @0xsequence/utils@0.29.0
549
+ - @0xsequence/wallet@0.29.0
19
550
 
20
551
  ## 0.28.0
21
552
 
@@ -1 +1,11 @@
1
- export * from "./declarations/src/index";
1
+ // are you seeing an error that a default export doesn't exist but your source file has a default export?
2
+ // you should run `yarn` or `yarn preconstruct dev` if preconstruct dev isn't in your postinstall hook
3
+
4
+ // curious why you need to?
5
+ // this file exists so that you can import from the entrypoint normally
6
+ // except that it points to your source file and you don't need to run build constantly
7
+ // which means we need to re-export all of the modules from your source file
8
+ // and since export * doesn't include default exports, we need to read your source file
9
+ // to check for a default export and re-export it if it exists
10
+ // it's not ideal, but it works pretty well ¯\_(ツ)_/¯
11
+ export * from "../src/index";
@@ -1,7 +1,16 @@
1
- 'use strict';
1
+ "use strict";
2
+ // this file might look strange and you might be wondering what it's for
3
+ // it's lets you import your source files by importing this entrypoint
4
+ // as you would import it if it was built with preconstruct build
5
+ // this file is slightly different to some others though
6
+ // it has a require hook which compiles your code with Babel
7
+ // this means that you don't have to set up @babel/register or anything like that
8
+ // but you can still require this module and it'll be compiled
2
9
 
3
- if (process.env.NODE_ENV === "production") {
4
- module.exports = require("./0xsequence-provider.cjs.prod.js");
5
- } else {
6
- module.exports = require("./0xsequence-provider.cjs.dev.js");
7
- }
10
+ // this bit of code imports the require hook and registers it
11
+ let unregister = require("../../../node_modules/@preconstruct/hook").___internalHook(typeof __dirname === 'undefined' ? undefined : __dirname, "../../..", "..");
12
+
13
+ // this re-exports the source file
14
+ module.exports = require("../src/index.ts");
15
+
16
+ unregister();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xsequence/provider",
3
- "version": "0.0.0-2021827201516",
3
+ "version": "0.0.0-20220412184039",
4
4
  "description": "provider sub-package for Sequence",
5
5
  "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/provider",
6
6
  "source": "src/index.ts",
@@ -13,19 +13,19 @@
13
13
  "typecheck": "tsc --noEmit"
14
14
  },
15
15
  "dependencies": {
16
- "@0xsequence/abi": "^0.0.0-2021827201516",
17
- "@0xsequence/auth": "^0.0.0-2021827201516",
18
- "@0xsequence/config": "^0.0.0-2021827201516",
19
- "@0xsequence/network": "^0.0.0-2021827201516",
20
- "@0xsequence/transactions": "^0.0.0-2021827201516",
21
- "@0xsequence/utils": "^0.0.0-2021827201516",
22
- "@0xsequence/wallet": "^0.0.0-2021827201516",
23
- "@ethersproject/abstract-signer": "5.0.14",
24
- "@ethersproject/hash": "^5.0.12",
25
- "@ethersproject/providers": "^5.0.24",
26
- "@ethersproject/web": "^5.0.14",
27
- "ethers": "^5.0.32",
28
- "eventemitter2": "^6.4.4",
16
+ "@0xsequence/abi": "^0.36.9",
17
+ "@0xsequence/auth": "^0.0.0-20220412184039",
18
+ "@0xsequence/config": "^0.36.9",
19
+ "@0xsequence/network": "^0.36.9",
20
+ "@0xsequence/transactions": "^0.36.9",
21
+ "@0xsequence/utils": "^0.36.9",
22
+ "@0xsequence/wallet": "^0.36.9",
23
+ "@ethersproject/abstract-signer": "^5.5.0",
24
+ "@ethersproject/hash": "^5.5.0",
25
+ "@ethersproject/providers": "^5.5.1",
26
+ "@ethersproject/web": "^5.5.1",
27
+ "ethers": "^5.5.2",
28
+ "eventemitter2": "^6.4.5",
29
29
  "webextension-polyfill-ts": "^0.26.0"
30
30
  },
31
31
  "peerDependencies": {},
package/src/provider.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ethers } from 'ethers'
2
- import { BytesLike } from '@ethersproject/bytes'
2
+ import { BytesLike, Bytes } from '@ethersproject/bytes'
3
3
  import { Web3Provider as EthersWeb3Provider, ExternalProvider, JsonRpcProvider, Networkish } from '@ethersproject/providers'
4
4
  import { TypedDataDomain, TypedDataField, TypedDataSigner } from '@ethersproject/abstract-signer'
5
5
  import {
@@ -72,6 +72,7 @@ export class Web3Provider extends EthersWeb3Provider implements JsonRpcHandler {
72
72
  }
73
73
 
74
74
  async getChainId(): Promise<number> {
75
+ // TODO: is it safe to memoize this?
75
76
  const result = await this.send('eth_chainId', [])
76
77
  const chainId = ethers.BigNumber.from(result).toNumber()
77
78
 
@@ -230,8 +231,10 @@ export class Web3Signer extends Signer implements TypedDataSigner {
230
231
  const data = typeof message === 'string' ? ethers.utils.toUtf8Bytes(message) : message
231
232
  const address = await this.getAddress()
232
233
 
233
- // https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign
234
- return await provider!.send('eth_sign', [address, ethers.utils.hexlify(data)])
234
+ // NOTE: as of ethers v5.5, it switched to using personal_sign, see
235
+ // https://github.com/ethers-io/ethers.js/pull/1542 and see
236
+ // https://github.com/WalletConnect/walletconnect-docs/issues/32 for additional info.
237
+ return await provider!.send('personal_sign', [ethers.utils.hexlify(data), address])
235
238
  }
236
239
 
237
240
  // signTypedData matches implementation from ethers JsonRpcSigner for compatibility, but with
@@ -363,6 +366,17 @@ export class Web3Signer extends Signer implements TypedDataSigner {
363
366
  // ethers JsonRpcSigner methods
364
367
  //
365
368
 
369
+ async _legacySignMessage(message: Bytes | string, chainId?: ChainIdLike, allSigners?: boolean): Promise<string> {
370
+ const provider = await this.getSender(maybeChainId(chainId) || this.defaultChainId)
371
+
372
+ const data = typeof message === 'string' ? ethers.utils.toUtf8Bytes(message) : message
373
+ const address = await this.getAddress()
374
+
375
+ // https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign
376
+ // NOTE: ethers since 5.5 has switched to using personal_sign, we should review, etc.
377
+ return await provider!.send('eth_sign', [address, ethers.utils.hexlify(data)])
378
+ }
379
+
366
380
  async _signTypedData(
367
381
  domain: TypedDataDomain,
368
382
  types: Record<string, Array<TypedDataField>>,