@portal-hq/web 3.11.0 → 3.12.0
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.
- package/lib/commonjs/index.js +12 -7
- package/lib/commonjs/index.test.js +1 -1
- package/lib/commonjs/mpc/index.js +58 -10
- package/lib/commonjs/mpc/index.test.js +202 -100
- package/lib/commonjs/namespaces/evmAccountType/index.test.js +25 -12
- package/lib/commonjs/provider/index.js +14 -17
- package/lib/commonjs/provider/index.test.js +25 -2
- package/lib/commonjs/shared/logger.js +59 -0
- package/lib/commonjs/shared/trace/index.js +55 -0
- package/lib/commonjs/shared/types/index.js +2 -1
- package/lib/esm/index.js +12 -7
- package/lib/esm/index.test.js +1 -1
- package/lib/esm/mpc/index.js +58 -10
- package/lib/esm/mpc/index.test.js +202 -100
- package/lib/esm/namespaces/evmAccountType/index.test.js +25 -12
- package/lib/esm/provider/index.js +14 -17
- package/lib/esm/provider/index.test.js +25 -2
- package/lib/esm/shared/logger.js +56 -0
- package/lib/esm/shared/trace/index.js +51 -0
- package/lib/esm/shared/types/index.js +2 -1
- package/package.json +1 -1
- package/src/index.test.ts +1 -0
- package/src/index.ts +14 -3
- package/src/logger/index.ts +1 -8
- package/src/mpc/index.test.ts +202 -100
- package/src/mpc/index.ts +73 -5
- package/src/namespaces/evmAccountType/index.test.ts +25 -12
- package/src/provider/index.test.ts +30 -2
- package/src/provider/index.ts +17 -3
- package/src/shared/logger.ts +69 -0
- package/src/shared/trace/index.ts +59 -0
- package/src/shared/types/api.ts +5 -0
- package/src/shared/types/common.ts +14 -0
- package/src/shared/types/index.ts +2 -1
- package/types.d.ts +1 -0
package/src/mpc/index.test.ts
CHANGED
|
@@ -115,7 +115,8 @@ describe('Mpc', () => {
|
|
|
115
115
|
const { type, data } = message
|
|
116
116
|
|
|
117
117
|
expect(type).toEqual('portal:wasm:backup')
|
|
118
|
-
expect(data).
|
|
118
|
+
expect(data).toMatchObject(args)
|
|
119
|
+
expect(typeof message.traceId).toBe('string')
|
|
119
120
|
expect(origin).toEqual(mockHostOrigin)
|
|
120
121
|
|
|
121
122
|
window.dispatchEvent(
|
|
@@ -205,7 +206,8 @@ describe('Mpc', () => {
|
|
|
205
206
|
const { type, data } = message
|
|
206
207
|
|
|
207
208
|
expect(type).toEqual('portal:wasm:backup')
|
|
208
|
-
expect(data).
|
|
209
|
+
expect(data).toMatchObject(args)
|
|
210
|
+
expect(typeof message.traceId).toBe('string')
|
|
209
211
|
expect(origin).toEqual(mockHostOrigin)
|
|
210
212
|
|
|
211
213
|
window.dispatchEvent(
|
|
@@ -255,7 +257,8 @@ describe('Mpc', () => {
|
|
|
255
257
|
const { type, data } = message
|
|
256
258
|
|
|
257
259
|
expect(type).toEqual('portal:wasm:backup')
|
|
258
|
-
expect(data).
|
|
260
|
+
expect(data).toMatchObject(args)
|
|
261
|
+
expect(typeof message.traceId).toBe('string')
|
|
259
262
|
expect(origin).toEqual(mockHostOrigin)
|
|
260
263
|
|
|
261
264
|
window.dispatchEvent(
|
|
@@ -383,7 +386,8 @@ describe('Mpc', () => {
|
|
|
383
386
|
const { type, data } = message
|
|
384
387
|
|
|
385
388
|
expect(type).toEqual('portal:destroy')
|
|
386
|
-
expect(data).
|
|
389
|
+
expect(data).toMatchObject({})
|
|
390
|
+
expect(typeof message.traceId).toBe('string')
|
|
387
391
|
expect(origin).toEqual(mockHostOrigin)
|
|
388
392
|
|
|
389
393
|
window.dispatchEvent(
|
|
@@ -423,7 +427,8 @@ describe('Mpc', () => {
|
|
|
423
427
|
const { type, data } = message
|
|
424
428
|
|
|
425
429
|
expect(type).toEqual('portal:wasm:generate')
|
|
426
|
-
expect(data).
|
|
430
|
+
expect(data).toMatchObject(args)
|
|
431
|
+
expect(typeof message.traceId).toBe('string')
|
|
427
432
|
expect(origin).toEqual(mockHostOrigin)
|
|
428
433
|
|
|
429
434
|
window.dispatchEvent(
|
|
@@ -491,7 +496,8 @@ describe('Mpc', () => {
|
|
|
491
496
|
const { type, data } = message
|
|
492
497
|
|
|
493
498
|
expect(type).toEqual('portal:wasm:generate')
|
|
494
|
-
expect(data).
|
|
499
|
+
expect(data).toMatchObject(args)
|
|
500
|
+
expect(typeof message.traceId).toBe('string')
|
|
495
501
|
expect(origin).toEqual(mockHostOrigin)
|
|
496
502
|
|
|
497
503
|
window.dispatchEvent(
|
|
@@ -531,7 +537,8 @@ describe('Mpc', () => {
|
|
|
531
537
|
const { type, data } = message
|
|
532
538
|
|
|
533
539
|
expect(type).toEqual('portal:address')
|
|
534
|
-
expect(data).
|
|
540
|
+
expect(data).toMatchObject({})
|
|
541
|
+
expect(typeof message.traceId).toBe('string')
|
|
535
542
|
expect(origin).toEqual(mockHostOrigin)
|
|
536
543
|
|
|
537
544
|
window.dispatchEvent(
|
|
@@ -575,7 +582,8 @@ describe('Mpc', () => {
|
|
|
575
582
|
const { type, data } = message
|
|
576
583
|
|
|
577
584
|
expect(type).toEqual('portal:wasm:recover')
|
|
578
|
-
expect(data).
|
|
585
|
+
expect(data).toMatchObject(args)
|
|
586
|
+
expect(typeof message.traceId).toBe('string')
|
|
579
587
|
expect(origin).toEqual(mockHostOrigin)
|
|
580
588
|
|
|
581
589
|
window.dispatchEvent(
|
|
@@ -659,7 +667,8 @@ describe('Mpc', () => {
|
|
|
659
667
|
const { type, data } = message
|
|
660
668
|
|
|
661
669
|
expect(type).toEqual('portal:wasm:recover')
|
|
662
|
-
expect(data).
|
|
670
|
+
expect(data).toMatchObject(args)
|
|
671
|
+
expect(typeof message.traceId).toBe('string')
|
|
663
672
|
expect(origin).toEqual(mockHostOrigin)
|
|
664
673
|
|
|
665
674
|
window.dispatchEvent(
|
|
@@ -709,7 +718,8 @@ describe('Mpc', () => {
|
|
|
709
718
|
const { type, data } = message
|
|
710
719
|
|
|
711
720
|
expect(type).toEqual('portal:wasm:eject')
|
|
712
|
-
expect(data).
|
|
721
|
+
expect(data).toMatchObject(args)
|
|
722
|
+
expect(typeof message.traceId).toBe('string')
|
|
713
723
|
expect(origin).toEqual(mockHostOrigin)
|
|
714
724
|
|
|
715
725
|
window.dispatchEvent(
|
|
@@ -742,7 +752,8 @@ describe('Mpc', () => {
|
|
|
742
752
|
const { type, data } = message
|
|
743
753
|
|
|
744
754
|
expect(type).toEqual('portal:wasm:eject')
|
|
745
|
-
expect(data).
|
|
755
|
+
expect(data).toMatchObject(args)
|
|
756
|
+
expect(typeof message.traceId).toBe('string')
|
|
746
757
|
expect(origin).toEqual(mockHostOrigin)
|
|
747
758
|
|
|
748
759
|
window.dispatchEvent(
|
|
@@ -792,7 +803,8 @@ describe('Mpc', () => {
|
|
|
792
803
|
const { type, data } = message
|
|
793
804
|
|
|
794
805
|
expect(type).toEqual('portal:wasm:ejectPrivateKeys')
|
|
795
|
-
expect(data).
|
|
806
|
+
expect(data).toMatchObject(args)
|
|
807
|
+
expect(typeof message.traceId).toBe('string')
|
|
796
808
|
expect(origin).toEqual(mockHostOrigin)
|
|
797
809
|
|
|
798
810
|
window.dispatchEvent(
|
|
@@ -825,7 +837,8 @@ describe('Mpc', () => {
|
|
|
825
837
|
const { type, data } = message
|
|
826
838
|
|
|
827
839
|
expect(type).toEqual('portal:wasm:ejectPrivateKeys')
|
|
828
|
-
expect(data).
|
|
840
|
+
expect(data).toMatchObject(args)
|
|
841
|
+
expect(typeof message.traceId).toBe('string')
|
|
829
842
|
expect(origin).toEqual(mockHostOrigin)
|
|
830
843
|
|
|
831
844
|
window.dispatchEvent(
|
|
@@ -870,7 +883,8 @@ describe('Mpc', () => {
|
|
|
870
883
|
const { type, data } = message
|
|
871
884
|
|
|
872
885
|
expect(type).toEqual('portal:mpc:rawSign')
|
|
873
|
-
expect(data).
|
|
886
|
+
expect(data).toMatchObject(args)
|
|
887
|
+
expect(typeof message.traceId).toBe('string')
|
|
874
888
|
expect(origin).toEqual(mockHostOrigin)
|
|
875
889
|
|
|
876
890
|
window.dispatchEvent(
|
|
@@ -903,7 +917,8 @@ describe('Mpc', () => {
|
|
|
903
917
|
const { type, data } = message
|
|
904
918
|
|
|
905
919
|
expect(type).toEqual('portal:mpc:rawSign')
|
|
906
|
-
expect(data).
|
|
920
|
+
expect(data).toMatchObject(args)
|
|
921
|
+
expect(typeof message.traceId).toBe('string')
|
|
907
922
|
expect(origin).toEqual(mockHostOrigin)
|
|
908
923
|
|
|
909
924
|
window.dispatchEvent(
|
|
@@ -950,7 +965,8 @@ describe('Mpc', () => {
|
|
|
950
965
|
const { type, data } = message
|
|
951
966
|
|
|
952
967
|
expect(type).toEqual('portal:wasm:sign')
|
|
953
|
-
expect(data).
|
|
968
|
+
expect(data).toMatchObject(args)
|
|
969
|
+
expect(typeof message.traceId).toBe('string')
|
|
954
970
|
expect(origin).toEqual(mockHostOrigin)
|
|
955
971
|
|
|
956
972
|
window.dispatchEvent(
|
|
@@ -984,7 +1000,8 @@ describe('Mpc', () => {
|
|
|
984
1000
|
const { type, data } = message
|
|
985
1001
|
|
|
986
1002
|
expect(type).toEqual('portal:wasm:sign')
|
|
987
|
-
expect(data).
|
|
1003
|
+
expect(data).toMatchObject(args)
|
|
1004
|
+
expect(typeof message.traceId).toBe('string')
|
|
988
1005
|
expect(origin).toEqual(mockHostOrigin)
|
|
989
1006
|
|
|
990
1007
|
window.dispatchEvent(
|
|
@@ -1024,7 +1041,8 @@ describe('Mpc', () => {
|
|
|
1024
1041
|
const { type, data } = message
|
|
1025
1042
|
|
|
1026
1043
|
expect(type).toEqual('portal:checkSharesOnDevice')
|
|
1027
|
-
expect(data).
|
|
1044
|
+
expect(data).toMatchObject({})
|
|
1045
|
+
expect(typeof message.traceId).toBe('string')
|
|
1028
1046
|
expect(origin).toEqual(mockHostOrigin)
|
|
1029
1047
|
|
|
1030
1048
|
window.dispatchEvent(
|
|
@@ -1057,7 +1075,8 @@ describe('Mpc', () => {
|
|
|
1057
1075
|
const { type, data } = message
|
|
1058
1076
|
|
|
1059
1077
|
expect(type).toEqual('portal:checkSharesOnDevice')
|
|
1060
|
-
expect(data).
|
|
1078
|
+
expect(data).toMatchObject({})
|
|
1079
|
+
expect(typeof message.traceId).toBe('string')
|
|
1061
1080
|
expect(origin).toEqual(mockHostOrigin)
|
|
1062
1081
|
|
|
1063
1082
|
window.dispatchEvent(
|
|
@@ -1100,7 +1119,8 @@ describe('Mpc', () => {
|
|
|
1100
1119
|
const { type, data } = message
|
|
1101
1120
|
|
|
1102
1121
|
expect(type).toEqual('portal:getBalances')
|
|
1103
|
-
expect(data).
|
|
1122
|
+
expect(data).toMatchObject({ chainId: args[0] })
|
|
1123
|
+
expect(typeof message.traceId).toBe('string')
|
|
1104
1124
|
expect(origin).toEqual(mockHostOrigin)
|
|
1105
1125
|
|
|
1106
1126
|
window.dispatchEvent(
|
|
@@ -1133,7 +1153,8 @@ describe('Mpc', () => {
|
|
|
1133
1153
|
const { type, data } = message
|
|
1134
1154
|
|
|
1135
1155
|
expect(type).toEqual('portal:getBalances')
|
|
1136
|
-
expect(data).
|
|
1156
|
+
expect(data).toMatchObject({ chainId: args[0] })
|
|
1157
|
+
expect(typeof message.traceId).toBe('string')
|
|
1137
1158
|
expect(origin).toEqual(mockHostOrigin)
|
|
1138
1159
|
|
|
1139
1160
|
window.dispatchEvent(
|
|
@@ -1175,7 +1196,8 @@ describe('Mpc', () => {
|
|
|
1175
1196
|
const { type, data } = message
|
|
1176
1197
|
|
|
1177
1198
|
expect(type).toEqual('portal:getClient')
|
|
1178
|
-
expect(data).
|
|
1199
|
+
expect(data).toMatchObject({})
|
|
1200
|
+
expect(typeof message.traceId).toBe('string')
|
|
1179
1201
|
expect(origin).toEqual(mockHostOrigin)
|
|
1180
1202
|
|
|
1181
1203
|
window.dispatchEvent(
|
|
@@ -1208,7 +1230,8 @@ describe('Mpc', () => {
|
|
|
1208
1230
|
const { type, data } = message
|
|
1209
1231
|
|
|
1210
1232
|
expect(type).toEqual('portal:getClient')
|
|
1211
|
-
expect(data).
|
|
1233
|
+
expect(data).toMatchObject({})
|
|
1234
|
+
expect(typeof message.traceId).toBe('string')
|
|
1212
1235
|
expect(origin).toEqual(mockHostOrigin)
|
|
1213
1236
|
|
|
1214
1237
|
window.dispatchEvent(
|
|
@@ -1251,7 +1274,8 @@ describe('Mpc', () => {
|
|
|
1251
1274
|
const { type, data } = message
|
|
1252
1275
|
|
|
1253
1276
|
expect(type).toEqual('portal:getNFTs')
|
|
1254
|
-
expect(data).
|
|
1277
|
+
expect(data).toMatchObject({ chainId: args[0] })
|
|
1278
|
+
expect(typeof message.traceId).toBe('string')
|
|
1255
1279
|
expect(origin).toEqual(mockHostOrigin)
|
|
1256
1280
|
|
|
1257
1281
|
window.dispatchEvent(
|
|
@@ -1284,7 +1308,8 @@ describe('Mpc', () => {
|
|
|
1284
1308
|
const { type, data } = message
|
|
1285
1309
|
|
|
1286
1310
|
expect(type).toEqual('portal:getNFTs')
|
|
1287
|
-
expect(data).
|
|
1311
|
+
expect(data).toMatchObject({ chainId: args[0] })
|
|
1312
|
+
expect(typeof message.traceId).toBe('string')
|
|
1288
1313
|
expect(origin).toEqual(mockHostOrigin)
|
|
1289
1314
|
|
|
1290
1315
|
window.dispatchEvent(
|
|
@@ -1327,7 +1352,8 @@ describe('Mpc', () => {
|
|
|
1327
1352
|
const { type, data } = message
|
|
1328
1353
|
|
|
1329
1354
|
expect(type).toEqual('portal:getNFTAssets')
|
|
1330
|
-
expect(data).
|
|
1355
|
+
expect(data).toMatchObject({ chainId: args[0] })
|
|
1356
|
+
expect(typeof message.traceId).toBe('string')
|
|
1331
1357
|
expect(origin).toEqual(mockHostOrigin)
|
|
1332
1358
|
|
|
1333
1359
|
window.dispatchEvent(
|
|
@@ -1360,7 +1386,8 @@ describe('Mpc', () => {
|
|
|
1360
1386
|
const { type, data } = message
|
|
1361
1387
|
|
|
1362
1388
|
expect(type).toEqual('portal:getNFTAssets')
|
|
1363
|
-
expect(data).
|
|
1389
|
+
expect(data).toMatchObject({ chainId: args[0] })
|
|
1390
|
+
expect(typeof message.traceId).toBe('string')
|
|
1364
1391
|
expect(origin).toEqual(mockHostOrigin)
|
|
1365
1392
|
|
|
1366
1393
|
window.dispatchEvent(
|
|
@@ -1402,7 +1429,8 @@ describe('Mpc', () => {
|
|
|
1402
1429
|
const { type, data } = message
|
|
1403
1430
|
|
|
1404
1431
|
expect(type).toEqual('portal:getAssets')
|
|
1405
|
-
expect(data).
|
|
1432
|
+
expect(data).toMatchObject({ chainId: 'eip155:1', includeNfts: true })
|
|
1433
|
+
expect(typeof message.traceId).toBe('string')
|
|
1406
1434
|
expect(origin).toEqual(mockHostOrigin)
|
|
1407
1435
|
|
|
1408
1436
|
window.dispatchEvent(
|
|
@@ -1435,7 +1463,8 @@ describe('Mpc', () => {
|
|
|
1435
1463
|
const { type, data } = message
|
|
1436
1464
|
|
|
1437
1465
|
expect(type).toEqual('portal:getAssets')
|
|
1438
|
-
expect(data).
|
|
1466
|
+
expect(data).toMatchObject({ chainId: 'eip155:1', includeNfts: true })
|
|
1467
|
+
expect(typeof message.traceId).toBe('string')
|
|
1439
1468
|
expect(origin).toEqual(mockHostOrigin)
|
|
1440
1469
|
|
|
1441
1470
|
window.dispatchEvent(
|
|
@@ -1477,12 +1506,13 @@ describe('Mpc', () => {
|
|
|
1477
1506
|
const { type, data } = message
|
|
1478
1507
|
|
|
1479
1508
|
expect(type).toEqual('portal:buildTransaction')
|
|
1480
|
-
expect(data).
|
|
1509
|
+
expect(data).toMatchObject({
|
|
1481
1510
|
chainId: 'eip155:1',
|
|
1482
1511
|
to: mockAddress,
|
|
1483
1512
|
token: 'USDT',
|
|
1484
1513
|
amount: '42',
|
|
1485
1514
|
})
|
|
1515
|
+
expect(typeof message.traceId).toBe('string')
|
|
1486
1516
|
expect(origin).toEqual(mockHostOrigin)
|
|
1487
1517
|
|
|
1488
1518
|
window.dispatchEvent(
|
|
@@ -1515,12 +1545,13 @@ describe('Mpc', () => {
|
|
|
1515
1545
|
const { type, data } = message
|
|
1516
1546
|
|
|
1517
1547
|
expect(type).toEqual('portal:buildTransaction')
|
|
1518
|
-
expect(data).
|
|
1548
|
+
expect(data).toMatchObject({
|
|
1519
1549
|
chainId: 'eip155:1',
|
|
1520
1550
|
to: mockAddress,
|
|
1521
1551
|
token: 'USDT',
|
|
1522
1552
|
amount: '42',
|
|
1523
1553
|
})
|
|
1554
|
+
expect(typeof message.traceId).toBe('string')
|
|
1524
1555
|
expect(origin).toEqual(mockHostOrigin)
|
|
1525
1556
|
|
|
1526
1557
|
window.dispatchEvent(
|
|
@@ -1562,11 +1593,12 @@ describe('Mpc', () => {
|
|
|
1562
1593
|
const { type, data } = message
|
|
1563
1594
|
|
|
1564
1595
|
expect(type).toEqual('portal:swaps:getQuote')
|
|
1565
|
-
expect(data).
|
|
1596
|
+
expect(data).toMatchObject({
|
|
1566
1597
|
apiKey: mockApikey,
|
|
1567
1598
|
args: mockQuoteArgs,
|
|
1568
1599
|
chainId: 'eip155:1',
|
|
1569
1600
|
})
|
|
1601
|
+
expect(typeof message.traceId).toBe('string')
|
|
1570
1602
|
expect(origin).toEqual(mockHostOrigin)
|
|
1571
1603
|
|
|
1572
1604
|
window.dispatchEvent(
|
|
@@ -1599,11 +1631,12 @@ describe('Mpc', () => {
|
|
|
1599
1631
|
const { type, data } = message
|
|
1600
1632
|
|
|
1601
1633
|
expect(type).toEqual('portal:swaps:getQuote')
|
|
1602
|
-
expect(data).
|
|
1634
|
+
expect(data).toMatchObject({
|
|
1603
1635
|
apiKey: mockApikey,
|
|
1604
1636
|
args: mockQuoteArgs,
|
|
1605
1637
|
chainId: 'eip155:1',
|
|
1606
1638
|
})
|
|
1639
|
+
expect(typeof message.traceId).toBe('string')
|
|
1607
1640
|
expect(origin).toEqual(mockHostOrigin)
|
|
1608
1641
|
|
|
1609
1642
|
window.dispatchEvent(
|
|
@@ -1645,7 +1678,8 @@ describe('Mpc', () => {
|
|
|
1645
1678
|
const { type, data } = message
|
|
1646
1679
|
|
|
1647
1680
|
expect(type).toEqual('portal:swaps:getSources')
|
|
1648
|
-
expect(data).
|
|
1681
|
+
expect(data).toMatchObject({ apiKey: mockApikey, chainId: 'eip155:1' })
|
|
1682
|
+
expect(typeof message.traceId).toBe('string')
|
|
1649
1683
|
expect(origin).toEqual(mockHostOrigin)
|
|
1650
1684
|
|
|
1651
1685
|
window.dispatchEvent(
|
|
@@ -1678,7 +1712,8 @@ describe('Mpc', () => {
|
|
|
1678
1712
|
const { type, data } = message
|
|
1679
1713
|
|
|
1680
1714
|
expect(type).toEqual('portal:swaps:getSources')
|
|
1681
|
-
expect(data).
|
|
1715
|
+
expect(data).toMatchObject({ apiKey: mockApikey, chainId: 'eip155:1' })
|
|
1716
|
+
expect(typeof message.traceId).toBe('string')
|
|
1682
1717
|
expect(origin).toEqual(mockHostOrigin)
|
|
1683
1718
|
|
|
1684
1719
|
window.dispatchEvent(
|
|
@@ -1720,12 +1755,13 @@ describe('Mpc', () => {
|
|
|
1720
1755
|
const { type, data } = message
|
|
1721
1756
|
|
|
1722
1757
|
expect(type).toEqual('portal:getTransactions')
|
|
1723
|
-
expect(data).
|
|
1758
|
+
expect(data).toMatchObject({
|
|
1724
1759
|
chainId: 'eip155:1',
|
|
1725
1760
|
limit: undefined,
|
|
1726
1761
|
offset: undefined,
|
|
1727
1762
|
order: undefined,
|
|
1728
1763
|
})
|
|
1764
|
+
expect(typeof message.traceId).toBe('string')
|
|
1729
1765
|
expect(origin).toEqual(mockHostOrigin)
|
|
1730
1766
|
|
|
1731
1767
|
window.dispatchEvent(
|
|
@@ -1758,12 +1794,13 @@ describe('Mpc', () => {
|
|
|
1758
1794
|
const { type, data } = message
|
|
1759
1795
|
|
|
1760
1796
|
expect(type).toEqual('portal:getTransactions')
|
|
1761
|
-
expect(data).
|
|
1797
|
+
expect(data).toMatchObject({
|
|
1762
1798
|
chainId: 'eip155:1',
|
|
1763
1799
|
limit: undefined,
|
|
1764
1800
|
offset: undefined,
|
|
1765
1801
|
order: undefined,
|
|
1766
1802
|
})
|
|
1803
|
+
expect(typeof message.traceId).toBe('string')
|
|
1767
1804
|
expect(origin).toEqual(mockHostOrigin)
|
|
1768
1805
|
|
|
1769
1806
|
window.dispatchEvent(
|
|
@@ -1805,10 +1842,11 @@ describe('Mpc', () => {
|
|
|
1805
1842
|
const { type, data } = message
|
|
1806
1843
|
|
|
1807
1844
|
expect(type).toEqual('portal:api:setBackupStatus')
|
|
1808
|
-
expect(data).
|
|
1845
|
+
expect(data).toMatchObject({
|
|
1809
1846
|
backupIds: mockBackupIds,
|
|
1810
1847
|
status: 'STORED_CLIENT_BACKUP_SHARE',
|
|
1811
1848
|
})
|
|
1849
|
+
expect(typeof message.traceId).toBe('string')
|
|
1812
1850
|
expect(origin).toEqual(mockHostOrigin)
|
|
1813
1851
|
|
|
1814
1852
|
window.dispatchEvent(
|
|
@@ -1841,10 +1879,11 @@ describe('Mpc', () => {
|
|
|
1841
1879
|
const { type, data } = message
|
|
1842
1880
|
|
|
1843
1881
|
expect(type).toEqual('portal:api:setBackupStatus')
|
|
1844
|
-
expect(data).
|
|
1882
|
+
expect(data).toMatchObject({
|
|
1845
1883
|
backupIds: mockBackupIds,
|
|
1846
1884
|
status: 'STORED_CLIENT_BACKUP_SHARE',
|
|
1847
1885
|
})
|
|
1886
|
+
expect(typeof message.traceId).toBe('string')
|
|
1848
1887
|
expect(origin).toEqual(mockHostOrigin)
|
|
1849
1888
|
|
|
1850
1889
|
window.dispatchEvent(
|
|
@@ -1886,10 +1925,11 @@ describe('Mpc', () => {
|
|
|
1886
1925
|
const { type, data } = message
|
|
1887
1926
|
|
|
1888
1927
|
expect(type).toEqual('portal:simulateTransaction')
|
|
1889
|
-
expect(data).
|
|
1928
|
+
expect(data).toMatchObject({
|
|
1890
1929
|
chainId: 'eip155:1',
|
|
1891
1930
|
transaction: mockTransactionToSimulate,
|
|
1892
1931
|
})
|
|
1932
|
+
expect(typeof message.traceId).toBe('string')
|
|
1893
1933
|
expect(origin).toEqual(mockHostOrigin)
|
|
1894
1934
|
|
|
1895
1935
|
window.dispatchEvent(
|
|
@@ -1922,10 +1962,11 @@ describe('Mpc', () => {
|
|
|
1922
1962
|
const { type, data } = message
|
|
1923
1963
|
|
|
1924
1964
|
expect(type).toEqual('portal:simulateTransaction')
|
|
1925
|
-
expect(data).
|
|
1965
|
+
expect(data).toMatchObject({
|
|
1926
1966
|
chainId: 'eip155:1',
|
|
1927
1967
|
transaction: mockTransactionToSimulate,
|
|
1928
1968
|
})
|
|
1969
|
+
expect(typeof message.traceId).toBe('string')
|
|
1929
1970
|
expect(origin).toEqual(mockHostOrigin)
|
|
1930
1971
|
|
|
1931
1972
|
window.dispatchEvent(
|
|
@@ -1967,11 +2008,12 @@ describe('Mpc', () => {
|
|
|
1967
2008
|
const { type, data } = message
|
|
1968
2009
|
|
|
1969
2010
|
expect(type).toEqual('portal:evaluateTransaction')
|
|
1970
|
-
expect(data).
|
|
2011
|
+
expect(data).toMatchObject({
|
|
1971
2012
|
chainId: 'eip155:1',
|
|
1972
2013
|
transaction: mockTransactionToEvaluate,
|
|
1973
2014
|
operationType: 'all',
|
|
1974
2015
|
})
|
|
2016
|
+
expect(typeof message.traceId).toBe('string')
|
|
1975
2017
|
expect(origin).toEqual(mockHostOrigin)
|
|
1976
2018
|
|
|
1977
2019
|
window.dispatchEvent(
|
|
@@ -2004,11 +2046,12 @@ describe('Mpc', () => {
|
|
|
2004
2046
|
const { type, data } = message
|
|
2005
2047
|
|
|
2006
2048
|
expect(type).toEqual('portal:evaluateTransaction')
|
|
2007
|
-
expect(data).
|
|
2049
|
+
expect(data).toMatchObject({
|
|
2008
2050
|
chainId: 'eip155:1',
|
|
2009
2051
|
transaction: mockTransactionToEvaluate,
|
|
2010
2052
|
operationType: 'all',
|
|
2011
2053
|
})
|
|
2054
|
+
expect(typeof message.traceId).toBe('string')
|
|
2012
2055
|
expect(origin).toEqual(mockHostOrigin)
|
|
2013
2056
|
|
|
2014
2057
|
window.dispatchEvent(
|
|
@@ -2048,10 +2091,11 @@ describe('Mpc', () => {
|
|
|
2048
2091
|
const { type, data } = message
|
|
2049
2092
|
|
|
2050
2093
|
expect(type).toEqual('portal:storedClientBackupShare')
|
|
2051
|
-
expect(data).
|
|
2094
|
+
expect(data).toMatchObject({
|
|
2052
2095
|
success: true,
|
|
2053
2096
|
backupMethod: BackupMethods.password,
|
|
2054
2097
|
})
|
|
2098
|
+
expect(typeof message.traceId).toBe('string')
|
|
2055
2099
|
expect(origin).toEqual(mockHostOrigin)
|
|
2056
2100
|
|
|
2057
2101
|
window.dispatchEvent(
|
|
@@ -2084,10 +2128,11 @@ describe('Mpc', () => {
|
|
|
2084
2128
|
const { type, data } = message
|
|
2085
2129
|
|
|
2086
2130
|
expect(type).toEqual('portal:storedClientBackupShare')
|
|
2087
|
-
expect(data).
|
|
2131
|
+
expect(data).toMatchObject({
|
|
2088
2132
|
success: true,
|
|
2089
2133
|
backupMethod: BackupMethods.password,
|
|
2090
2134
|
})
|
|
2135
|
+
expect(typeof message.traceId).toBe('string')
|
|
2091
2136
|
expect(origin).toEqual(mockHostOrigin)
|
|
2092
2137
|
|
|
2093
2138
|
window.dispatchEvent(
|
|
@@ -2130,7 +2175,8 @@ describe('Mpc', () => {
|
|
|
2130
2175
|
const { type, data } = message
|
|
2131
2176
|
|
|
2132
2177
|
expect(type).toEqual('portal:yieldxyz:discover')
|
|
2133
|
-
expect(data).
|
|
2178
|
+
expect(data).toMatchObject(args)
|
|
2179
|
+
expect(typeof message.traceId).toBe('string')
|
|
2134
2180
|
expect(origin).toEqual(mockHostOrigin)
|
|
2135
2181
|
|
|
2136
2182
|
window.dispatchEvent(
|
|
@@ -2163,7 +2209,8 @@ describe('Mpc', () => {
|
|
|
2163
2209
|
const { type, data } = message
|
|
2164
2210
|
|
|
2165
2211
|
expect(type).toEqual('portal:yieldxyz:discover')
|
|
2166
|
-
expect(data).
|
|
2212
|
+
expect(data).toMatchObject(args)
|
|
2213
|
+
expect(typeof message.traceId).toBe('string')
|
|
2167
2214
|
expect(origin).toEqual(mockHostOrigin)
|
|
2168
2215
|
|
|
2169
2216
|
window.dispatchEvent(
|
|
@@ -2206,7 +2253,8 @@ describe('Mpc', () => {
|
|
|
2206
2253
|
const { type, data } = message
|
|
2207
2254
|
|
|
2208
2255
|
expect(type).toEqual('portal:yieldxyz:enter')
|
|
2209
|
-
expect(data).
|
|
2256
|
+
expect(data).toMatchObject(args)
|
|
2257
|
+
expect(typeof message.traceId).toBe('string')
|
|
2210
2258
|
expect(origin).toEqual(mockHostOrigin)
|
|
2211
2259
|
|
|
2212
2260
|
window.dispatchEvent(
|
|
@@ -2239,7 +2287,8 @@ describe('Mpc', () => {
|
|
|
2239
2287
|
const { type, data } = message
|
|
2240
2288
|
|
|
2241
2289
|
expect(type).toEqual('portal:yieldxyz:enter')
|
|
2242
|
-
expect(data).
|
|
2290
|
+
expect(data).toMatchObject(args)
|
|
2291
|
+
expect(typeof message.traceId).toBe('string')
|
|
2243
2292
|
expect(origin).toEqual(mockHostOrigin)
|
|
2244
2293
|
|
|
2245
2294
|
window.dispatchEvent(
|
|
@@ -2282,7 +2331,8 @@ describe('Mpc', () => {
|
|
|
2282
2331
|
const { type, data } = message
|
|
2283
2332
|
|
|
2284
2333
|
expect(type).toEqual('portal:yieldxyz:exit')
|
|
2285
|
-
expect(data).
|
|
2334
|
+
expect(data).toMatchObject(args)
|
|
2335
|
+
expect(typeof message.traceId).toBe('string')
|
|
2286
2336
|
expect(origin).toEqual(mockHostOrigin)
|
|
2287
2337
|
|
|
2288
2338
|
window.dispatchEvent(
|
|
@@ -2315,7 +2365,8 @@ describe('Mpc', () => {
|
|
|
2315
2365
|
const { type, data } = message
|
|
2316
2366
|
|
|
2317
2367
|
expect(type).toEqual('portal:yieldxyz:exit')
|
|
2318
|
-
expect(data).
|
|
2368
|
+
expect(data).toMatchObject(args)
|
|
2369
|
+
expect(typeof message.traceId).toBe('string')
|
|
2319
2370
|
expect(origin).toEqual(mockHostOrigin)
|
|
2320
2371
|
|
|
2321
2372
|
window.dispatchEvent(
|
|
@@ -2358,7 +2409,8 @@ describe('Mpc', () => {
|
|
|
2358
2409
|
const { type, data } = message
|
|
2359
2410
|
|
|
2360
2411
|
expect(type).toEqual('portal:yieldxyz:getBalances')
|
|
2361
|
-
expect(data).
|
|
2412
|
+
expect(data).toMatchObject(args)
|
|
2413
|
+
expect(typeof message.traceId).toBe('string')
|
|
2362
2414
|
expect(origin).toEqual(mockHostOrigin)
|
|
2363
2415
|
|
|
2364
2416
|
window.dispatchEvent(
|
|
@@ -2391,7 +2443,8 @@ describe('Mpc', () => {
|
|
|
2391
2443
|
const { type, data } = message
|
|
2392
2444
|
|
|
2393
2445
|
expect(type).toEqual('portal:yieldxyz:getBalances')
|
|
2394
|
-
expect(data).
|
|
2446
|
+
expect(data).toMatchObject(args)
|
|
2447
|
+
expect(typeof message.traceId).toBe('string')
|
|
2395
2448
|
expect(origin).toEqual(mockHostOrigin)
|
|
2396
2449
|
|
|
2397
2450
|
window.dispatchEvent(
|
|
@@ -2434,7 +2487,8 @@ describe('Mpc', () => {
|
|
|
2434
2487
|
const { type, data } = message
|
|
2435
2488
|
|
|
2436
2489
|
expect(type).toEqual('portal:yieldxyz:getHistoricalActions')
|
|
2437
|
-
expect(data).
|
|
2490
|
+
expect(data).toMatchObject(args)
|
|
2491
|
+
expect(typeof message.traceId).toBe('string')
|
|
2438
2492
|
expect(origin).toEqual(mockHostOrigin)
|
|
2439
2493
|
|
|
2440
2494
|
window.dispatchEvent(
|
|
@@ -2467,7 +2521,8 @@ describe('Mpc', () => {
|
|
|
2467
2521
|
const { type, data } = message
|
|
2468
2522
|
|
|
2469
2523
|
expect(type).toEqual('portal:yieldxyz:getHistoricalActions')
|
|
2470
|
-
expect(data).
|
|
2524
|
+
expect(data).toMatchObject(args)
|
|
2525
|
+
expect(typeof message.traceId).toBe('string')
|
|
2471
2526
|
expect(origin).toEqual(mockHostOrigin)
|
|
2472
2527
|
|
|
2473
2528
|
window.dispatchEvent(
|
|
@@ -2510,7 +2565,8 @@ describe('Mpc', () => {
|
|
|
2510
2565
|
const { type, data } = message
|
|
2511
2566
|
|
|
2512
2567
|
expect(type).toEqual('portal:yieldxyz:manage')
|
|
2513
|
-
expect(data).
|
|
2568
|
+
expect(data).toMatchObject(args)
|
|
2569
|
+
expect(typeof message.traceId).toBe('string')
|
|
2514
2570
|
expect(origin).toEqual(mockHostOrigin)
|
|
2515
2571
|
|
|
2516
2572
|
window.dispatchEvent(
|
|
@@ -2543,7 +2599,8 @@ describe('Mpc', () => {
|
|
|
2543
2599
|
const { type, data } = message
|
|
2544
2600
|
|
|
2545
2601
|
expect(type).toEqual('portal:yieldxyz:manage')
|
|
2546
|
-
expect(data).
|
|
2602
|
+
expect(data).toMatchObject(args)
|
|
2603
|
+
expect(typeof message.traceId).toBe('string')
|
|
2547
2604
|
expect(origin).toEqual(mockHostOrigin)
|
|
2548
2605
|
|
|
2549
2606
|
window.dispatchEvent(
|
|
@@ -2586,7 +2643,8 @@ describe('Mpc', () => {
|
|
|
2586
2643
|
const { type, data } = message
|
|
2587
2644
|
|
|
2588
2645
|
expect(type).toEqual('portal:yieldxyz:track')
|
|
2589
|
-
expect(data).
|
|
2646
|
+
expect(data).toMatchObject(args)
|
|
2647
|
+
expect(typeof message.traceId).toBe('string')
|
|
2590
2648
|
expect(origin).toEqual(mockHostOrigin)
|
|
2591
2649
|
|
|
2592
2650
|
window.dispatchEvent(
|
|
@@ -2619,7 +2677,8 @@ describe('Mpc', () => {
|
|
|
2619
2677
|
const { type, data } = message
|
|
2620
2678
|
|
|
2621
2679
|
expect(type).toEqual('portal:yieldxyz:track')
|
|
2622
|
-
expect(data).
|
|
2680
|
+
expect(data).toMatchObject(args)
|
|
2681
|
+
expect(typeof message.traceId).toBe('string')
|
|
2623
2682
|
expect(origin).toEqual(mockHostOrigin)
|
|
2624
2683
|
|
|
2625
2684
|
window.dispatchEvent(
|
|
@@ -2663,6 +2722,7 @@ describe('Mpc', () => {
|
|
|
2663
2722
|
|
|
2664
2723
|
expect(type).toEqual('portal:yieldxyz:getTransaction')
|
|
2665
2724
|
expect(data).toEqual(args)
|
|
2725
|
+
expect(typeof message.traceId).toBe('string')
|
|
2666
2726
|
expect(origin).toEqual(mockHostOrigin)
|
|
2667
2727
|
|
|
2668
2728
|
window.dispatchEvent(
|
|
@@ -2696,6 +2756,7 @@ describe('Mpc', () => {
|
|
|
2696
2756
|
|
|
2697
2757
|
expect(type).toEqual('portal:yieldxyz:getTransaction')
|
|
2698
2758
|
expect(data).toEqual(args)
|
|
2759
|
+
expect(typeof message.traceId).toBe('string')
|
|
2699
2760
|
expect(origin).toEqual(mockHostOrigin)
|
|
2700
2761
|
|
|
2701
2762
|
window.dispatchEvent(
|
|
@@ -2738,7 +2799,8 @@ describe('Mpc', () => {
|
|
|
2738
2799
|
const { type, data } = message
|
|
2739
2800
|
|
|
2740
2801
|
expect(type).toEqual('portal:lifi:getRoutes')
|
|
2741
|
-
expect(data).
|
|
2802
|
+
expect(data).toMatchObject(args)
|
|
2803
|
+
expect(typeof message.traceId).toBe('string')
|
|
2742
2804
|
expect(origin).toEqual(mockHostOrigin)
|
|
2743
2805
|
|
|
2744
2806
|
window.dispatchEvent(
|
|
@@ -2771,7 +2833,8 @@ describe('Mpc', () => {
|
|
|
2771
2833
|
const { type, data } = message
|
|
2772
2834
|
|
|
2773
2835
|
expect(type).toEqual('portal:lifi:getRoutes')
|
|
2774
|
-
expect(data).
|
|
2836
|
+
expect(data).toMatchObject(args)
|
|
2837
|
+
expect(typeof message.traceId).toBe('string')
|
|
2775
2838
|
expect(origin).toEqual(mockHostOrigin)
|
|
2776
2839
|
|
|
2777
2840
|
window.dispatchEvent(
|
|
@@ -2814,7 +2877,8 @@ describe('Mpc', () => {
|
|
|
2814
2877
|
const { type, data } = message
|
|
2815
2878
|
|
|
2816
2879
|
expect(type).toEqual('portal:lifi:getQuote')
|
|
2817
|
-
expect(data).
|
|
2880
|
+
expect(data).toMatchObject(args)
|
|
2881
|
+
expect(typeof message.traceId).toBe('string')
|
|
2818
2882
|
expect(origin).toEqual(mockHostOrigin)
|
|
2819
2883
|
|
|
2820
2884
|
window.dispatchEvent(
|
|
@@ -2847,7 +2911,8 @@ describe('Mpc', () => {
|
|
|
2847
2911
|
const { type, data } = message
|
|
2848
2912
|
|
|
2849
2913
|
expect(type).toEqual('portal:lifi:getQuote')
|
|
2850
|
-
expect(data).
|
|
2914
|
+
expect(data).toMatchObject(args)
|
|
2915
|
+
expect(typeof message.traceId).toBe('string')
|
|
2851
2916
|
expect(origin).toEqual(mockHostOrigin)
|
|
2852
2917
|
|
|
2853
2918
|
window.dispatchEvent(
|
|
@@ -2890,7 +2955,8 @@ describe('Mpc', () => {
|
|
|
2890
2955
|
const { type, data } = message
|
|
2891
2956
|
|
|
2892
2957
|
expect(type).toEqual('portal:lifi:getStatus')
|
|
2893
|
-
expect(data).
|
|
2958
|
+
expect(data).toMatchObject(args)
|
|
2959
|
+
expect(typeof message.traceId).toBe('string')
|
|
2894
2960
|
expect(origin).toEqual(mockHostOrigin)
|
|
2895
2961
|
|
|
2896
2962
|
window.dispatchEvent(
|
|
@@ -2923,7 +2989,8 @@ describe('Mpc', () => {
|
|
|
2923
2989
|
const { type, data } = message
|
|
2924
2990
|
|
|
2925
2991
|
expect(type).toEqual('portal:lifi:getStatus')
|
|
2926
|
-
expect(data).
|
|
2992
|
+
expect(data).toMatchObject(args)
|
|
2993
|
+
expect(typeof message.traceId).toBe('string')
|
|
2927
2994
|
expect(origin).toEqual(mockHostOrigin)
|
|
2928
2995
|
|
|
2929
2996
|
window.dispatchEvent(
|
|
@@ -2966,7 +3033,8 @@ describe('Mpc', () => {
|
|
|
2966
3033
|
const { type, data } = message
|
|
2967
3034
|
|
|
2968
3035
|
expect(type).toEqual('portal:lifi:getRouteStep')
|
|
2969
|
-
expect(data).
|
|
3036
|
+
expect(data).toMatchObject(args)
|
|
3037
|
+
expect(typeof message.traceId).toBe('string')
|
|
2970
3038
|
expect(origin).toEqual(mockHostOrigin)
|
|
2971
3039
|
|
|
2972
3040
|
window.dispatchEvent(
|
|
@@ -2999,7 +3067,8 @@ describe('Mpc', () => {
|
|
|
2999
3067
|
const { type, data } = message
|
|
3000
3068
|
|
|
3001
3069
|
expect(type).toEqual('portal:lifi:getRouteStep')
|
|
3002
|
-
expect(data).
|
|
3070
|
+
expect(data).toMatchObject(args)
|
|
3071
|
+
expect(typeof message.traceId).toBe('string')
|
|
3003
3072
|
expect(origin).toEqual(mockHostOrigin)
|
|
3004
3073
|
|
|
3005
3074
|
window.dispatchEvent(
|
|
@@ -3043,7 +3112,8 @@ describe('Mpc', () => {
|
|
|
3043
3112
|
const { type, data } = message
|
|
3044
3113
|
|
|
3045
3114
|
expect(type).toEqual('portal:swaps:getQuoteV2')
|
|
3046
|
-
expect(data).
|
|
3115
|
+
expect(data).toMatchObject({ ...args, options })
|
|
3116
|
+
expect(typeof message.traceId).toBe('string')
|
|
3047
3117
|
expect(origin).toEqual(mockHostOrigin)
|
|
3048
3118
|
|
|
3049
3119
|
window.dispatchEvent(
|
|
@@ -3076,7 +3146,8 @@ describe('Mpc', () => {
|
|
|
3076
3146
|
const { type, data } = message
|
|
3077
3147
|
|
|
3078
3148
|
expect(type).toEqual('portal:swaps:getQuoteV2')
|
|
3079
|
-
expect(data).
|
|
3149
|
+
expect(data).toMatchObject({ ...args, options: undefined })
|
|
3150
|
+
expect(typeof message.traceId).toBe('string')
|
|
3080
3151
|
expect(origin).toEqual(mockHostOrigin)
|
|
3081
3152
|
|
|
3082
3153
|
window.dispatchEvent(
|
|
@@ -3109,7 +3180,8 @@ describe('Mpc', () => {
|
|
|
3109
3180
|
const { type, data } = message
|
|
3110
3181
|
|
|
3111
3182
|
expect(type).toEqual('portal:swaps:getQuoteV2')
|
|
3112
|
-
expect(data).
|
|
3183
|
+
expect(data).toMatchObject({ ...args, options })
|
|
3184
|
+
expect(typeof message.traceId).toBe('string')
|
|
3113
3185
|
expect(origin).toEqual(mockHostOrigin)
|
|
3114
3186
|
|
|
3115
3187
|
window.dispatchEvent(
|
|
@@ -3153,7 +3225,8 @@ describe('Mpc', () => {
|
|
|
3153
3225
|
const { type, data } = message
|
|
3154
3226
|
|
|
3155
3227
|
expect(type).toEqual('portal:swaps:getSourcesV2')
|
|
3156
|
-
expect(data).
|
|
3228
|
+
expect(data).toMatchObject({ ...args, options })
|
|
3229
|
+
expect(typeof message.traceId).toBe('string')
|
|
3157
3230
|
expect(origin).toEqual(mockHostOrigin)
|
|
3158
3231
|
|
|
3159
3232
|
window.dispatchEvent(
|
|
@@ -3186,7 +3259,8 @@ describe('Mpc', () => {
|
|
|
3186
3259
|
const { type, data } = message
|
|
3187
3260
|
|
|
3188
3261
|
expect(type).toEqual('portal:swaps:getSourcesV2')
|
|
3189
|
-
expect(data).
|
|
3262
|
+
expect(data).toMatchObject({ ...args, options: undefined })
|
|
3263
|
+
expect(typeof message.traceId).toBe('string')
|
|
3190
3264
|
expect(origin).toEqual(mockHostOrigin)
|
|
3191
3265
|
|
|
3192
3266
|
window.dispatchEvent(
|
|
@@ -3219,7 +3293,8 @@ describe('Mpc', () => {
|
|
|
3219
3293
|
const { type, data } = message
|
|
3220
3294
|
|
|
3221
3295
|
expect(type).toEqual('portal:swaps:getSourcesV2')
|
|
3222
|
-
expect(data).
|
|
3296
|
+
expect(data).toMatchObject({ ...args, options })
|
|
3297
|
+
expect(typeof message.traceId).toBe('string')
|
|
3223
3298
|
expect(origin).toEqual(mockHostOrigin)
|
|
3224
3299
|
|
|
3225
3300
|
window.dispatchEvent(
|
|
@@ -3263,7 +3338,8 @@ describe('Mpc', () => {
|
|
|
3263
3338
|
const { type, data } = message
|
|
3264
3339
|
|
|
3265
3340
|
expect(type).toEqual('portal:swaps:getPrice')
|
|
3266
|
-
expect(data).
|
|
3341
|
+
expect(data).toMatchObject({ ...args, options })
|
|
3342
|
+
expect(typeof message.traceId).toBe('string')
|
|
3267
3343
|
expect(origin).toEqual(mockHostOrigin)
|
|
3268
3344
|
|
|
3269
3345
|
window.dispatchEvent(
|
|
@@ -3296,7 +3372,8 @@ describe('Mpc', () => {
|
|
|
3296
3372
|
const { type, data } = message
|
|
3297
3373
|
|
|
3298
3374
|
expect(type).toEqual('portal:swaps:getPrice')
|
|
3299
|
-
expect(data).
|
|
3375
|
+
expect(data).toMatchObject({ ...args, options: undefined })
|
|
3376
|
+
expect(typeof message.traceId).toBe('string')
|
|
3300
3377
|
expect(origin).toEqual(mockHostOrigin)
|
|
3301
3378
|
|
|
3302
3379
|
window.dispatchEvent(
|
|
@@ -3329,7 +3406,8 @@ describe('Mpc', () => {
|
|
|
3329
3406
|
const { type, data } = message
|
|
3330
3407
|
|
|
3331
3408
|
expect(type).toEqual('portal:swaps:getPrice')
|
|
3332
|
-
expect(data).
|
|
3409
|
+
expect(data).toMatchObject({ ...args, options })
|
|
3410
|
+
expect(typeof message.traceId).toBe('string')
|
|
3333
3411
|
expect(origin).toEqual(mockHostOrigin)
|
|
3334
3412
|
|
|
3335
3413
|
window.dispatchEvent(
|
|
@@ -3372,7 +3450,8 @@ describe('Mpc', () => {
|
|
|
3372
3450
|
const { type, data } = message
|
|
3373
3451
|
|
|
3374
3452
|
expect(type).toEqual('portal:security:scanAddresses')
|
|
3375
|
-
expect(data).
|
|
3453
|
+
expect(data).toMatchObject(args)
|
|
3454
|
+
expect(typeof message.traceId).toBe('string')
|
|
3376
3455
|
expect(origin).toEqual(mockHostOrigin)
|
|
3377
3456
|
|
|
3378
3457
|
window.dispatchEvent(
|
|
@@ -3405,7 +3484,8 @@ describe('Mpc', () => {
|
|
|
3405
3484
|
const { type, data } = message
|
|
3406
3485
|
|
|
3407
3486
|
expect(type).toEqual('portal:security:scanAddresses')
|
|
3408
|
-
expect(data).
|
|
3487
|
+
expect(data).toMatchObject(args)
|
|
3488
|
+
expect(typeof message.traceId).toBe('string')
|
|
3409
3489
|
expect(origin).toEqual(mockHostOrigin)
|
|
3410
3490
|
|
|
3411
3491
|
window.dispatchEvent(
|
|
@@ -3448,7 +3528,8 @@ describe('Mpc', () => {
|
|
|
3448
3528
|
const { type, data } = message
|
|
3449
3529
|
|
|
3450
3530
|
expect(type).toEqual('portal:security:scanEVMTx')
|
|
3451
|
-
expect(data).
|
|
3531
|
+
expect(data).toMatchObject(args)
|
|
3532
|
+
expect(typeof message.traceId).toBe('string')
|
|
3452
3533
|
expect(origin).toEqual(mockHostOrigin)
|
|
3453
3534
|
|
|
3454
3535
|
window.dispatchEvent(
|
|
@@ -3481,7 +3562,8 @@ describe('Mpc', () => {
|
|
|
3481
3562
|
const { type, data } = message
|
|
3482
3563
|
|
|
3483
3564
|
expect(type).toEqual('portal:security:scanEVMTx')
|
|
3484
|
-
expect(data).
|
|
3565
|
+
expect(data).toMatchObject(args)
|
|
3566
|
+
expect(typeof message.traceId).toBe('string')
|
|
3485
3567
|
expect(origin).toEqual(mockHostOrigin)
|
|
3486
3568
|
|
|
3487
3569
|
window.dispatchEvent(
|
|
@@ -3524,7 +3606,8 @@ describe('Mpc', () => {
|
|
|
3524
3606
|
const { type, data } = message
|
|
3525
3607
|
|
|
3526
3608
|
expect(type).toEqual('portal:security:scanEip712Tx')
|
|
3527
|
-
expect(data).
|
|
3609
|
+
expect(data).toMatchObject(args)
|
|
3610
|
+
expect(typeof message.traceId).toBe('string')
|
|
3528
3611
|
expect(origin).toEqual(mockHostOrigin)
|
|
3529
3612
|
|
|
3530
3613
|
window.dispatchEvent(
|
|
@@ -3557,7 +3640,8 @@ describe('Mpc', () => {
|
|
|
3557
3640
|
const { type, data } = message
|
|
3558
3641
|
|
|
3559
3642
|
expect(type).toEqual('portal:security:scanEip712Tx')
|
|
3560
|
-
expect(data).
|
|
3643
|
+
expect(data).toMatchObject(args)
|
|
3644
|
+
expect(typeof message.traceId).toBe('string')
|
|
3561
3645
|
expect(origin).toEqual(mockHostOrigin)
|
|
3562
3646
|
|
|
3563
3647
|
window.dispatchEvent(
|
|
@@ -3600,7 +3684,8 @@ describe('Mpc', () => {
|
|
|
3600
3684
|
const { type, data } = message
|
|
3601
3685
|
|
|
3602
3686
|
expect(type).toEqual('portal:security:scanSolanaTx')
|
|
3603
|
-
expect(data).
|
|
3687
|
+
expect(data).toMatchObject(args)
|
|
3688
|
+
expect(typeof message.traceId).toBe('string')
|
|
3604
3689
|
expect(origin).toEqual(mockHostOrigin)
|
|
3605
3690
|
|
|
3606
3691
|
window.dispatchEvent(
|
|
@@ -3633,7 +3718,8 @@ describe('Mpc', () => {
|
|
|
3633
3718
|
const { type, data } = message
|
|
3634
3719
|
|
|
3635
3720
|
expect(type).toEqual('portal:security:scanSolanaTx')
|
|
3636
|
-
expect(data).
|
|
3721
|
+
expect(data).toMatchObject(args)
|
|
3722
|
+
expect(typeof message.traceId).toBe('string')
|
|
3637
3723
|
expect(origin).toEqual(mockHostOrigin)
|
|
3638
3724
|
|
|
3639
3725
|
window.dispatchEvent(
|
|
@@ -3676,7 +3762,8 @@ describe('Mpc', () => {
|
|
|
3676
3762
|
const { type, data } = message
|
|
3677
3763
|
|
|
3678
3764
|
expect(type).toEqual('portal:security:scanNfts')
|
|
3679
|
-
expect(data).
|
|
3765
|
+
expect(data).toMatchObject(args)
|
|
3766
|
+
expect(typeof message.traceId).toBe('string')
|
|
3680
3767
|
expect(origin).toEqual(mockHostOrigin)
|
|
3681
3768
|
|
|
3682
3769
|
window.dispatchEvent(
|
|
@@ -3709,7 +3796,8 @@ describe('Mpc', () => {
|
|
|
3709
3796
|
const { type, data } = message
|
|
3710
3797
|
|
|
3711
3798
|
expect(type).toEqual('portal:security:scanNfts')
|
|
3712
|
-
expect(data).
|
|
3799
|
+
expect(data).toMatchObject(args)
|
|
3800
|
+
expect(typeof message.traceId).toBe('string')
|
|
3713
3801
|
expect(origin).toEqual(mockHostOrigin)
|
|
3714
3802
|
|
|
3715
3803
|
window.dispatchEvent(
|
|
@@ -3752,7 +3840,8 @@ describe('Mpc', () => {
|
|
|
3752
3840
|
const { type, data } = message
|
|
3753
3841
|
|
|
3754
3842
|
expect(type).toEqual('portal:security:scanTokens')
|
|
3755
|
-
expect(data).
|
|
3843
|
+
expect(data).toMatchObject(args)
|
|
3844
|
+
expect(typeof message.traceId).toBe('string')
|
|
3756
3845
|
expect(origin).toEqual(mockHostOrigin)
|
|
3757
3846
|
|
|
3758
3847
|
window.dispatchEvent(
|
|
@@ -3785,7 +3874,8 @@ describe('Mpc', () => {
|
|
|
3785
3874
|
const { type, data } = message
|
|
3786
3875
|
|
|
3787
3876
|
expect(type).toEqual('portal:security:scanTokens')
|
|
3788
|
-
expect(data).
|
|
3877
|
+
expect(data).toMatchObject(args)
|
|
3878
|
+
expect(typeof message.traceId).toBe('string')
|
|
3789
3879
|
expect(origin).toEqual(mockHostOrigin)
|
|
3790
3880
|
|
|
3791
3881
|
window.dispatchEvent(
|
|
@@ -3828,7 +3918,8 @@ describe('Mpc', () => {
|
|
|
3828
3918
|
const { type, data } = message
|
|
3829
3919
|
|
|
3830
3920
|
expect(type).toEqual('portal:security:scanUrl')
|
|
3831
|
-
expect(data).
|
|
3921
|
+
expect(data).toMatchObject({ url: args })
|
|
3922
|
+
expect(typeof message.traceId).toBe('string')
|
|
3832
3923
|
expect(origin).toEqual(mockHostOrigin)
|
|
3833
3924
|
|
|
3834
3925
|
window.dispatchEvent(
|
|
@@ -3861,7 +3952,8 @@ describe('Mpc', () => {
|
|
|
3861
3952
|
const { type, data } = message
|
|
3862
3953
|
|
|
3863
3954
|
expect(type).toEqual('portal:security:scanUrl')
|
|
3864
|
-
expect(data).
|
|
3955
|
+
expect(data).toMatchObject({ url: args })
|
|
3956
|
+
expect(typeof message.traceId).toBe('string')
|
|
3865
3957
|
expect(origin).toEqual(mockHostOrigin)
|
|
3866
3958
|
|
|
3867
3959
|
window.dispatchEvent(
|
|
@@ -3908,7 +4000,8 @@ describe('Mpc', () => {
|
|
|
3908
4000
|
const { type, data } = message
|
|
3909
4001
|
|
|
3910
4002
|
expect(type).toEqual('portal:blockaid:scanEvmTx')
|
|
3911
|
-
expect(data).
|
|
4003
|
+
expect(data).toMatchObject(args)
|
|
4004
|
+
expect(typeof message.traceId).toBe('string')
|
|
3912
4005
|
expect(origin).toEqual(mockHostOrigin)
|
|
3913
4006
|
|
|
3914
4007
|
window.dispatchEvent(
|
|
@@ -3941,7 +4034,8 @@ describe('Mpc', () => {
|
|
|
3941
4034
|
const { type, data } = message
|
|
3942
4035
|
|
|
3943
4036
|
expect(type).toEqual('portal:blockaid:scanEvmTx')
|
|
3944
|
-
expect(data).
|
|
4037
|
+
expect(data).toMatchObject(args)
|
|
4038
|
+
expect(typeof message.traceId).toBe('string')
|
|
3945
4039
|
expect(origin).toEqual(mockHostOrigin)
|
|
3946
4040
|
|
|
3947
4041
|
window.dispatchEvent(
|
|
@@ -3984,7 +4078,8 @@ describe('Mpc', () => {
|
|
|
3984
4078
|
const { type, data } = message
|
|
3985
4079
|
|
|
3986
4080
|
expect(type).toEqual('portal:blockaid:scanSolanaTx')
|
|
3987
|
-
expect(data).
|
|
4081
|
+
expect(data).toMatchObject(args)
|
|
4082
|
+
expect(typeof message.traceId).toBe('string')
|
|
3988
4083
|
expect(origin).toEqual(mockHostOrigin)
|
|
3989
4084
|
|
|
3990
4085
|
window.dispatchEvent(
|
|
@@ -4017,7 +4112,8 @@ describe('Mpc', () => {
|
|
|
4017
4112
|
const { type, data } = message
|
|
4018
4113
|
|
|
4019
4114
|
expect(type).toEqual('portal:blockaid:scanSolanaTx')
|
|
4020
|
-
expect(data).
|
|
4115
|
+
expect(data).toMatchObject(args)
|
|
4116
|
+
expect(typeof message.traceId).toBe('string')
|
|
4021
4117
|
expect(origin).toEqual(mockHostOrigin)
|
|
4022
4118
|
|
|
4023
4119
|
window.dispatchEvent(
|
|
@@ -4060,7 +4156,8 @@ describe('Mpc', () => {
|
|
|
4060
4156
|
const { type, data } = message
|
|
4061
4157
|
|
|
4062
4158
|
expect(type).toEqual('portal:blockaid:scanAddress')
|
|
4063
|
-
expect(data).
|
|
4159
|
+
expect(data).toMatchObject(args)
|
|
4160
|
+
expect(typeof message.traceId).toBe('string')
|
|
4064
4161
|
expect(origin).toEqual(mockHostOrigin)
|
|
4065
4162
|
|
|
4066
4163
|
window.dispatchEvent(
|
|
@@ -4093,7 +4190,8 @@ describe('Mpc', () => {
|
|
|
4093
4190
|
const { type, data } = message
|
|
4094
4191
|
|
|
4095
4192
|
expect(type).toEqual('portal:blockaid:scanAddress')
|
|
4096
|
-
expect(data).
|
|
4193
|
+
expect(data).toMatchObject(args)
|
|
4194
|
+
expect(typeof message.traceId).toBe('string')
|
|
4097
4195
|
expect(origin).toEqual(mockHostOrigin)
|
|
4098
4196
|
|
|
4099
4197
|
window.dispatchEvent(
|
|
@@ -4136,7 +4234,8 @@ describe('Mpc', () => {
|
|
|
4136
4234
|
const { type, data } = message
|
|
4137
4235
|
|
|
4138
4236
|
expect(type).toEqual('portal:blockaid:scanTokens')
|
|
4139
|
-
expect(data).
|
|
4237
|
+
expect(data).toMatchObject(args)
|
|
4238
|
+
expect(typeof message.traceId).toBe('string')
|
|
4140
4239
|
expect(origin).toEqual(mockHostOrigin)
|
|
4141
4240
|
|
|
4142
4241
|
window.dispatchEvent(
|
|
@@ -4169,7 +4268,8 @@ describe('Mpc', () => {
|
|
|
4169
4268
|
const { type, data } = message
|
|
4170
4269
|
|
|
4171
4270
|
expect(type).toEqual('portal:blockaid:scanTokens')
|
|
4172
|
-
expect(data).
|
|
4271
|
+
expect(data).toMatchObject(args)
|
|
4272
|
+
expect(typeof message.traceId).toBe('string')
|
|
4173
4273
|
expect(origin).toEqual(mockHostOrigin)
|
|
4174
4274
|
|
|
4175
4275
|
window.dispatchEvent(
|
|
@@ -4212,7 +4312,8 @@ describe('Mpc', () => {
|
|
|
4212
4312
|
const { type, data } = message
|
|
4213
4313
|
|
|
4214
4314
|
expect(type).toEqual('portal:blockaid:scanUrl')
|
|
4215
|
-
expect(data).
|
|
4315
|
+
expect(data).toMatchObject(args)
|
|
4316
|
+
expect(typeof message.traceId).toBe('string')
|
|
4216
4317
|
expect(origin).toEqual(mockHostOrigin)
|
|
4217
4318
|
|
|
4218
4319
|
window.dispatchEvent(
|
|
@@ -4245,7 +4346,8 @@ describe('Mpc', () => {
|
|
|
4245
4346
|
const { type, data } = message
|
|
4246
4347
|
|
|
4247
4348
|
expect(type).toEqual('portal:blockaid:scanUrl')
|
|
4248
|
-
expect(data).
|
|
4349
|
+
expect(data).toMatchObject(args)
|
|
4350
|
+
expect(typeof message.traceId).toBe('string')
|
|
4249
4351
|
expect(origin).toEqual(mockHostOrigin)
|
|
4250
4352
|
|
|
4251
4353
|
window.dispatchEvent(
|