@mimicprotocol/sdk 0.0.1-rc.16 → 0.0.1-rc.18
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/dist/axia/validators.d.ts +546 -0
- package/dist/axia/validators.d.ts.map +1 -1
- package/dist/client/domains/IntentsClient.d.ts +14 -7
- package/dist/client/domains/IntentsClient.d.ts.map +1 -1
- package/dist/client/domains/IntentsClient.js +15 -6
- package/dist/client/domains/IntentsClient.js.map +1 -1
- package/dist/oracle/validators.d.ts +146 -8
- package/dist/oracle/validators.d.ts.map +1 -1
- package/dist/oracle/validators.js +1 -0
- package/dist/oracle/validators.js.map +1 -1
- package/dist/relayer/validators.d.ts +766 -2
- package/dist/relayer/validators.d.ts.map +1 -1
- package/dist/relayer/validators.js +2 -1
- package/dist/relayer/validators.js.map +1 -1
- package/dist/runner/validators.d.ts +226 -0
- package/dist/runner/validators.d.ts.map +1 -1
- package/dist/shared/codec/chains/evm.d.ts +3 -1
- package/dist/shared/codec/chains/evm.d.ts.map +1 -1
- package/dist/shared/codec/chains/evm.js +19 -0
- package/dist/shared/codec/chains/evm.js.map +1 -1
- package/dist/shared/codec/chains/svm.d.ts +15 -10
- package/dist/shared/codec/chains/svm.d.ts.map +1 -1
- package/dist/shared/codec/chains/svm.js +91 -35
- package/dist/shared/codec/chains/svm.js.map +1 -1
- package/dist/shared/codec/decoder.d.ts +3 -2
- package/dist/shared/codec/decoder.d.ts.map +1 -1
- package/dist/shared/codec/decoder.js +11 -16
- package/dist/shared/codec/decoder.js.map +1 -1
- package/dist/shared/codec/encoder.d.ts +31 -3
- package/dist/shared/codec/encoder.d.ts.map +1 -1
- package/dist/shared/codec/encoder.js +12 -5
- package/dist/shared/codec/encoder.js.map +1 -1
- package/dist/shared/codec/index.d.ts +1 -1
- package/dist/shared/codec/index.d.ts.map +1 -1
- package/dist/shared/codec/index.js +13 -8
- package/dist/shared/codec/index.js.map +1 -1
- package/dist/shared/types/intents.d.ts +8 -4
- package/dist/shared/types/intents.d.ts.map +1 -1
- package/dist/shared/validators/intents.d.ts +225 -7
- package/dist/shared/validators/intents.d.ts.map +1 -1
- package/dist/shared/validators/intents.js +24 -8
- package/dist/shared/validators/intents.js.map +1 -1
- package/dist/shared/validators/primitives.d.ts +2 -2
- package/dist/shared/validators/primitives.js +1 -1
- package/dist/shared/validators/primitives.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/relayer/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAcvB,eAAO,MAAM,uBAAuB;;;;;;;;;EAGlC,CAAA;AAEF,eAAO,MAAM,kCAAkC
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/relayer/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAcvB,eAAO,MAAM,uBAAuB;;;;;;;;;EAGlC,CAAA;AAEF,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIzC,CAAA;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAO1C,CAAA"}
|
|
@@ -17,7 +17,8 @@ exports.RunnerExecutionResultDataValidator = zod_1.z.object({
|
|
|
17
17
|
outputs: zod_1.z.array(zod_1.z.union([
|
|
18
18
|
shared_1.SwapIntentValidator.omit({ data: true, configSig: true, minValidations: true }),
|
|
19
19
|
shared_1.TransferIntentValidator.omit({ data: true, configSig: true, minValidations: true }),
|
|
20
|
-
shared_1.
|
|
20
|
+
shared_1.EvmCallIntentValidator.omit({ data: true, configSig: true, minValidations: true }),
|
|
21
|
+
validators_1.SvmCallIntentValidator.omit({ data: true, configSig: true, minValidations: true }),
|
|
21
22
|
])),
|
|
22
23
|
});
|
|
23
24
|
exports.RunnerExecutionResultValidator = zod_1.z.object({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../src/relayer/validators.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEvB,kCAAkD;AAClD,sCAAmD;AACnD,sCAOkB;AAClB,
|
|
1
|
+
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../src/relayer/validators.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEvB,kCAAkD;AAClD,sCAAmD;AACnD,sCAOkB;AAClB,qDAAwG;AAE3F,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,IAAI,EAAE,qBAAY;IAClB,IAAI,EAAE,OAAC,CAAC,KAAK,CAAC,4BAAe,CAAC,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAA;AAEW,QAAA,kCAAkC,GAAG,OAAC,CAAC,MAAM,CAAC;IACzD,SAAS,EAAE,2BAAkB;IAC7B,QAAQ,EAAE,qCAAwB;IAClC,MAAM,EAAE,OAAC,CAAC,KAAK,CAAC,gCAAuB,CAAC;IACxC,OAAO,EAAE,OAAC,CAAC,KAAK,CACd,OAAC,CAAC,KAAK,CAAC;QACN,4BAAmB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;QAC/E,gCAAuB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;QACnF,+BAAsB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;QAClF,mCAAsB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;KACnF,CAAC,CACH;CACF,CAAC,CAAA;AAEW,QAAA,8BAA8B,GAAG,OAAC,CAAC,MAAM,CAAC;IACrD,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACpC,IAAI,EAAE,OAAC,CAAC,KAAK,CAAC,4BAAe,CAAC;IAC9B,MAAM,EAAE,0CAAkC;CAC3C,CAAC,CAAA;AAEW,QAAA,+BAA+B,GAAG,OAAC,CAAC,MAAM,CAAC;IACtD,IAAI,EAAE,qBAAY;IAClB,SAAS,EAAE,2BAAkB;IAC7B,QAAQ,EAAE,qCAAwB;IAClC,MAAM,EAAE,OAAC,CAAC,KAAK,CAAC,2BAAkB,CAAC;IACnC,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,+BAAwB,CAAC;IAC1C,SAAS,EAAE,2BAAkB;CAC9B,CAAC,CAAA"}
|
|
@@ -465,6 +465,144 @@ export declare const RunExecutionRequestValidator: z.ZodEffects<z.ZodObject<{
|
|
|
465
465
|
hash: string;
|
|
466
466
|
};
|
|
467
467
|
signature: string;
|
|
468
|
+
}>, z.ZodObject<{
|
|
469
|
+
signature: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
470
|
+
query: z.ZodObject<{
|
|
471
|
+
name: z.ZodLiteral<"SvmGetAccountsInfoQuery">;
|
|
472
|
+
hash: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
473
|
+
params: z.ZodObject<{
|
|
474
|
+
publicKeys: z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">;
|
|
475
|
+
timestamp: z.ZodEffects<z.ZodNumber, number, number>;
|
|
476
|
+
}, "strip", z.ZodTypeAny, {
|
|
477
|
+
timestamp: number;
|
|
478
|
+
publicKeys: string[];
|
|
479
|
+
}, {
|
|
480
|
+
timestamp: number;
|
|
481
|
+
publicKeys: string[];
|
|
482
|
+
}>;
|
|
483
|
+
}, "strip", z.ZodTypeAny, {
|
|
484
|
+
params: {
|
|
485
|
+
timestamp: number;
|
|
486
|
+
publicKeys: string[];
|
|
487
|
+
};
|
|
488
|
+
name: "SvmGetAccountsInfoQuery";
|
|
489
|
+
hash: string;
|
|
490
|
+
}, {
|
|
491
|
+
params: {
|
|
492
|
+
timestamp: number;
|
|
493
|
+
publicKeys: string[];
|
|
494
|
+
};
|
|
495
|
+
name: "SvmGetAccountsInfoQuery";
|
|
496
|
+
hash: string;
|
|
497
|
+
}>;
|
|
498
|
+
result: z.ZodObject<{
|
|
499
|
+
value: z.ZodObject<{
|
|
500
|
+
accountsInfo: z.ZodArray<z.ZodObject<{
|
|
501
|
+
executable: z.ZodBoolean;
|
|
502
|
+
owner: z.ZodEffects<z.ZodString, string, string>;
|
|
503
|
+
lamports: z.ZodEffects<z.ZodString, string, string>;
|
|
504
|
+
data: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
505
|
+
rentEpoch: z.ZodEffects<z.ZodString, string, string>;
|
|
506
|
+
}, "strip", z.ZodTypeAny, {
|
|
507
|
+
data: string;
|
|
508
|
+
executable: boolean;
|
|
509
|
+
owner: string;
|
|
510
|
+
lamports: string;
|
|
511
|
+
rentEpoch: string;
|
|
512
|
+
}, {
|
|
513
|
+
data: string;
|
|
514
|
+
executable: boolean;
|
|
515
|
+
owner: string;
|
|
516
|
+
lamports: string;
|
|
517
|
+
rentEpoch: string;
|
|
518
|
+
}>, "many">;
|
|
519
|
+
slot: z.ZodEffects<z.ZodString, string, string>;
|
|
520
|
+
}, "strip", z.ZodTypeAny, {
|
|
521
|
+
accountsInfo: {
|
|
522
|
+
data: string;
|
|
523
|
+
executable: boolean;
|
|
524
|
+
owner: string;
|
|
525
|
+
lamports: string;
|
|
526
|
+
rentEpoch: string;
|
|
527
|
+
}[];
|
|
528
|
+
slot: string;
|
|
529
|
+
}, {
|
|
530
|
+
accountsInfo: {
|
|
531
|
+
data: string;
|
|
532
|
+
executable: boolean;
|
|
533
|
+
owner: string;
|
|
534
|
+
lamports: string;
|
|
535
|
+
rentEpoch: string;
|
|
536
|
+
}[];
|
|
537
|
+
slot: string;
|
|
538
|
+
}>;
|
|
539
|
+
}, "strip", z.ZodTypeAny, {
|
|
540
|
+
value: {
|
|
541
|
+
accountsInfo: {
|
|
542
|
+
data: string;
|
|
543
|
+
executable: boolean;
|
|
544
|
+
owner: string;
|
|
545
|
+
lamports: string;
|
|
546
|
+
rentEpoch: string;
|
|
547
|
+
}[];
|
|
548
|
+
slot: string;
|
|
549
|
+
};
|
|
550
|
+
}, {
|
|
551
|
+
value: {
|
|
552
|
+
accountsInfo: {
|
|
553
|
+
data: string;
|
|
554
|
+
executable: boolean;
|
|
555
|
+
owner: string;
|
|
556
|
+
lamports: string;
|
|
557
|
+
rentEpoch: string;
|
|
558
|
+
}[];
|
|
559
|
+
slot: string;
|
|
560
|
+
};
|
|
561
|
+
}>;
|
|
562
|
+
}, "strip", z.ZodTypeAny, {
|
|
563
|
+
result: {
|
|
564
|
+
value: {
|
|
565
|
+
accountsInfo: {
|
|
566
|
+
data: string;
|
|
567
|
+
executable: boolean;
|
|
568
|
+
owner: string;
|
|
569
|
+
lamports: string;
|
|
570
|
+
rentEpoch: string;
|
|
571
|
+
}[];
|
|
572
|
+
slot: string;
|
|
573
|
+
};
|
|
574
|
+
};
|
|
575
|
+
query: {
|
|
576
|
+
params: {
|
|
577
|
+
timestamp: number;
|
|
578
|
+
publicKeys: string[];
|
|
579
|
+
};
|
|
580
|
+
name: "SvmGetAccountsInfoQuery";
|
|
581
|
+
hash: string;
|
|
582
|
+
};
|
|
583
|
+
signature: string;
|
|
584
|
+
}, {
|
|
585
|
+
result: {
|
|
586
|
+
value: {
|
|
587
|
+
accountsInfo: {
|
|
588
|
+
data: string;
|
|
589
|
+
executable: boolean;
|
|
590
|
+
owner: string;
|
|
591
|
+
lamports: string;
|
|
592
|
+
rentEpoch: string;
|
|
593
|
+
}[];
|
|
594
|
+
slot: string;
|
|
595
|
+
};
|
|
596
|
+
};
|
|
597
|
+
query: {
|
|
598
|
+
params: {
|
|
599
|
+
timestamp: number;
|
|
600
|
+
publicKeys: string[];
|
|
601
|
+
};
|
|
602
|
+
name: "SvmGetAccountsInfoQuery";
|
|
603
|
+
hash: string;
|
|
604
|
+
};
|
|
605
|
+
signature: string;
|
|
468
606
|
}>]>, "many">>;
|
|
469
607
|
hash: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
470
608
|
trigger: z.ZodObject<{
|
|
@@ -505,6 +643,28 @@ export declare const RunExecutionRequestValidator: z.ZodEffects<z.ZodObject<{
|
|
|
505
643
|
hash: string;
|
|
506
644
|
};
|
|
507
645
|
signature: string;
|
|
646
|
+
} | {
|
|
647
|
+
result: {
|
|
648
|
+
value: {
|
|
649
|
+
accountsInfo: {
|
|
650
|
+
data: string;
|
|
651
|
+
executable: boolean;
|
|
652
|
+
owner: string;
|
|
653
|
+
lamports: string;
|
|
654
|
+
rentEpoch: string;
|
|
655
|
+
}[];
|
|
656
|
+
slot: string;
|
|
657
|
+
};
|
|
658
|
+
};
|
|
659
|
+
query: {
|
|
660
|
+
params: {
|
|
661
|
+
timestamp: number;
|
|
662
|
+
publicKeys: string[];
|
|
663
|
+
};
|
|
664
|
+
name: "SvmGetAccountsInfoQuery";
|
|
665
|
+
hash: string;
|
|
666
|
+
};
|
|
667
|
+
signature: string;
|
|
508
668
|
} | {
|
|
509
669
|
result: {
|
|
510
670
|
value: string;
|
|
@@ -596,6 +756,28 @@ export declare const RunExecutionRequestValidator: z.ZodEffects<z.ZodObject<{
|
|
|
596
756
|
hash: string;
|
|
597
757
|
};
|
|
598
758
|
signature: string;
|
|
759
|
+
} | {
|
|
760
|
+
result: {
|
|
761
|
+
value: {
|
|
762
|
+
accountsInfo: {
|
|
763
|
+
data: string;
|
|
764
|
+
executable: boolean;
|
|
765
|
+
owner: string;
|
|
766
|
+
lamports: string;
|
|
767
|
+
rentEpoch: string;
|
|
768
|
+
}[];
|
|
769
|
+
slot: string;
|
|
770
|
+
};
|
|
771
|
+
};
|
|
772
|
+
query: {
|
|
773
|
+
params: {
|
|
774
|
+
timestamp: number;
|
|
775
|
+
publicKeys: string[];
|
|
776
|
+
};
|
|
777
|
+
name: "SvmGetAccountsInfoQuery";
|
|
778
|
+
hash: string;
|
|
779
|
+
};
|
|
780
|
+
signature: string;
|
|
599
781
|
} | {
|
|
600
782
|
result: {
|
|
601
783
|
value: string;
|
|
@@ -687,6 +869,28 @@ export declare const RunExecutionRequestValidator: z.ZodEffects<z.ZodObject<{
|
|
|
687
869
|
hash: string;
|
|
688
870
|
};
|
|
689
871
|
signature: string;
|
|
872
|
+
} | {
|
|
873
|
+
result: {
|
|
874
|
+
value: {
|
|
875
|
+
accountsInfo: {
|
|
876
|
+
data: string;
|
|
877
|
+
executable: boolean;
|
|
878
|
+
owner: string;
|
|
879
|
+
lamports: string;
|
|
880
|
+
rentEpoch: string;
|
|
881
|
+
}[];
|
|
882
|
+
slot: string;
|
|
883
|
+
};
|
|
884
|
+
};
|
|
885
|
+
query: {
|
|
886
|
+
params: {
|
|
887
|
+
timestamp: number;
|
|
888
|
+
publicKeys: string[];
|
|
889
|
+
};
|
|
890
|
+
name: "SvmGetAccountsInfoQuery";
|
|
891
|
+
hash: string;
|
|
892
|
+
};
|
|
893
|
+
signature: string;
|
|
690
894
|
} | {
|
|
691
895
|
result: {
|
|
692
896
|
value: string;
|
|
@@ -778,6 +982,28 @@ export declare const RunExecutionRequestValidator: z.ZodEffects<z.ZodObject<{
|
|
|
778
982
|
hash: string;
|
|
779
983
|
};
|
|
780
984
|
signature: string;
|
|
985
|
+
} | {
|
|
986
|
+
result: {
|
|
987
|
+
value: {
|
|
988
|
+
accountsInfo: {
|
|
989
|
+
data: string;
|
|
990
|
+
executable: boolean;
|
|
991
|
+
owner: string;
|
|
992
|
+
lamports: string;
|
|
993
|
+
rentEpoch: string;
|
|
994
|
+
}[];
|
|
995
|
+
slot: string;
|
|
996
|
+
};
|
|
997
|
+
};
|
|
998
|
+
query: {
|
|
999
|
+
params: {
|
|
1000
|
+
timestamp: number;
|
|
1001
|
+
publicKeys: string[];
|
|
1002
|
+
};
|
|
1003
|
+
name: "SvmGetAccountsInfoQuery";
|
|
1004
|
+
hash: string;
|
|
1005
|
+
};
|
|
1006
|
+
signature: string;
|
|
781
1007
|
} | {
|
|
782
1008
|
result: {
|
|
783
1009
|
value: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/runner/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,EAML,WAAW,EAEZ,MAAM,WAAW,CAAA;AAElB,eAAO,MAAM,4BAA4B
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/runner/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAGvB,OAAO,EAML,WAAW,EAEZ,MAAM,WAAW,CAAA;AAElB,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkBrC,CAAA;AAEJ,eAAO,MAAM,2BAA2B;;;;;;;;;EAGtC,CAAA"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { Intent, SwapIntent, SwapIntentData, TransferIntent, TransferIntentData } from '../../types';
|
|
1
|
+
import { EvmCallIntent, EvmCallIntentData, Intent, SwapIntent, SwapIntentData, TransferIntent, TransferIntentData } from '../../types';
|
|
2
2
|
export declare function evmEncodeIntent(intent: Intent): string;
|
|
3
3
|
export declare function evmEncodeTransferIntent(intent: TransferIntentData): string;
|
|
4
4
|
export declare function evmDecodeTransferIntent(intent: Intent): TransferIntent;
|
|
5
5
|
export declare function evmEncodeSwapIntent(intent: SwapIntentData): string;
|
|
6
6
|
export declare function evmDecodeSwapIntent(intent: Intent): SwapIntent;
|
|
7
|
+
export declare function evmEncodeCallIntent(intent: EvmCallIntentData): string;
|
|
8
|
+
export declare function evmDecodeCallIntent(intent: Intent): EvmCallIntent;
|
|
7
9
|
//# sourceMappingURL=evm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evm.d.ts","sourceRoot":"","sources":["../../../../src/shared/codec/chains/evm.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"evm.d.ts","sourceRoot":"","sources":["../../../../src/shared/codec/chains/evm.ts"],"names":[],"mappings":"AAUA,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,MAAM,EAGN,UAAU,EACV,cAAc,EACd,cAAc,EACd,kBAAkB,EACnB,MAAM,aAAa,CAAA;AAEpB,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CA6BtD;AA0BD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAU1E;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CActE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAYlE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAsB9D;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAKrE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAcjE"}
|
|
@@ -5,6 +5,8 @@ exports.evmEncodeTransferIntent = evmEncodeTransferIntent;
|
|
|
5
5
|
exports.evmDecodeTransferIntent = evmDecodeTransferIntent;
|
|
6
6
|
exports.evmEncodeSwapIntent = evmEncodeSwapIntent;
|
|
7
7
|
exports.evmDecodeSwapIntent = evmDecodeSwapIntent;
|
|
8
|
+
exports.evmEncodeCallIntent = evmEncodeCallIntent;
|
|
9
|
+
exports.evmDecodeCallIntent = evmDecodeCallIntent;
|
|
8
10
|
const ethers_1 = require("ethers");
|
|
9
11
|
const eip712Types_1 = require("../../eip712Types");
|
|
10
12
|
function evmEncodeIntent(intent) {
|
|
@@ -100,4 +102,21 @@ function evmDecodeSwapIntent(intent) {
|
|
|
100
102
|
tokensOut,
|
|
101
103
|
};
|
|
102
104
|
}
|
|
105
|
+
function evmEncodeCallIntent(intent) {
|
|
106
|
+
return ethers_1.AbiCoder.defaultAbiCoder().encode([eip712Types_1.CALL_INTENT_ABI_TYPE], [[intent.chainId, (intent.calls || []).map((call) => [call.target, call.data, call.value])]]);
|
|
107
|
+
}
|
|
108
|
+
function evmDecodeCallIntent(intent) {
|
|
109
|
+
const [decoded] = ethers_1.AbiCoder.defaultAbiCoder().decode([eip712Types_1.CALL_INTENT_ABI_TYPE], intent.data);
|
|
110
|
+
const [chainId, callsRaw] = decoded;
|
|
111
|
+
const calls = callsRaw.map(([target, data, value]) => ({
|
|
112
|
+
target: target.toLowerCase(),
|
|
113
|
+
data,
|
|
114
|
+
value: value.toString(),
|
|
115
|
+
}));
|
|
116
|
+
return {
|
|
117
|
+
...intent,
|
|
118
|
+
chainId: parseInt(chainId),
|
|
119
|
+
calls,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
103
122
|
//# sourceMappingURL=evm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evm.js","sourceRoot":"","sources":["../../../../src/shared/codec/chains/evm.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"evm.js","sourceRoot":"","sources":["../../../../src/shared/codec/chains/evm.ts"],"names":[],"mappings":";;AAsBA,0CA6BC;AA0BD,0DAUC;AAED,0DAcC;AAED,kDAYC;AAED,kDAsBC;AAED,kDAKC;AAED,kDAcC;AApKD,mCAA4C;AAE5C,mDAO0B;AAa1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,OAAO,EAAE,QAAQ,CAAC,GAAG,OAAO,CAAA;IACnC,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,CAA2B,EAAE,EAAE,CAAC,CAAC;QAC/E,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE;QAC5B,IAAI;QACJ,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE;KACxB,CAAC,CAAC,CAAA;IAEH,OAAO;QACL,GAAG,MAAM;QACT,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC;QAC1B,KAAK;KACN,CAAA;AACH,CAAC"}
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { Schema } from 'borsh';
|
|
2
|
-
import { Intent, SwapIntent, SwapIntentData, TransferIntent, TransferIntentData } from '../../types';
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
2
|
+
import { Intent, SvmCallIntent, SvmCallIntentData, SwapIntent, SwapIntentData, TransferIntent, TransferIntentData } from '../../types';
|
|
3
|
+
export declare const SVM_UINT8_ARRAY_SCHEMA: Schema;
|
|
4
|
+
export declare const SVM_TRANSFER_SCHEMA: Schema;
|
|
5
|
+
export declare const SVM_TRANSFER_INTENT_DATA_SCHEMA: Schema;
|
|
6
|
+
export declare const SVM_TOKEN_IN_SCHEMA: Schema;
|
|
7
|
+
export declare const SVM_TOKEN_OUT_SCHEMA: Schema;
|
|
8
|
+
export declare const SVM_SWAP_INTENT_DATA_SCHEMA: Schema;
|
|
9
|
+
export declare const SVM_ACCOUNTS_META_SCHEMA: Schema;
|
|
10
|
+
export declare const SVM_CALL_INSTRUCTION_DATA_SCHEMA: Schema;
|
|
11
|
+
export declare const SVM_CALL_INTENT_DATA_SCHEMA: Schema;
|
|
12
|
+
export declare const SVM_MAX_FEE_SCHEMA: Schema;
|
|
13
|
+
export declare const SVM_INTENT_EVENT_SCHEMA: Schema;
|
|
14
|
+
export declare const SVM_INTENT_SCHEMA: Schema;
|
|
12
15
|
export declare function svmEncodeIntent(intent: Intent): string;
|
|
13
16
|
export declare function svmEncodeTransferIntent(intent: TransferIntentData): string;
|
|
14
17
|
export declare function svmDecodeTransferIntent(intent: Intent): TransferIntent;
|
|
15
18
|
export declare function svmEncodeSwapIntent(intent: SwapIntentData): string;
|
|
16
19
|
export declare function svmDecodeSwapIntent(intent: Intent): SwapIntent;
|
|
20
|
+
export declare function svmEncodeCallIntent(intent: SvmCallIntentData): string;
|
|
21
|
+
export declare function svmDecodeCallIntent(intent: Intent): SvmCallIntent;
|
|
17
22
|
//# sourceMappingURL=svm.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"svm.d.ts","sourceRoot":"","sources":["../../../../src/shared/codec/chains/svm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,EAAa,MAAM,OAAO,CAAA;AAGtD,OAAO,EACL,MAAM,EAGN,UAAU,EACV,cAAc,EACd,cAAc,EACd,kBAAkB,EACnB,MAAM,aAAa,CAAA;AAGpB,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"svm.d.ts","sourceRoot":"","sources":["../../../../src/shared/codec/chains/svm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,EAAa,MAAM,OAAO,CAAA;AAGtD,OAAO,EACL,MAAM,EAGN,aAAa,EACb,iBAAiB,EACjB,UAAU,EACV,cAAc,EACd,cAAc,EACd,kBAAkB,EACnB,MAAM,aAAa,CAAA;AAGpB,eAAO,MAAM,sBAAsB,EAAE,MAAkC,CAAA;AAEvE,eAAO,MAAM,mBAAmB,EAAE,MAMjC,CAAA;AAED,eAAO,MAAM,+BAA+B,EAAE,MAS7C,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,MAKjC,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,MAMlC,CAAA;AAED,eAAO,MAAM,2BAA2B,EAAE,MAezC,CAAA;AAED,eAAO,MAAM,wBAAwB,EAAE,MAMtC,CAAA;AAED,eAAO,MAAM,gCAAgC,EAAE,MAU9C,CAAA;AAED,eAAO,MAAM,2BAA2B,EAAE,MAQzC,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,MAKhC,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,MAKrC,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,MAa/B,CAAA;AAUD,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CActD;AAsBD,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,kBAAkB,GAAG,MAAM,CAU1E;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,CAYtE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,cAAc,GAAG,MAAM,CAclE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAoB9D;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAarE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,CAcjE"}
|
|
@@ -1,84 +1,113 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SVM_INTENT_SCHEMA = exports.SVM_INTENT_EVENT_SCHEMA = exports.SVM_MAX_FEE_SCHEMA = exports.SVM_CALL_INTENT_DATA_SCHEMA = exports.SVM_CALL_INSTRUCTION_DATA_SCHEMA = exports.SVM_ACCOUNTS_META_SCHEMA = exports.SVM_SWAP_INTENT_DATA_SCHEMA = exports.SVM_TOKEN_OUT_SCHEMA = exports.SVM_TOKEN_IN_SCHEMA = exports.SVM_TRANSFER_INTENT_DATA_SCHEMA = exports.SVM_TRANSFER_SCHEMA = exports.SVM_UINT8_ARRAY_SCHEMA = void 0;
|
|
4
4
|
exports.svmEncodeIntent = svmEncodeIntent;
|
|
5
5
|
exports.svmEncodeTransferIntent = svmEncodeTransferIntent;
|
|
6
6
|
exports.svmDecodeTransferIntent = svmDecodeTransferIntent;
|
|
7
7
|
exports.svmEncodeSwapIntent = svmEncodeSwapIntent;
|
|
8
8
|
exports.svmDecodeSwapIntent = svmDecodeSwapIntent;
|
|
9
|
+
exports.svmEncodeCallIntent = svmEncodeCallIntent;
|
|
10
|
+
exports.svmDecodeCallIntent = svmDecodeCallIntent;
|
|
9
11
|
const borsh_1 = require("borsh");
|
|
10
12
|
const ethers_1 = require("ethers");
|
|
11
13
|
const utils_1 = require("../../utils");
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
+
exports.SVM_UINT8_ARRAY_SCHEMA = { array: { type: 'u8' } };
|
|
15
|
+
exports.SVM_TRANSFER_SCHEMA = {
|
|
14
16
|
struct: {
|
|
15
|
-
token: exports.
|
|
17
|
+
token: exports.SVM_UINT8_ARRAY_SCHEMA,
|
|
16
18
|
amount: 'u64',
|
|
17
|
-
recipient: exports.
|
|
19
|
+
recipient: exports.SVM_UINT8_ARRAY_SCHEMA,
|
|
18
20
|
},
|
|
19
21
|
};
|
|
20
|
-
exports.
|
|
22
|
+
exports.SVM_TRANSFER_INTENT_DATA_SCHEMA = {
|
|
21
23
|
struct: {
|
|
22
24
|
chainId: 'u32',
|
|
23
25
|
transfers: {
|
|
24
26
|
array: {
|
|
25
|
-
type: exports.
|
|
27
|
+
type: exports.SVM_TRANSFER_SCHEMA,
|
|
26
28
|
},
|
|
27
29
|
},
|
|
28
30
|
},
|
|
29
31
|
};
|
|
30
|
-
exports.
|
|
32
|
+
exports.SVM_TOKEN_IN_SCHEMA = {
|
|
31
33
|
struct: {
|
|
32
|
-
token: exports.
|
|
34
|
+
token: exports.SVM_UINT8_ARRAY_SCHEMA,
|
|
33
35
|
amount: 'u64',
|
|
34
36
|
},
|
|
35
37
|
};
|
|
36
|
-
exports.
|
|
38
|
+
exports.SVM_TOKEN_OUT_SCHEMA = {
|
|
37
39
|
struct: {
|
|
38
|
-
token: exports.
|
|
39
|
-
recipient: exports.
|
|
40
|
+
token: exports.SVM_UINT8_ARRAY_SCHEMA,
|
|
41
|
+
recipient: exports.SVM_UINT8_ARRAY_SCHEMA,
|
|
40
42
|
minAmount: 'u64',
|
|
41
43
|
},
|
|
42
44
|
};
|
|
43
|
-
exports.
|
|
45
|
+
exports.SVM_SWAP_INTENT_DATA_SCHEMA = {
|
|
44
46
|
struct: {
|
|
45
47
|
sourceChain: 'u32',
|
|
46
48
|
destinationChain: 'u32',
|
|
47
49
|
tokensIn: {
|
|
48
50
|
array: {
|
|
49
|
-
type: exports.
|
|
51
|
+
type: exports.SVM_TOKEN_IN_SCHEMA,
|
|
50
52
|
},
|
|
51
53
|
},
|
|
52
54
|
tokensOut: {
|
|
53
55
|
array: {
|
|
54
|
-
type: exports.
|
|
56
|
+
type: exports.SVM_TOKEN_OUT_SCHEMA,
|
|
55
57
|
},
|
|
56
58
|
},
|
|
57
59
|
},
|
|
58
60
|
};
|
|
59
|
-
exports.
|
|
61
|
+
exports.SVM_ACCOUNTS_META_SCHEMA = {
|
|
60
62
|
struct: {
|
|
61
|
-
|
|
63
|
+
pubkey: exports.SVM_UINT8_ARRAY_SCHEMA,
|
|
64
|
+
isSigner: 'bool',
|
|
65
|
+
isWritable: 'bool',
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
exports.SVM_CALL_INSTRUCTION_DATA_SCHEMA = {
|
|
69
|
+
struct: {
|
|
70
|
+
programId: exports.SVM_UINT8_ARRAY_SCHEMA,
|
|
71
|
+
accountsMeta: {
|
|
72
|
+
array: {
|
|
73
|
+
type: exports.SVM_ACCOUNTS_META_SCHEMA,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
data: exports.SVM_UINT8_ARRAY_SCHEMA,
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
exports.SVM_CALL_INTENT_DATA_SCHEMA = {
|
|
80
|
+
struct: {
|
|
81
|
+
instructions: {
|
|
82
|
+
array: {
|
|
83
|
+
type: exports.SVM_CALL_INSTRUCTION_DATA_SCHEMA,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
exports.SVM_MAX_FEE_SCHEMA = {
|
|
89
|
+
struct: {
|
|
90
|
+
token: exports.SVM_UINT8_ARRAY_SCHEMA,
|
|
62
91
|
amount: 'u64',
|
|
63
92
|
},
|
|
64
93
|
};
|
|
65
|
-
exports.
|
|
94
|
+
exports.SVM_INTENT_EVENT_SCHEMA = {
|
|
66
95
|
struct: {
|
|
67
|
-
topic: exports.
|
|
68
|
-
data: exports.
|
|
96
|
+
topic: exports.SVM_UINT8_ARRAY_SCHEMA,
|
|
97
|
+
data: exports.SVM_UINT8_ARRAY_SCHEMA,
|
|
69
98
|
},
|
|
70
99
|
};
|
|
71
|
-
exports.
|
|
100
|
+
exports.SVM_INTENT_SCHEMA = {
|
|
72
101
|
struct: {
|
|
73
102
|
op: 'u8',
|
|
74
|
-
user: exports.
|
|
75
|
-
settler: exports.
|
|
76
|
-
nonce: exports.
|
|
103
|
+
user: exports.SVM_UINT8_ARRAY_SCHEMA,
|
|
104
|
+
settler: exports.SVM_UINT8_ARRAY_SCHEMA,
|
|
105
|
+
nonce: exports.SVM_UINT8_ARRAY_SCHEMA,
|
|
77
106
|
deadline: 'u64',
|
|
78
|
-
data: exports.
|
|
79
|
-
maxFees: exports.
|
|
80
|
-
events: exports.
|
|
81
|
-
configSig: exports.
|
|
107
|
+
data: exports.SVM_UINT8_ARRAY_SCHEMA,
|
|
108
|
+
maxFees: exports.SVM_UINT8_ARRAY_SCHEMA,
|
|
109
|
+
events: exports.SVM_UINT8_ARRAY_SCHEMA,
|
|
110
|
+
configSig: exports.SVM_UINT8_ARRAY_SCHEMA,
|
|
82
111
|
minValidations: 'u64',
|
|
83
112
|
},
|
|
84
113
|
};
|
|
@@ -101,7 +130,7 @@ function svmEncodeIntent(intent) {
|
|
|
101
130
|
data: (0, utils_1.hexToBytes)((0, ethers_1.keccak256)(intent.data)),
|
|
102
131
|
configSig: (0, utils_1.hexToBytes)(intent.configSig),
|
|
103
132
|
};
|
|
104
|
-
return borshSerialize(exports.
|
|
133
|
+
return borshSerialize(exports.SVM_INTENT_SCHEMA, data);
|
|
105
134
|
}
|
|
106
135
|
function svmEncodeMaxFees(maxFees) {
|
|
107
136
|
const maxFeesHashes = maxFees.map((maxFee) => (0, ethers_1.keccak256)(svmEncodeMaxFee(maxFee)));
|
|
@@ -109,7 +138,7 @@ function svmEncodeMaxFees(maxFees) {
|
|
|
109
138
|
}
|
|
110
139
|
function svmEncodeMaxFee(maxFee) {
|
|
111
140
|
const data = { ...maxFee, token: (0, utils_1.svmAddressToBytes)(maxFee.token) };
|
|
112
|
-
return borshSerialize(exports.
|
|
141
|
+
return borshSerialize(exports.SVM_MAX_FEE_SCHEMA, data);
|
|
113
142
|
}
|
|
114
143
|
function svmEncodeIntentEvents(events) {
|
|
115
144
|
const eventsHashes = events.map((event) => (0, ethers_1.keccak256)(svmEncodeIntentEvent(event)));
|
|
@@ -117,7 +146,7 @@ function svmEncodeIntentEvents(events) {
|
|
|
117
146
|
}
|
|
118
147
|
function svmEncodeIntentEvent(event) {
|
|
119
148
|
const data = { topic: (0, utils_1.hexToBytes)(event.topic), data: (0, utils_1.hexToBytes)((0, ethers_1.keccak256)(event.data)) };
|
|
120
|
-
return borshSerialize(exports.
|
|
149
|
+
return borshSerialize(exports.SVM_INTENT_EVENT_SCHEMA, data);
|
|
121
150
|
}
|
|
122
151
|
function svmEncodeTransferIntent(intent) {
|
|
123
152
|
const data = {
|
|
@@ -128,10 +157,10 @@ function svmEncodeTransferIntent(intent) {
|
|
|
128
157
|
recipient: (0, utils_1.svmAddressToBytes)(transfer.recipient),
|
|
129
158
|
})),
|
|
130
159
|
};
|
|
131
|
-
return borshSerialize(exports.
|
|
160
|
+
return borshSerialize(exports.SVM_TRANSFER_INTENT_DATA_SCHEMA, data);
|
|
132
161
|
}
|
|
133
162
|
function svmDecodeTransferIntent(intent) {
|
|
134
|
-
const { chainId, transfers } = borshDeserialize(exports.
|
|
163
|
+
const { chainId, transfers } = borshDeserialize(exports.SVM_TRANSFER_INTENT_DATA_SCHEMA, intent.data);
|
|
135
164
|
return {
|
|
136
165
|
...intent,
|
|
137
166
|
chainId,
|
|
@@ -155,10 +184,10 @@ function svmEncodeSwapIntent(intent) {
|
|
|
155
184
|
recipient: (0, utils_1.svmAddressToBytes)(tokenOut.recipient),
|
|
156
185
|
})),
|
|
157
186
|
};
|
|
158
|
-
return borshSerialize(exports.
|
|
187
|
+
return borshSerialize(exports.SVM_SWAP_INTENT_DATA_SCHEMA, data);
|
|
159
188
|
}
|
|
160
189
|
function svmDecodeSwapIntent(intent) {
|
|
161
|
-
const { sourceChain, destinationChain, tokensIn, tokensOut } = borshDeserialize(exports.
|
|
190
|
+
const { sourceChain, destinationChain, tokensIn, tokensOut } = borshDeserialize(exports.SVM_SWAP_INTENT_DATA_SCHEMA, intent.data);
|
|
162
191
|
return {
|
|
163
192
|
...intent,
|
|
164
193
|
sourceChain,
|
|
@@ -174,4 +203,31 @@ function svmDecodeSwapIntent(intent) {
|
|
|
174
203
|
})),
|
|
175
204
|
};
|
|
176
205
|
}
|
|
206
|
+
function svmEncodeCallIntent(intent) {
|
|
207
|
+
const data = {
|
|
208
|
+
instructions: intent.instructions.map((instruction) => ({
|
|
209
|
+
programId: (0, utils_1.svmAddressToBytes)(instruction.programId),
|
|
210
|
+
accountsMeta: instruction.accountsMeta.map((accountMeta) => ({
|
|
211
|
+
...accountMeta,
|
|
212
|
+
pubkey: (0, utils_1.svmAddressToBytes)(accountMeta.pubkey),
|
|
213
|
+
})),
|
|
214
|
+
data: (0, utils_1.hexToBytes)(instruction.data),
|
|
215
|
+
})),
|
|
216
|
+
};
|
|
217
|
+
return borshSerialize(exports.SVM_CALL_INTENT_DATA_SCHEMA, data);
|
|
218
|
+
}
|
|
219
|
+
function svmDecodeCallIntent(intent) {
|
|
220
|
+
const { instructions } = borshDeserialize(exports.SVM_CALL_INTENT_DATA_SCHEMA, intent.data);
|
|
221
|
+
return {
|
|
222
|
+
...intent,
|
|
223
|
+
instructions: instructions.map((instruction) => ({
|
|
224
|
+
programId: (0, utils_1.bytesToSvmAddress)(instruction.programId),
|
|
225
|
+
accountsMeta: instruction.accountsMeta.map((accountMeta) => ({
|
|
226
|
+
...accountMeta,
|
|
227
|
+
pubkey: (0, utils_1.bytesToSvmAddress)(accountMeta.pubkey),
|
|
228
|
+
})),
|
|
229
|
+
data: (0, utils_1.bytesToHex)(instruction.data),
|
|
230
|
+
})),
|
|
231
|
+
};
|
|
232
|
+
}
|
|
177
233
|
//# sourceMappingURL=svm.js.map
|