@metamask-previews/bridge-controller 64.2.0-preview-749d0638 → 64.2.0-preview-e69ede40
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/CHANGELOG.md +3 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/selectors.d.cts +354 -1836
- package/dist/selectors.d.cts.map +1 -1
- package/dist/selectors.d.mts +354 -1836
- package/dist/selectors.d.mts.map +1 -1
- package/dist/types.cjs +0 -1
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.cts +1 -4
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +1 -4
- package/dist/types.d.mts.map +1 -1
- package/dist/types.mjs +0 -1
- package/dist/types.mjs.map +1 -1
- package/dist/utils/bridge.d.cts +2 -2
- package/dist/utils/bridge.d.mts +2 -2
- package/dist/utils/trade-utils.d.cts +1 -1
- package/dist/utils/trade-utils.d.mts +1 -1
- package/dist/utils/validators.cjs +1 -105
- package/dist/utils/validators.cjs.map +1 -1
- package/dist/utils/validators.d.cts +7 -516
- package/dist/utils/validators.d.cts.map +1 -1
- package/dist/utils/validators.d.mts +7 -516
- package/dist/utils/validators.d.mts.map +1 -1
- package/dist/utils/validators.mjs +0 -104
- package/dist/utils/validators.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -433,211 +433,6 @@ export declare const StepSchema: import("@metamask/superstruct").Struct<{
|
|
|
433
433
|
icon: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
434
434
|
}>;
|
|
435
435
|
}>;
|
|
436
|
-
/**
|
|
437
|
-
* Schema for an intent-based order used for EIP-712 signing and submission.
|
|
438
|
-
*
|
|
439
|
-
* This represents the minimal subset of fields required by intent-based
|
|
440
|
-
* protocols (e.g. CoW Swap) to build, sign, and submit an order.
|
|
441
|
-
*/
|
|
442
|
-
export declare const IntentOrderSchema: import("@metamask/superstruct").Struct<{
|
|
443
|
-
sellToken: string;
|
|
444
|
-
buyToken: string;
|
|
445
|
-
validTo: string | number;
|
|
446
|
-
appData: string;
|
|
447
|
-
appDataHash: string;
|
|
448
|
-
feeAmount: string;
|
|
449
|
-
kind: "sell" | "buy";
|
|
450
|
-
partiallyFillable: boolean;
|
|
451
|
-
receiver?: string | undefined;
|
|
452
|
-
sellAmount?: string | undefined;
|
|
453
|
-
buyAmount?: string | undefined;
|
|
454
|
-
from?: string | undefined;
|
|
455
|
-
}, {
|
|
456
|
-
/**
|
|
457
|
-
* Address of the token being sold.
|
|
458
|
-
*/
|
|
459
|
-
sellToken: import("@metamask/superstruct").Struct<string, null>;
|
|
460
|
-
/**
|
|
461
|
-
* Address of the token being bought.
|
|
462
|
-
*/
|
|
463
|
-
buyToken: import("@metamask/superstruct").Struct<string, null>;
|
|
464
|
-
/**
|
|
465
|
-
* Optional receiver of the bought tokens.
|
|
466
|
-
* If omitted, defaults to the signer / order owner.
|
|
467
|
-
*/
|
|
468
|
-
receiver: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
469
|
-
/**
|
|
470
|
-
* Order expiration time.
|
|
471
|
-
*
|
|
472
|
-
* Can be provided as a UNIX timestamp in seconds, either as a number
|
|
473
|
-
* or as a digit string, depending on provider requirements.
|
|
474
|
-
*/
|
|
475
|
-
validTo: import("@metamask/superstruct").Struct<string | number, null>;
|
|
476
|
-
/**
|
|
477
|
-
* Arbitrary application-specific data attached to the order.
|
|
478
|
-
*/
|
|
479
|
-
appData: import("@metamask/superstruct").Struct<string, null>;
|
|
480
|
-
/**
|
|
481
|
-
* Hash of the `appData` field, used for EIP-712 signing.
|
|
482
|
-
*/
|
|
483
|
-
appDataHash: import("@metamask/superstruct").Struct<string, null>;
|
|
484
|
-
/**
|
|
485
|
-
* Fee amount paid for order execution, expressed as a digit string.
|
|
486
|
-
*/
|
|
487
|
-
feeAmount: import("@metamask/superstruct").Struct<string, null>;
|
|
488
|
-
/**
|
|
489
|
-
* Order kind.
|
|
490
|
-
*
|
|
491
|
-
* - `sell`: exact sell amount, variable buy amount
|
|
492
|
-
* - `buy`: exact buy amount, variable sell amount
|
|
493
|
-
*/
|
|
494
|
-
kind: import("@metamask/superstruct").Struct<"sell" | "buy", {
|
|
495
|
-
sell: "sell";
|
|
496
|
-
buy: "buy";
|
|
497
|
-
}>;
|
|
498
|
-
/**
|
|
499
|
-
* Whether the order can be partially filled.
|
|
500
|
-
*/
|
|
501
|
-
partiallyFillable: import("@metamask/superstruct").Struct<boolean, null>;
|
|
502
|
-
/**
|
|
503
|
-
* Exact amount of the sell token.
|
|
504
|
-
*
|
|
505
|
-
* Required for `sell` orders.
|
|
506
|
-
*/
|
|
507
|
-
sellAmount: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
508
|
-
/**
|
|
509
|
-
* Exact amount of the buy token.
|
|
510
|
-
*
|
|
511
|
-
* Required for `buy` orders.
|
|
512
|
-
*/
|
|
513
|
-
buyAmount: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
514
|
-
/**
|
|
515
|
-
* Optional order owner / sender address.
|
|
516
|
-
*
|
|
517
|
-
* Provided for convenience when building the EIP-712 domain and message.
|
|
518
|
-
*/
|
|
519
|
-
from: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
520
|
-
}>;
|
|
521
|
-
/**
|
|
522
|
-
* Schema representing an intent submission payload.
|
|
523
|
-
*
|
|
524
|
-
* Wraps the intent order along with protocol and optional routing metadata
|
|
525
|
-
* required by the backend or relayer infrastructure.
|
|
526
|
-
*/
|
|
527
|
-
export declare const IntentSchema: import("@metamask/superstruct").Struct<{
|
|
528
|
-
protocol: string;
|
|
529
|
-
order: {
|
|
530
|
-
sellToken: string;
|
|
531
|
-
buyToken: string;
|
|
532
|
-
validTo: string | number;
|
|
533
|
-
appData: string;
|
|
534
|
-
appDataHash: string;
|
|
535
|
-
feeAmount: string;
|
|
536
|
-
kind: "sell" | "buy";
|
|
537
|
-
partiallyFillable: boolean;
|
|
538
|
-
receiver?: string | undefined;
|
|
539
|
-
sellAmount?: string | undefined;
|
|
540
|
-
buyAmount?: string | undefined;
|
|
541
|
-
from?: string | undefined;
|
|
542
|
-
};
|
|
543
|
-
settlementContract?: string | undefined;
|
|
544
|
-
relayer?: string | undefined;
|
|
545
|
-
}, {
|
|
546
|
-
/**
|
|
547
|
-
* Identifier of the intent protocol used to interpret the order.
|
|
548
|
-
*/
|
|
549
|
-
protocol: import("@metamask/superstruct").Struct<string, null>;
|
|
550
|
-
/**
|
|
551
|
-
* The intent order to be signed and submitted.
|
|
552
|
-
*/
|
|
553
|
-
order: import("@metamask/superstruct").Struct<{
|
|
554
|
-
sellToken: string;
|
|
555
|
-
buyToken: string;
|
|
556
|
-
validTo: string | number;
|
|
557
|
-
appData: string;
|
|
558
|
-
appDataHash: string;
|
|
559
|
-
feeAmount: string;
|
|
560
|
-
kind: "sell" | "buy";
|
|
561
|
-
partiallyFillable: boolean;
|
|
562
|
-
receiver?: string | undefined;
|
|
563
|
-
sellAmount?: string | undefined;
|
|
564
|
-
buyAmount?: string | undefined;
|
|
565
|
-
from?: string | undefined;
|
|
566
|
-
}, {
|
|
567
|
-
/**
|
|
568
|
-
* Address of the token being sold.
|
|
569
|
-
*/
|
|
570
|
-
sellToken: import("@metamask/superstruct").Struct<string, null>;
|
|
571
|
-
/**
|
|
572
|
-
* Address of the token being bought.
|
|
573
|
-
*/
|
|
574
|
-
buyToken: import("@metamask/superstruct").Struct<string, null>;
|
|
575
|
-
/**
|
|
576
|
-
* Optional receiver of the bought tokens.
|
|
577
|
-
* If omitted, defaults to the signer / order owner.
|
|
578
|
-
*/
|
|
579
|
-
receiver: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
580
|
-
/**
|
|
581
|
-
* Order expiration time.
|
|
582
|
-
*
|
|
583
|
-
* Can be provided as a UNIX timestamp in seconds, either as a number
|
|
584
|
-
* or as a digit string, depending on provider requirements.
|
|
585
|
-
*/
|
|
586
|
-
validTo: import("@metamask/superstruct").Struct<string | number, null>;
|
|
587
|
-
/**
|
|
588
|
-
* Arbitrary application-specific data attached to the order.
|
|
589
|
-
*/
|
|
590
|
-
appData: import("@metamask/superstruct").Struct<string, null>;
|
|
591
|
-
/**
|
|
592
|
-
* Hash of the `appData` field, used for EIP-712 signing.
|
|
593
|
-
*/
|
|
594
|
-
appDataHash: import("@metamask/superstruct").Struct<string, null>;
|
|
595
|
-
/**
|
|
596
|
-
* Fee amount paid for order execution, expressed as a digit string.
|
|
597
|
-
*/
|
|
598
|
-
feeAmount: import("@metamask/superstruct").Struct<string, null>;
|
|
599
|
-
/**
|
|
600
|
-
* Order kind.
|
|
601
|
-
*
|
|
602
|
-
* - `sell`: exact sell amount, variable buy amount
|
|
603
|
-
* - `buy`: exact buy amount, variable sell amount
|
|
604
|
-
*/
|
|
605
|
-
kind: import("@metamask/superstruct").Struct<"sell" | "buy", {
|
|
606
|
-
sell: "sell";
|
|
607
|
-
buy: "buy";
|
|
608
|
-
}>;
|
|
609
|
-
/**
|
|
610
|
-
* Whether the order can be partially filled.
|
|
611
|
-
*/
|
|
612
|
-
partiallyFillable: import("@metamask/superstruct").Struct<boolean, null>;
|
|
613
|
-
/**
|
|
614
|
-
* Exact amount of the sell token.
|
|
615
|
-
*
|
|
616
|
-
* Required for `sell` orders.
|
|
617
|
-
*/
|
|
618
|
-
sellAmount: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
619
|
-
/**
|
|
620
|
-
* Exact amount of the buy token.
|
|
621
|
-
*
|
|
622
|
-
* Required for `buy` orders.
|
|
623
|
-
*/
|
|
624
|
-
buyAmount: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
625
|
-
/**
|
|
626
|
-
* Optional order owner / sender address.
|
|
627
|
-
*
|
|
628
|
-
* Provided for convenience when building the EIP-712 domain and message.
|
|
629
|
-
*/
|
|
630
|
-
from: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
631
|
-
}>;
|
|
632
|
-
/**
|
|
633
|
-
* Optional settlement contract address used for execution.
|
|
634
|
-
*/
|
|
635
|
-
settlementContract: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
636
|
-
/**
|
|
637
|
-
* Optional relayer address responsible for order submission.
|
|
638
|
-
*/
|
|
639
|
-
relayer: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
640
|
-
}>;
|
|
641
436
|
export declare const QuoteSchema: import("@metamask/superstruct").Struct<{
|
|
642
437
|
srcChainId: number;
|
|
643
438
|
destChainId: number;
|
|
@@ -770,25 +565,6 @@ export declare const QuoteSchema: import("@metamask/superstruct").Struct<{
|
|
|
770
565
|
priceImpact?: string | undefined;
|
|
771
566
|
totalFeeAmountUsd?: string | undefined;
|
|
772
567
|
} | undefined;
|
|
773
|
-
intent?: {
|
|
774
|
-
protocol: string;
|
|
775
|
-
order: {
|
|
776
|
-
sellToken: string;
|
|
777
|
-
buyToken: string;
|
|
778
|
-
validTo: string | number;
|
|
779
|
-
appData: string;
|
|
780
|
-
appDataHash: string;
|
|
781
|
-
feeAmount: string;
|
|
782
|
-
kind: "sell" | "buy";
|
|
783
|
-
partiallyFillable: boolean;
|
|
784
|
-
receiver?: string | undefined;
|
|
785
|
-
sellAmount?: string | undefined;
|
|
786
|
-
buyAmount?: string | undefined;
|
|
787
|
-
from?: string | undefined;
|
|
788
|
-
};
|
|
789
|
-
settlementContract?: string | undefined;
|
|
790
|
-
relayer?: string | undefined;
|
|
791
|
-
} | undefined;
|
|
792
568
|
gasSponsored?: boolean | undefined;
|
|
793
569
|
}, {
|
|
794
570
|
requestId: import("@metamask/superstruct").Struct<string, null>;
|
|
@@ -1305,120 +1081,6 @@ export declare const QuoteSchema: import("@metamask/superstruct").Struct<{
|
|
|
1305
1081
|
priceImpact: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
1306
1082
|
totalFeeAmountUsd: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
1307
1083
|
}>;
|
|
1308
|
-
intent: import("@metamask/superstruct").Struct<{
|
|
1309
|
-
protocol: string;
|
|
1310
|
-
order: {
|
|
1311
|
-
sellToken: string;
|
|
1312
|
-
buyToken: string;
|
|
1313
|
-
validTo: string | number;
|
|
1314
|
-
appData: string;
|
|
1315
|
-
appDataHash: string;
|
|
1316
|
-
feeAmount: string;
|
|
1317
|
-
kind: "sell" | "buy";
|
|
1318
|
-
partiallyFillable: boolean;
|
|
1319
|
-
receiver?: string | undefined;
|
|
1320
|
-
sellAmount?: string | undefined;
|
|
1321
|
-
buyAmount?: string | undefined;
|
|
1322
|
-
from?: string | undefined;
|
|
1323
|
-
};
|
|
1324
|
-
settlementContract?: string | undefined;
|
|
1325
|
-
relayer?: string | undefined;
|
|
1326
|
-
} | undefined, {
|
|
1327
|
-
/**
|
|
1328
|
-
* Identifier of the intent protocol used to interpret the order.
|
|
1329
|
-
*/
|
|
1330
|
-
protocol: import("@metamask/superstruct").Struct<string, null>;
|
|
1331
|
-
/**
|
|
1332
|
-
* The intent order to be signed and submitted.
|
|
1333
|
-
*/
|
|
1334
|
-
order: import("@metamask/superstruct").Struct<{
|
|
1335
|
-
sellToken: string;
|
|
1336
|
-
buyToken: string;
|
|
1337
|
-
validTo: string | number;
|
|
1338
|
-
appData: string;
|
|
1339
|
-
appDataHash: string;
|
|
1340
|
-
feeAmount: string;
|
|
1341
|
-
kind: "sell" | "buy";
|
|
1342
|
-
partiallyFillable: boolean;
|
|
1343
|
-
receiver?: string | undefined;
|
|
1344
|
-
sellAmount?: string | undefined;
|
|
1345
|
-
buyAmount?: string | undefined;
|
|
1346
|
-
from?: string | undefined;
|
|
1347
|
-
}, {
|
|
1348
|
-
/**
|
|
1349
|
-
* Address of the token being sold.
|
|
1350
|
-
*/
|
|
1351
|
-
sellToken: import("@metamask/superstruct").Struct<string, null>;
|
|
1352
|
-
/**
|
|
1353
|
-
* Address of the token being bought.
|
|
1354
|
-
*/
|
|
1355
|
-
buyToken: import("@metamask/superstruct").Struct<string, null>;
|
|
1356
|
-
/**
|
|
1357
|
-
* Optional receiver of the bought tokens.
|
|
1358
|
-
* If omitted, defaults to the signer / order owner.
|
|
1359
|
-
*/
|
|
1360
|
-
receiver: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
1361
|
-
/**
|
|
1362
|
-
* Order expiration time.
|
|
1363
|
-
*
|
|
1364
|
-
* Can be provided as a UNIX timestamp in seconds, either as a number
|
|
1365
|
-
* or as a digit string, depending on provider requirements.
|
|
1366
|
-
*/
|
|
1367
|
-
validTo: import("@metamask/superstruct").Struct<string | number, null>;
|
|
1368
|
-
/**
|
|
1369
|
-
* Arbitrary application-specific data attached to the order.
|
|
1370
|
-
*/
|
|
1371
|
-
appData: import("@metamask/superstruct").Struct<string, null>;
|
|
1372
|
-
/**
|
|
1373
|
-
* Hash of the `appData` field, used for EIP-712 signing.
|
|
1374
|
-
*/
|
|
1375
|
-
appDataHash: import("@metamask/superstruct").Struct<string, null>;
|
|
1376
|
-
/**
|
|
1377
|
-
* Fee amount paid for order execution, expressed as a digit string.
|
|
1378
|
-
*/
|
|
1379
|
-
feeAmount: import("@metamask/superstruct").Struct<string, null>;
|
|
1380
|
-
/**
|
|
1381
|
-
* Order kind.
|
|
1382
|
-
*
|
|
1383
|
-
* - `sell`: exact sell amount, variable buy amount
|
|
1384
|
-
* - `buy`: exact buy amount, variable sell amount
|
|
1385
|
-
*/
|
|
1386
|
-
kind: import("@metamask/superstruct").Struct<"sell" | "buy", {
|
|
1387
|
-
sell: "sell";
|
|
1388
|
-
buy: "buy";
|
|
1389
|
-
}>;
|
|
1390
|
-
/**
|
|
1391
|
-
* Whether the order can be partially filled.
|
|
1392
|
-
*/
|
|
1393
|
-
partiallyFillable: import("@metamask/superstruct").Struct<boolean, null>;
|
|
1394
|
-
/**
|
|
1395
|
-
* Exact amount of the sell token.
|
|
1396
|
-
*
|
|
1397
|
-
* Required for `sell` orders.
|
|
1398
|
-
*/
|
|
1399
|
-
sellAmount: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
1400
|
-
/**
|
|
1401
|
-
* Exact amount of the buy token.
|
|
1402
|
-
*
|
|
1403
|
-
* Required for `buy` orders.
|
|
1404
|
-
*/
|
|
1405
|
-
buyAmount: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
1406
|
-
/**
|
|
1407
|
-
* Optional order owner / sender address.
|
|
1408
|
-
*
|
|
1409
|
-
* Provided for convenience when building the EIP-712 domain and message.
|
|
1410
|
-
*/
|
|
1411
|
-
from: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
1412
|
-
}>;
|
|
1413
|
-
/**
|
|
1414
|
-
* Optional settlement contract address used for execution.
|
|
1415
|
-
*/
|
|
1416
|
-
settlementContract: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
1417
|
-
/**
|
|
1418
|
-
* Optional relayer address responsible for order submission.
|
|
1419
|
-
*/
|
|
1420
|
-
relayer: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
1421
|
-
}>;
|
|
1422
1084
|
/**
|
|
1423
1085
|
* A third party sponsors the gas. If true, then gasIncluded7702 is also true.
|
|
1424
1086
|
*/
|
|
@@ -1426,8 +1088,8 @@ export declare const QuoteSchema: import("@metamask/superstruct").Struct<{
|
|
|
1426
1088
|
}>;
|
|
1427
1089
|
export declare const TxDataSchema: import("@metamask/superstruct").Struct<{
|
|
1428
1090
|
chainId: number;
|
|
1429
|
-
from: string;
|
|
1430
1091
|
to: string;
|
|
1092
|
+
from: string;
|
|
1431
1093
|
value: string;
|
|
1432
1094
|
data: string;
|
|
1433
1095
|
gasLimit: number | null;
|
|
@@ -1609,32 +1271,13 @@ export declare const QuoteResponseSchema: import("@metamask/superstruct").Struct
|
|
|
1609
1271
|
priceImpact?: string | undefined;
|
|
1610
1272
|
totalFeeAmountUsd?: string | undefined;
|
|
1611
1273
|
} | undefined;
|
|
1612
|
-
intent?: {
|
|
1613
|
-
protocol: string;
|
|
1614
|
-
order: {
|
|
1615
|
-
sellToken: string;
|
|
1616
|
-
buyToken: string;
|
|
1617
|
-
validTo: string | number;
|
|
1618
|
-
appData: string;
|
|
1619
|
-
appDataHash: string;
|
|
1620
|
-
feeAmount: string;
|
|
1621
|
-
kind: "sell" | "buy";
|
|
1622
|
-
partiallyFillable: boolean;
|
|
1623
|
-
receiver?: string | undefined;
|
|
1624
|
-
sellAmount?: string | undefined;
|
|
1625
|
-
buyAmount?: string | undefined;
|
|
1626
|
-
from?: string | undefined;
|
|
1627
|
-
};
|
|
1628
|
-
settlementContract?: string | undefined;
|
|
1629
|
-
relayer?: string | undefined;
|
|
1630
|
-
} | undefined;
|
|
1631
1274
|
gasSponsored?: boolean | undefined;
|
|
1632
1275
|
};
|
|
1633
1276
|
estimatedProcessingTimeInSeconds: number;
|
|
1634
1277
|
trade: string | {
|
|
1635
1278
|
chainId: number;
|
|
1636
|
-
from: string;
|
|
1637
1279
|
to: string;
|
|
1280
|
+
from: string;
|
|
1638
1281
|
value: string;
|
|
1639
1282
|
data: string;
|
|
1640
1283
|
gasLimit: number | null;
|
|
@@ -1654,8 +1297,8 @@ export declare const QuoteResponseSchema: import("@metamask/superstruct").Struct
|
|
|
1654
1297
|
};
|
|
1655
1298
|
approval?: {
|
|
1656
1299
|
chainId: number;
|
|
1657
|
-
from: string;
|
|
1658
1300
|
to: string;
|
|
1301
|
+
from: string;
|
|
1659
1302
|
value: string;
|
|
1660
1303
|
data: string;
|
|
1661
1304
|
gasLimit: number | null;
|
|
@@ -1803,25 +1446,6 @@ export declare const QuoteResponseSchema: import("@metamask/superstruct").Struct
|
|
|
1803
1446
|
priceImpact?: string | undefined;
|
|
1804
1447
|
totalFeeAmountUsd?: string | undefined;
|
|
1805
1448
|
} | undefined;
|
|
1806
|
-
intent?: {
|
|
1807
|
-
protocol: string;
|
|
1808
|
-
order: {
|
|
1809
|
-
sellToken: string;
|
|
1810
|
-
buyToken: string;
|
|
1811
|
-
validTo: string | number;
|
|
1812
|
-
appData: string;
|
|
1813
|
-
appDataHash: string;
|
|
1814
|
-
feeAmount: string;
|
|
1815
|
-
kind: "sell" | "buy";
|
|
1816
|
-
partiallyFillable: boolean;
|
|
1817
|
-
receiver?: string | undefined;
|
|
1818
|
-
sellAmount?: string | undefined;
|
|
1819
|
-
buyAmount?: string | undefined;
|
|
1820
|
-
from?: string | undefined;
|
|
1821
|
-
};
|
|
1822
|
-
settlementContract?: string | undefined;
|
|
1823
|
-
relayer?: string | undefined;
|
|
1824
|
-
} | undefined;
|
|
1825
1449
|
gasSponsored?: boolean | undefined;
|
|
1826
1450
|
}, {
|
|
1827
1451
|
requestId: import("@metamask/superstruct").Struct<string, null>;
|
|
@@ -2338,120 +1962,6 @@ export declare const QuoteResponseSchema: import("@metamask/superstruct").Struct
|
|
|
2338
1962
|
priceImpact: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
2339
1963
|
totalFeeAmountUsd: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
2340
1964
|
}>;
|
|
2341
|
-
intent: import("@metamask/superstruct").Struct<{
|
|
2342
|
-
protocol: string;
|
|
2343
|
-
order: {
|
|
2344
|
-
sellToken: string;
|
|
2345
|
-
buyToken: string;
|
|
2346
|
-
validTo: string | number;
|
|
2347
|
-
appData: string;
|
|
2348
|
-
appDataHash: string;
|
|
2349
|
-
feeAmount: string;
|
|
2350
|
-
kind: "sell" | "buy";
|
|
2351
|
-
partiallyFillable: boolean;
|
|
2352
|
-
receiver?: string | undefined;
|
|
2353
|
-
sellAmount?: string | undefined;
|
|
2354
|
-
buyAmount?: string | undefined;
|
|
2355
|
-
from?: string | undefined;
|
|
2356
|
-
};
|
|
2357
|
-
settlementContract?: string | undefined;
|
|
2358
|
-
relayer?: string | undefined;
|
|
2359
|
-
} | undefined, {
|
|
2360
|
-
/**
|
|
2361
|
-
* Identifier of the intent protocol used to interpret the order.
|
|
2362
|
-
*/
|
|
2363
|
-
protocol: import("@metamask/superstruct").Struct<string, null>;
|
|
2364
|
-
/**
|
|
2365
|
-
* The intent order to be signed and submitted.
|
|
2366
|
-
*/
|
|
2367
|
-
order: import("@metamask/superstruct").Struct<{
|
|
2368
|
-
sellToken: string;
|
|
2369
|
-
buyToken: string;
|
|
2370
|
-
validTo: string | number;
|
|
2371
|
-
appData: string;
|
|
2372
|
-
appDataHash: string;
|
|
2373
|
-
feeAmount: string;
|
|
2374
|
-
kind: "sell" | "buy";
|
|
2375
|
-
partiallyFillable: boolean;
|
|
2376
|
-
receiver?: string | undefined;
|
|
2377
|
-
sellAmount?: string | undefined;
|
|
2378
|
-
buyAmount?: string | undefined;
|
|
2379
|
-
from?: string | undefined;
|
|
2380
|
-
}, {
|
|
2381
|
-
/**
|
|
2382
|
-
* Address of the token being sold.
|
|
2383
|
-
*/
|
|
2384
|
-
sellToken: import("@metamask/superstruct").Struct<string, null>;
|
|
2385
|
-
/**
|
|
2386
|
-
* Address of the token being bought.
|
|
2387
|
-
*/
|
|
2388
|
-
buyToken: import("@metamask/superstruct").Struct<string, null>;
|
|
2389
|
-
/**
|
|
2390
|
-
* Optional receiver of the bought tokens.
|
|
2391
|
-
* If omitted, defaults to the signer / order owner.
|
|
2392
|
-
*/
|
|
2393
|
-
receiver: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
2394
|
-
/**
|
|
2395
|
-
* Order expiration time.
|
|
2396
|
-
*
|
|
2397
|
-
* Can be provided as a UNIX timestamp in seconds, either as a number
|
|
2398
|
-
* or as a digit string, depending on provider requirements.
|
|
2399
|
-
*/
|
|
2400
|
-
validTo: import("@metamask/superstruct").Struct<string | number, null>;
|
|
2401
|
-
/**
|
|
2402
|
-
* Arbitrary application-specific data attached to the order.
|
|
2403
|
-
*/
|
|
2404
|
-
appData: import("@metamask/superstruct").Struct<string, null>;
|
|
2405
|
-
/**
|
|
2406
|
-
* Hash of the `appData` field, used for EIP-712 signing.
|
|
2407
|
-
*/
|
|
2408
|
-
appDataHash: import("@metamask/superstruct").Struct<string, null>;
|
|
2409
|
-
/**
|
|
2410
|
-
* Fee amount paid for order execution, expressed as a digit string.
|
|
2411
|
-
*/
|
|
2412
|
-
feeAmount: import("@metamask/superstruct").Struct<string, null>;
|
|
2413
|
-
/**
|
|
2414
|
-
* Order kind.
|
|
2415
|
-
*
|
|
2416
|
-
* - `sell`: exact sell amount, variable buy amount
|
|
2417
|
-
* - `buy`: exact buy amount, variable sell amount
|
|
2418
|
-
*/
|
|
2419
|
-
kind: import("@metamask/superstruct").Struct<"sell" | "buy", {
|
|
2420
|
-
sell: "sell";
|
|
2421
|
-
buy: "buy";
|
|
2422
|
-
}>;
|
|
2423
|
-
/**
|
|
2424
|
-
* Whether the order can be partially filled.
|
|
2425
|
-
*/
|
|
2426
|
-
partiallyFillable: import("@metamask/superstruct").Struct<boolean, null>;
|
|
2427
|
-
/**
|
|
2428
|
-
* Exact amount of the sell token.
|
|
2429
|
-
*
|
|
2430
|
-
* Required for `sell` orders.
|
|
2431
|
-
*/
|
|
2432
|
-
sellAmount: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
2433
|
-
/**
|
|
2434
|
-
* Exact amount of the buy token.
|
|
2435
|
-
*
|
|
2436
|
-
* Required for `buy` orders.
|
|
2437
|
-
*/
|
|
2438
|
-
buyAmount: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
2439
|
-
/**
|
|
2440
|
-
* Optional order owner / sender address.
|
|
2441
|
-
*
|
|
2442
|
-
* Provided for convenience when building the EIP-712 domain and message.
|
|
2443
|
-
*/
|
|
2444
|
-
from: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
2445
|
-
}>;
|
|
2446
|
-
/**
|
|
2447
|
-
* Optional settlement contract address used for execution.
|
|
2448
|
-
*/
|
|
2449
|
-
settlementContract: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
2450
|
-
/**
|
|
2451
|
-
* Optional relayer address responsible for order submission.
|
|
2452
|
-
*/
|
|
2453
|
-
relayer: import("@metamask/superstruct").Struct<string | undefined, null>;
|
|
2454
|
-
}>;
|
|
2455
1965
|
/**
|
|
2456
1966
|
* A third party sponsors the gas. If true, then gasIncluded7702 is also true.
|
|
2457
1967
|
*/
|
|
@@ -2460,8 +1970,8 @@ export declare const QuoteResponseSchema: import("@metamask/superstruct").Struct
|
|
|
2460
1970
|
estimatedProcessingTimeInSeconds: import("@metamask/superstruct").Struct<number, null>;
|
|
2461
1971
|
approval: import("@metamask/superstruct").Struct<{
|
|
2462
1972
|
chainId: number;
|
|
2463
|
-
from: string;
|
|
2464
1973
|
to: string;
|
|
1974
|
+
from: string;
|
|
2465
1975
|
value: string;
|
|
2466
1976
|
data: string;
|
|
2467
1977
|
gasLimit: number | null;
|
|
@@ -2478,8 +1988,8 @@ export declare const QuoteResponseSchema: import("@metamask/superstruct").Struct
|
|
|
2478
1988
|
} | undefined, null>;
|
|
2479
1989
|
trade: import("@metamask/superstruct").Struct<string | {
|
|
2480
1990
|
chainId: number;
|
|
2481
|
-
from: string;
|
|
2482
1991
|
to: string;
|
|
1992
|
+
from: string;
|
|
2483
1993
|
value: string;
|
|
2484
1994
|
data: string;
|
|
2485
1995
|
gasLimit: number | null;
|
|
@@ -2631,32 +2141,13 @@ export declare const validateQuoteResponse: (data: unknown) => data is {
|
|
|
2631
2141
|
priceImpact?: string | undefined;
|
|
2632
2142
|
totalFeeAmountUsd?: string | undefined;
|
|
2633
2143
|
} | undefined;
|
|
2634
|
-
intent?: {
|
|
2635
|
-
protocol: string;
|
|
2636
|
-
order: {
|
|
2637
|
-
sellToken: string;
|
|
2638
|
-
buyToken: string;
|
|
2639
|
-
validTo: string | number;
|
|
2640
|
-
appData: string;
|
|
2641
|
-
appDataHash: string;
|
|
2642
|
-
feeAmount: string;
|
|
2643
|
-
kind: "sell" | "buy";
|
|
2644
|
-
partiallyFillable: boolean;
|
|
2645
|
-
receiver?: string | undefined;
|
|
2646
|
-
sellAmount?: string | undefined;
|
|
2647
|
-
buyAmount?: string | undefined;
|
|
2648
|
-
from?: string | undefined;
|
|
2649
|
-
};
|
|
2650
|
-
settlementContract?: string | undefined;
|
|
2651
|
-
relayer?: string | undefined;
|
|
2652
|
-
} | undefined;
|
|
2653
2144
|
gasSponsored?: boolean | undefined;
|
|
2654
2145
|
};
|
|
2655
2146
|
estimatedProcessingTimeInSeconds: number;
|
|
2656
2147
|
trade: string | {
|
|
2657
2148
|
chainId: number;
|
|
2658
|
-
from: string;
|
|
2659
2149
|
to: string;
|
|
2150
|
+
from: string;
|
|
2660
2151
|
value: string;
|
|
2661
2152
|
data: string;
|
|
2662
2153
|
gasLimit: number | null;
|
|
@@ -2676,8 +2167,8 @@ export declare const validateQuoteResponse: (data: unknown) => data is {
|
|
|
2676
2167
|
};
|
|
2677
2168
|
approval?: {
|
|
2678
2169
|
chainId: number;
|
|
2679
|
-
from: string;
|
|
2680
2170
|
to: string;
|
|
2171
|
+
from: string;
|
|
2681
2172
|
value: string;
|
|
2682
2173
|
data: string;
|
|
2683
2174
|
gasLimit: number | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.cts","sourceRoot":"","sources":["../../src/utils/validators.ts"],"names":[],"mappings":"AAqBA,oBAAY,OAAO;IACjB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,MAAM,UAAU;CACjB;AAED,oBAAY,SAAS;IACnB,KAAK,UAAU;CAChB;AAED,oBAAY,WAAW;IACrB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,MAAM,WAAW;CAClB;AAkBD,eAAO,MAAM,YAAY,MAAO,MAAM,YAAuB,CAAC;AAK9D,eAAO,MAAM,iBAAiB;;;;;;;;;;IAC5B;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;;IAGH;;OAEG;;IAEH;;OAEG;;EAEH,CAAC;AAeH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAZnC;;;WAGG;;QAEH;;;WAGG;;;EAeH,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;EAGrC,CAAC;AAUH;;GAEG;AACH,eAAO,MAAM,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