@reyaxyz/sdk 0.51.0 → 0.52.1
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/README.md +1 -1
- package/dist/abis/CoreProxy.json +5600 -0
- package/dist/abis/Periphery.json +380 -92
- package/dist/abis/socket/VaultWithPayload.json +6 -1
- package/dist/services/encode.js +2 -2
- package/dist/services/encode.js.map +1 -1
- package/dist/services/lp/bridgeAndDepositPassivePool.js +2 -2
- package/dist/services/lp/bridgeAndDepositPassivePool.js.map +1 -1
- package/dist/services/lp/encode.js +10 -6
- package/dist/services/lp/encode.js.map +1 -1
- package/dist/services/lp/transferFromMAToPool.js +1 -1
- package/dist/services/lp/transferFromMAToPool.js.map +1 -1
- package/dist/services/lp/types.js.map +1 -1
- package/dist/services/lp/withdrawPassivePoolAndBridge.js +2 -2
- package/dist/services/lp/withdrawPassivePoolAndBridge.js.map +1 -1
- package/dist/services/margin-accounts/bridgeAndDepositExistingMA.js +4 -9
- package/dist/services/margin-accounts/bridgeAndDepositExistingMA.js.map +1 -1
- package/dist/services/margin-accounts/bridgeAndDepositNewMA.js +2 -2
- package/dist/services/margin-accounts/bridgeAndDepositNewMA.js.map +1 -1
- package/dist/services/margin-accounts/encode.js +17 -12
- package/dist/services/margin-accounts/encode.js.map +1 -1
- package/dist/services/margin-accounts/withdrawMAAndBridge.js +1 -1
- package/dist/services/margin-accounts/withdrawMAAndBridge.js.map +1 -1
- package/dist/services/orders/encode.js +2 -2
- package/dist/services/orders/encode.js.map +1 -1
- package/dist/types/services/lp/bridgeAndDepositPassivePool.d.ts.map +1 -1
- package/dist/types/services/lp/encode.d.ts +3 -3
- package/dist/types/services/lp/encode.d.ts.map +1 -1
- package/dist/types/services/lp/transferFromMAToPool.d.ts.map +1 -1
- package/dist/types/services/lp/types.d.ts +1 -1
- package/dist/types/services/lp/types.d.ts.map +1 -1
- package/dist/types/services/lp/withdrawPassivePoolAndBridge.d.ts.map +1 -1
- package/dist/types/services/margin-accounts/bridgeAndDepositExistingMA.d.ts.map +1 -1
- package/dist/types/services/margin-accounts/bridgeAndDepositNewMA.d.ts.map +1 -1
- package/dist/types/services/margin-accounts/encode.d.ts +3 -3
- package/dist/types/services/margin-accounts/encode.d.ts.map +1 -1
- package/dist/types/services/margin-accounts/withdrawMAAndBridge.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/abis/CoreProxy.json +5394 -0
- package/src/abis/Periphery.json +380 -92
- package/src/abis/socket/VaultWithPayload.json +6 -1
- package/src/services/encode.ts +1 -1
- package/src/services/lp/bridgeAndDepositPassivePool.ts +2 -0
- package/src/services/lp/encode.ts +12 -3
- package/src/services/lp/transferFromMAToPool.ts +1 -0
- package/src/services/lp/types.ts +1 -1
- package/src/services/lp/withdrawPassivePoolAndBridge.ts +2 -0
- package/src/services/margin-accounts/bridgeAndDepositExistingMA.ts +2 -14
- package/src/services/margin-accounts/bridgeAndDepositNewMA.ts +2 -0
- package/src/services/margin-accounts/encode.ts +17 -9
- package/src/services/margin-accounts/withdrawMAAndBridge.ts +1 -0
- package/src/services/orders/encode.ts +1 -1
- package/dist/abis/AccountModule.json +0 -1079
- package/dist/abis/ExecutionModule.json +0 -758
- package/src/abis/AccountModule.json +0 -1079
- package/src/abis/ExecutionModule.json +0 -758
package/dist/abis/Periphery.json
CHANGED
|
@@ -143,17 +143,6 @@
|
|
|
143
143
|
],
|
|
144
144
|
"anonymous": false
|
|
145
145
|
},
|
|
146
|
-
{
|
|
147
|
-
"type": "error",
|
|
148
|
-
"name": "CheckZeroGasPrice",
|
|
149
|
-
"inputs": [
|
|
150
|
-
{
|
|
151
|
-
"name": "txGasPrice",
|
|
152
|
-
"type": "uint256",
|
|
153
|
-
"internalType": "uint256"
|
|
154
|
-
}
|
|
155
|
-
]
|
|
156
|
-
},
|
|
157
146
|
{
|
|
158
147
|
"type": "error",
|
|
159
148
|
"name": "ImplementationIsSterile",
|
|
@@ -262,6 +251,25 @@
|
|
|
262
251
|
],
|
|
263
252
|
"stateMutability": "view"
|
|
264
253
|
},
|
|
254
|
+
{
|
|
255
|
+
"type": "function",
|
|
256
|
+
"name": "getTokenExecutionHelper",
|
|
257
|
+
"inputs": [
|
|
258
|
+
{
|
|
259
|
+
"name": "token",
|
|
260
|
+
"type": "address",
|
|
261
|
+
"internalType": "address"
|
|
262
|
+
}
|
|
263
|
+
],
|
|
264
|
+
"outputs": [
|
|
265
|
+
{
|
|
266
|
+
"name": "executionHelper",
|
|
267
|
+
"type": "address",
|
|
268
|
+
"internalType": "address"
|
|
269
|
+
}
|
|
270
|
+
],
|
|
271
|
+
"stateMutability": "view"
|
|
272
|
+
},
|
|
265
273
|
{
|
|
266
274
|
"type": "function",
|
|
267
275
|
"name": "getTokenStaticWithdrawFee",
|
|
@@ -288,12 +296,40 @@
|
|
|
288
296
|
},
|
|
289
297
|
{
|
|
290
298
|
"type": "function",
|
|
291
|
-
"name": "
|
|
299
|
+
"name": "rescueErc20",
|
|
292
300
|
"inputs": [
|
|
293
301
|
{
|
|
294
302
|
"name": "amount",
|
|
295
303
|
"type": "uint256",
|
|
296
304
|
"internalType": "uint256"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
"name": "token",
|
|
308
|
+
"type": "address",
|
|
309
|
+
"internalType": "address"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"name": "receiver",
|
|
313
|
+
"type": "address",
|
|
314
|
+
"internalType": "address"
|
|
315
|
+
}
|
|
316
|
+
],
|
|
317
|
+
"outputs": [],
|
|
318
|
+
"stateMutability": "nonpayable"
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
"type": "function",
|
|
322
|
+
"name": "rescueEth",
|
|
323
|
+
"inputs": [
|
|
324
|
+
{
|
|
325
|
+
"name": "amount",
|
|
326
|
+
"type": "uint256",
|
|
327
|
+
"internalType": "uint256"
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"name": "receiver",
|
|
331
|
+
"type": "address",
|
|
332
|
+
"internalType": "address"
|
|
297
333
|
}
|
|
298
334
|
],
|
|
299
335
|
"outputs": [],
|
|
@@ -347,6 +383,24 @@
|
|
|
347
383
|
"outputs": [],
|
|
348
384
|
"stateMutability": "nonpayable"
|
|
349
385
|
},
|
|
386
|
+
{
|
|
387
|
+
"type": "function",
|
|
388
|
+
"name": "setTokenExecutionHelper",
|
|
389
|
+
"inputs": [
|
|
390
|
+
{
|
|
391
|
+
"name": "token",
|
|
392
|
+
"type": "address",
|
|
393
|
+
"internalType": "address"
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"name": "executionHelper",
|
|
397
|
+
"type": "address",
|
|
398
|
+
"internalType": "address"
|
|
399
|
+
}
|
|
400
|
+
],
|
|
401
|
+
"outputs": [],
|
|
402
|
+
"stateMutability": "nonpayable"
|
|
403
|
+
},
|
|
350
404
|
{
|
|
351
405
|
"type": "function",
|
|
352
406
|
"name": "setTokenStaticWithdrawFee",
|
|
@@ -370,6 +424,54 @@
|
|
|
370
424
|
"outputs": [],
|
|
371
425
|
"stateMutability": "nonpayable"
|
|
372
426
|
},
|
|
427
|
+
{
|
|
428
|
+
"type": "error",
|
|
429
|
+
"name": "ControllerNotRegistered",
|
|
430
|
+
"inputs": [
|
|
431
|
+
{
|
|
432
|
+
"name": "token",
|
|
433
|
+
"type": "address",
|
|
434
|
+
"internalType": "address"
|
|
435
|
+
}
|
|
436
|
+
]
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
"type": "error",
|
|
440
|
+
"name": "ExecutionHelperNotRegistered",
|
|
441
|
+
"inputs": [
|
|
442
|
+
{
|
|
443
|
+
"name": "token",
|
|
444
|
+
"type": "address",
|
|
445
|
+
"internalType": "address"
|
|
446
|
+
}
|
|
447
|
+
]
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
"type": "error",
|
|
451
|
+
"name": "FailedToRescueFunds",
|
|
452
|
+
"inputs": []
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"type": "error",
|
|
456
|
+
"name": "FailedTransfer",
|
|
457
|
+
"inputs": [
|
|
458
|
+
{
|
|
459
|
+
"name": "from",
|
|
460
|
+
"type": "address",
|
|
461
|
+
"internalType": "address"
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
"name": "to",
|
|
465
|
+
"type": "address",
|
|
466
|
+
"internalType": "address"
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
"name": "value",
|
|
470
|
+
"type": "uint256",
|
|
471
|
+
"internalType": "uint256"
|
|
472
|
+
}
|
|
473
|
+
]
|
|
474
|
+
},
|
|
373
475
|
{
|
|
374
476
|
"type": "function",
|
|
375
477
|
"name": "depositExistingMA",
|
|
@@ -393,33 +495,6 @@
|
|
|
393
495
|
"name": "tokenAmount",
|
|
394
496
|
"type": "uint256",
|
|
395
497
|
"internalType": "uint256"
|
|
396
|
-
},
|
|
397
|
-
{
|
|
398
|
-
"name": "sig",
|
|
399
|
-
"type": "tuple",
|
|
400
|
-
"internalType": "struct EIP712Signature",
|
|
401
|
-
"components": [
|
|
402
|
-
{
|
|
403
|
-
"name": "v",
|
|
404
|
-
"type": "uint8",
|
|
405
|
-
"internalType": "uint8"
|
|
406
|
-
},
|
|
407
|
-
{
|
|
408
|
-
"name": "r",
|
|
409
|
-
"type": "bytes32",
|
|
410
|
-
"internalType": "bytes32"
|
|
411
|
-
},
|
|
412
|
-
{
|
|
413
|
-
"name": "s",
|
|
414
|
-
"type": "bytes32",
|
|
415
|
-
"internalType": "bytes32"
|
|
416
|
-
},
|
|
417
|
-
{
|
|
418
|
-
"name": "deadline",
|
|
419
|
-
"type": "uint256",
|
|
420
|
-
"internalType": "uint256"
|
|
421
|
-
}
|
|
422
|
-
]
|
|
423
498
|
}
|
|
424
499
|
]
|
|
425
500
|
}
|
|
@@ -498,6 +573,22 @@
|
|
|
498
573
|
"outputs": [],
|
|
499
574
|
"stateMutability": "nonpayable"
|
|
500
575
|
},
|
|
576
|
+
{
|
|
577
|
+
"type": "error",
|
|
578
|
+
"name": "BridgedAmountDoesNotMatch",
|
|
579
|
+
"inputs": [
|
|
580
|
+
{
|
|
581
|
+
"name": "bridgeAmount",
|
|
582
|
+
"type": "uint256",
|
|
583
|
+
"internalType": "uint256"
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
"name": "givenAmount",
|
|
587
|
+
"type": "uint256",
|
|
588
|
+
"internalType": "uint256"
|
|
589
|
+
}
|
|
590
|
+
]
|
|
591
|
+
},
|
|
501
592
|
{
|
|
502
593
|
"type": "error",
|
|
503
594
|
"name": "CheckSelfCall",
|
|
@@ -575,33 +666,6 @@
|
|
|
575
666
|
"name": "tokenAmount",
|
|
576
667
|
"type": "uint256",
|
|
577
668
|
"internalType": "uint256"
|
|
578
|
-
},
|
|
579
|
-
{
|
|
580
|
-
"name": "sig",
|
|
581
|
-
"type": "tuple",
|
|
582
|
-
"internalType": "struct EIP712Signature",
|
|
583
|
-
"components": [
|
|
584
|
-
{
|
|
585
|
-
"name": "v",
|
|
586
|
-
"type": "uint8",
|
|
587
|
-
"internalType": "uint8"
|
|
588
|
-
},
|
|
589
|
-
{
|
|
590
|
-
"name": "r",
|
|
591
|
-
"type": "bytes32",
|
|
592
|
-
"internalType": "bytes32"
|
|
593
|
-
},
|
|
594
|
-
{
|
|
595
|
-
"name": "s",
|
|
596
|
-
"type": "bytes32",
|
|
597
|
-
"internalType": "bytes32"
|
|
598
|
-
},
|
|
599
|
-
{
|
|
600
|
-
"name": "deadline",
|
|
601
|
-
"type": "uint256",
|
|
602
|
-
"internalType": "uint256"
|
|
603
|
-
}
|
|
604
|
-
]
|
|
605
669
|
}
|
|
606
670
|
]
|
|
607
671
|
},
|
|
@@ -615,6 +679,11 @@
|
|
|
615
679
|
"type": "uint256",
|
|
616
680
|
"internalType": "uint256"
|
|
617
681
|
},
|
|
682
|
+
{
|
|
683
|
+
"name": "socketPayloadSize",
|
|
684
|
+
"type": "uint256",
|
|
685
|
+
"internalType": "uint256"
|
|
686
|
+
},
|
|
618
687
|
{
|
|
619
688
|
"name": "socketConnector",
|
|
620
689
|
"type": "address",
|
|
@@ -662,6 +731,11 @@
|
|
|
662
731
|
"type": "uint256",
|
|
663
732
|
"internalType": "uint256"
|
|
664
733
|
},
|
|
734
|
+
{
|
|
735
|
+
"name": "socketPayloadSize",
|
|
736
|
+
"type": "uint256",
|
|
737
|
+
"internalType": "uint256"
|
|
738
|
+
},
|
|
665
739
|
{
|
|
666
740
|
"name": "socketConnector",
|
|
667
741
|
"type": "address",
|
|
@@ -714,6 +788,11 @@
|
|
|
714
788
|
"type": "uint256",
|
|
715
789
|
"internalType": "uint256"
|
|
716
790
|
},
|
|
791
|
+
{
|
|
792
|
+
"name": "socketPayloadSize",
|
|
793
|
+
"type": "uint256",
|
|
794
|
+
"internalType": "uint256"
|
|
795
|
+
},
|
|
717
796
|
{
|
|
718
797
|
"name": "socketConnector",
|
|
719
798
|
"type": "address",
|
|
@@ -727,15 +806,15 @@
|
|
|
727
806
|
},
|
|
728
807
|
{
|
|
729
808
|
"type": "error",
|
|
730
|
-
"name": "
|
|
809
|
+
"name": "CallerIsNotExecutionHelper",
|
|
731
810
|
"inputs": [
|
|
732
811
|
{
|
|
733
|
-
"name": "
|
|
812
|
+
"name": "caller",
|
|
734
813
|
"type": "address",
|
|
735
814
|
"internalType": "address"
|
|
736
815
|
},
|
|
737
816
|
{
|
|
738
|
-
"name": "
|
|
817
|
+
"name": "token",
|
|
739
818
|
"type": "address",
|
|
740
819
|
"internalType": "address"
|
|
741
820
|
}
|
|
@@ -743,40 +822,167 @@
|
|
|
743
822
|
},
|
|
744
823
|
{
|
|
745
824
|
"type": "error",
|
|
746
|
-
"name": "
|
|
825
|
+
"name": "NotEnoughFees",
|
|
747
826
|
"inputs": [
|
|
748
827
|
{
|
|
749
|
-
"name": "
|
|
750
|
-
"type": "
|
|
751
|
-
"internalType": "
|
|
752
|
-
},
|
|
753
|
-
{
|
|
754
|
-
"name": "to",
|
|
755
|
-
"type": "address",
|
|
756
|
-
"internalType": "address"
|
|
828
|
+
"name": "tokenAmount",
|
|
829
|
+
"type": "uint256",
|
|
830
|
+
"internalType": "uint256"
|
|
757
831
|
},
|
|
758
832
|
{
|
|
759
|
-
"name": "
|
|
833
|
+
"name": "tokenFees",
|
|
760
834
|
"type": "uint256",
|
|
761
835
|
"internalType": "uint256"
|
|
762
836
|
}
|
|
763
837
|
]
|
|
764
838
|
},
|
|
765
839
|
{
|
|
766
|
-
"type": "
|
|
767
|
-
"name": "
|
|
840
|
+
"type": "function",
|
|
841
|
+
"name": "executeMatchOrders",
|
|
768
842
|
"inputs": [
|
|
769
843
|
{
|
|
770
|
-
"name": "
|
|
771
|
-
"type": "
|
|
772
|
-
"internalType": "
|
|
773
|
-
|
|
844
|
+
"name": "inputs",
|
|
845
|
+
"type": "tuple",
|
|
846
|
+
"internalType": "struct PeripheryMatchOrderInputs",
|
|
847
|
+
"components": [
|
|
848
|
+
{
|
|
849
|
+
"name": "accountId",
|
|
850
|
+
"type": "uint128",
|
|
851
|
+
"internalType": "uint128"
|
|
852
|
+
},
|
|
853
|
+
{
|
|
854
|
+
"name": "commands",
|
|
855
|
+
"type": "tuple[]",
|
|
856
|
+
"internalType": "struct Command[]",
|
|
857
|
+
"components": [
|
|
858
|
+
{
|
|
859
|
+
"name": "commandType",
|
|
860
|
+
"type": "uint8",
|
|
861
|
+
"internalType": "enum CommandType"
|
|
862
|
+
},
|
|
863
|
+
{
|
|
864
|
+
"name": "inputs",
|
|
865
|
+
"type": "bytes",
|
|
866
|
+
"internalType": "bytes"
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
"name": "marketId",
|
|
870
|
+
"type": "uint128",
|
|
871
|
+
"internalType": "uint128"
|
|
872
|
+
},
|
|
873
|
+
{
|
|
874
|
+
"name": "exchangeId",
|
|
875
|
+
"type": "uint128",
|
|
876
|
+
"internalType": "uint128"
|
|
877
|
+
}
|
|
878
|
+
]
|
|
879
|
+
},
|
|
880
|
+
{
|
|
881
|
+
"name": "sig",
|
|
882
|
+
"type": "tuple",
|
|
883
|
+
"internalType": "struct EIP712Signature",
|
|
884
|
+
"components": [
|
|
885
|
+
{
|
|
886
|
+
"name": "v",
|
|
887
|
+
"type": "uint8",
|
|
888
|
+
"internalType": "uint8"
|
|
889
|
+
},
|
|
890
|
+
{
|
|
891
|
+
"name": "r",
|
|
892
|
+
"type": "bytes32",
|
|
893
|
+
"internalType": "bytes32"
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
"name": "s",
|
|
897
|
+
"type": "bytes32",
|
|
898
|
+
"internalType": "bytes32"
|
|
899
|
+
},
|
|
900
|
+
{
|
|
901
|
+
"name": "deadline",
|
|
902
|
+
"type": "uint256",
|
|
903
|
+
"internalType": "uint256"
|
|
904
|
+
}
|
|
905
|
+
]
|
|
906
|
+
}
|
|
907
|
+
]
|
|
908
|
+
}
|
|
909
|
+
],
|
|
910
|
+
"outputs": [],
|
|
911
|
+
"stateMutability": "nonpayable"
|
|
912
|
+
},
|
|
913
|
+
{
|
|
914
|
+
"type": "error",
|
|
915
|
+
"name": "InvalidMatchOrders",
|
|
916
|
+
"inputs": []
|
|
917
|
+
},
|
|
918
|
+
{
|
|
919
|
+
"type": "function",
|
|
920
|
+
"name": "transferFromMAToMA",
|
|
921
|
+
"inputs": [
|
|
774
922
|
{
|
|
775
|
-
"name": "
|
|
776
|
-
"type": "
|
|
777
|
-
"internalType": "
|
|
923
|
+
"name": "inputs",
|
|
924
|
+
"type": "tuple",
|
|
925
|
+
"internalType": "struct TransferFromMAToMAInputs",
|
|
926
|
+
"components": [
|
|
927
|
+
{
|
|
928
|
+
"name": "accountId",
|
|
929
|
+
"type": "uint128",
|
|
930
|
+
"internalType": "uint128"
|
|
931
|
+
},
|
|
932
|
+
{
|
|
933
|
+
"name": "transfer",
|
|
934
|
+
"type": "tuple",
|
|
935
|
+
"internalType": "struct TransferInput",
|
|
936
|
+
"components": [
|
|
937
|
+
{
|
|
938
|
+
"name": "destAccountId",
|
|
939
|
+
"type": "uint128",
|
|
940
|
+
"internalType": "uint128"
|
|
941
|
+
},
|
|
942
|
+
{
|
|
943
|
+
"name": "collateral",
|
|
944
|
+
"type": "address",
|
|
945
|
+
"internalType": "address"
|
|
946
|
+
},
|
|
947
|
+
{
|
|
948
|
+
"name": "collateralAmount",
|
|
949
|
+
"type": "uint256",
|
|
950
|
+
"internalType": "uint256"
|
|
951
|
+
}
|
|
952
|
+
]
|
|
953
|
+
},
|
|
954
|
+
{
|
|
955
|
+
"name": "sig",
|
|
956
|
+
"type": "tuple",
|
|
957
|
+
"internalType": "struct EIP712Signature",
|
|
958
|
+
"components": [
|
|
959
|
+
{
|
|
960
|
+
"name": "v",
|
|
961
|
+
"type": "uint8",
|
|
962
|
+
"internalType": "uint8"
|
|
963
|
+
},
|
|
964
|
+
{
|
|
965
|
+
"name": "r",
|
|
966
|
+
"type": "bytes32",
|
|
967
|
+
"internalType": "bytes32"
|
|
968
|
+
},
|
|
969
|
+
{
|
|
970
|
+
"name": "s",
|
|
971
|
+
"type": "bytes32",
|
|
972
|
+
"internalType": "bytes32"
|
|
973
|
+
},
|
|
974
|
+
{
|
|
975
|
+
"name": "deadline",
|
|
976
|
+
"type": "uint256",
|
|
977
|
+
"internalType": "uint256"
|
|
978
|
+
}
|
|
979
|
+
]
|
|
980
|
+
}
|
|
981
|
+
]
|
|
778
982
|
}
|
|
779
|
-
]
|
|
983
|
+
],
|
|
984
|
+
"outputs": [],
|
|
985
|
+
"stateMutability": "nonpayable"
|
|
780
986
|
},
|
|
781
987
|
{
|
|
782
988
|
"type": "function",
|
|
@@ -833,6 +1039,11 @@
|
|
|
833
1039
|
"name": "minShares",
|
|
834
1040
|
"type": "uint256",
|
|
835
1041
|
"internalType": "uint256"
|
|
1042
|
+
},
|
|
1043
|
+
{
|
|
1044
|
+
"name": "receiver",
|
|
1045
|
+
"type": "address",
|
|
1046
|
+
"internalType": "address"
|
|
836
1047
|
}
|
|
837
1048
|
]
|
|
838
1049
|
}
|
|
@@ -841,9 +1052,71 @@
|
|
|
841
1052
|
"stateMutability": "nonpayable"
|
|
842
1053
|
},
|
|
843
1054
|
{
|
|
844
|
-
"type": "
|
|
845
|
-
"name": "
|
|
846
|
-
"inputs": [
|
|
1055
|
+
"type": "function",
|
|
1056
|
+
"name": "transferFromPoolToMA",
|
|
1057
|
+
"inputs": [
|
|
1058
|
+
{
|
|
1059
|
+
"name": "inputs",
|
|
1060
|
+
"type": "tuple",
|
|
1061
|
+
"internalType": "struct TransferFromPoolToMAInputs",
|
|
1062
|
+
"components": [
|
|
1063
|
+
{
|
|
1064
|
+
"name": "owner",
|
|
1065
|
+
"type": "address",
|
|
1066
|
+
"internalType": "address"
|
|
1067
|
+
},
|
|
1068
|
+
{
|
|
1069
|
+
"name": "sig",
|
|
1070
|
+
"type": "tuple",
|
|
1071
|
+
"internalType": "struct EIP712Signature",
|
|
1072
|
+
"components": [
|
|
1073
|
+
{
|
|
1074
|
+
"name": "v",
|
|
1075
|
+
"type": "uint8",
|
|
1076
|
+
"internalType": "uint8"
|
|
1077
|
+
},
|
|
1078
|
+
{
|
|
1079
|
+
"name": "r",
|
|
1080
|
+
"type": "bytes32",
|
|
1081
|
+
"internalType": "bytes32"
|
|
1082
|
+
},
|
|
1083
|
+
{
|
|
1084
|
+
"name": "s",
|
|
1085
|
+
"type": "bytes32",
|
|
1086
|
+
"internalType": "bytes32"
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
"name": "deadline",
|
|
1090
|
+
"type": "uint256",
|
|
1091
|
+
"internalType": "uint256"
|
|
1092
|
+
}
|
|
1093
|
+
]
|
|
1094
|
+
},
|
|
1095
|
+
{
|
|
1096
|
+
"name": "sharesAmount",
|
|
1097
|
+
"type": "uint256",
|
|
1098
|
+
"internalType": "uint256"
|
|
1099
|
+
},
|
|
1100
|
+
{
|
|
1101
|
+
"name": "poolId",
|
|
1102
|
+
"type": "uint128",
|
|
1103
|
+
"internalType": "uint128"
|
|
1104
|
+
},
|
|
1105
|
+
{
|
|
1106
|
+
"name": "minOut",
|
|
1107
|
+
"type": "uint256",
|
|
1108
|
+
"internalType": "uint256"
|
|
1109
|
+
},
|
|
1110
|
+
{
|
|
1111
|
+
"name": "accountId",
|
|
1112
|
+
"type": "uint128",
|
|
1113
|
+
"internalType": "uint128"
|
|
1114
|
+
}
|
|
1115
|
+
]
|
|
1116
|
+
}
|
|
1117
|
+
],
|
|
1118
|
+
"outputs": [],
|
|
1119
|
+
"stateMutability": "nonpayable"
|
|
847
1120
|
},
|
|
848
1121
|
{
|
|
849
1122
|
"type": "function",
|
|
@@ -901,6 +1174,11 @@
|
|
|
901
1174
|
"type": "uint256",
|
|
902
1175
|
"internalType": "uint256"
|
|
903
1176
|
},
|
|
1177
|
+
{
|
|
1178
|
+
"name": "socketPayloadSize",
|
|
1179
|
+
"type": "uint256",
|
|
1180
|
+
"internalType": "uint256"
|
|
1181
|
+
},
|
|
904
1182
|
{
|
|
905
1183
|
"name": "socketConnector",
|
|
906
1184
|
"type": "address",
|
|
@@ -926,6 +1204,11 @@
|
|
|
926
1204
|
"type": "tuple",
|
|
927
1205
|
"internalType": "struct WithdrawPassivePoolInputs",
|
|
928
1206
|
"components": [
|
|
1207
|
+
{
|
|
1208
|
+
"name": "owner",
|
|
1209
|
+
"type": "address",
|
|
1210
|
+
"internalType": "address"
|
|
1211
|
+
},
|
|
929
1212
|
{
|
|
930
1213
|
"name": "poolId",
|
|
931
1214
|
"type": "uint128",
|
|
@@ -973,6 +1256,11 @@
|
|
|
973
1256
|
"type": "uint256",
|
|
974
1257
|
"internalType": "uint256"
|
|
975
1258
|
},
|
|
1259
|
+
{
|
|
1260
|
+
"name": "socketPayloadSize",
|
|
1261
|
+
"type": "uint256",
|
|
1262
|
+
"internalType": "uint256"
|
|
1263
|
+
},
|
|
976
1264
|
{
|
|
977
1265
|
"name": "socketConnector",
|
|
978
1266
|
"type": "address",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"abi": [
|
|
3
3
|
{
|
|
4
4
|
"type": "function",
|
|
5
|
-
"name": "
|
|
5
|
+
"name": "bridge",
|
|
6
6
|
"inputs": [
|
|
7
7
|
{
|
|
8
8
|
"name": "receiver_",
|
|
@@ -28,6 +28,11 @@
|
|
|
28
28
|
"name": "execPayload_",
|
|
29
29
|
"type": "bytes",
|
|
30
30
|
"internalType": "bytes"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"name": "options_",
|
|
34
|
+
"type": "bytes",
|
|
35
|
+
"internalType": "bytes"
|
|
31
36
|
}
|
|
32
37
|
]
|
|
33
38
|
}
|
package/dist/services/encode.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.encodeRouterCall = exports.encodeSingleTrade = exports.encodeSingleTransferMargin = exports.encodeSingleWithdraw = exports.encodeSingleDeposit = void 0;
|
|
5
5
|
var routerCommands_1 = require("../utils/routerCommands");
|
|
6
6
|
var ethers_1 = require("ethers");
|
|
7
|
-
var
|
|
7
|
+
var CoreProxy_json_1 = require("../abis/CoreProxy.json");
|
|
8
8
|
// const abi = [
|
|
9
9
|
// 'function coreExecute(uint128 poolId, uint128 accountId, Command[] commands, EIP712Signature sig)',
|
|
10
10
|
// ];
|
|
@@ -29,7 +29,7 @@ exports.encodeSingleTrade = encodeSingleTrade;
|
|
|
29
29
|
var encodeRouterCall = function (multiAction, accountId, nativeCurrencyValue) {
|
|
30
30
|
var functionSignature = 'execute';
|
|
31
31
|
var parameters = [accountId, multiAction.commands];
|
|
32
|
-
var INTERFACE = new ethers_1.Interface(
|
|
32
|
+
var INTERFACE = new ethers_1.Interface(CoreProxy_json_1.abi);
|
|
33
33
|
var calldata = INTERFACE.encodeFunctionData(functionSignature, parameters);
|
|
34
34
|
return {
|
|
35
35
|
calldata: calldata,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"encode.js","sourceRoot":"/","sources":["services/encode.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,0DAAkE;AAClE,iCAA6C;AAC7C,
|
|
1
|
+
{"version":3,"file":"encode.js","sourceRoot":"/","sources":["services/encode.ts"],"names":[],"mappings":";AAAA,yDAAyD;;;AAGzD,0DAAkE;AAClE,iCAA6C;AAC7C,yDAA6C;AAC7C,gBAAgB;AAChB,wGAAwG;AACxG,KAAK;AACE,IAAM,mBAAmB,GAAG,UACjC,KAAa,EACb,MAAc,EACd,WAAwB;IAExB,WAAW,CAAC,SAAS,CAAC,IAAA,2BAAU,EAAC,4BAAW,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAChF,CAAC,CAAC;AANW,QAAA,mBAAmB,uBAM9B;AAEK,IAAM,oBAAoB,GAAG,UAClC,KAAa,EACb,MAAc,EACd,WAAwB;IAExB,WAAW,CAAC,SAAS,CACnB,IAAA,2BAAU,EAAC,4BAAW,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CACxD,CAAC;AACJ,CAAC,CAAC;AARW,QAAA,oBAAoB,wBAQ/B;AAEK,IAAM,0BAA0B,GAAG,UACxC,iBAAyB,EACzB,KAAa,EACb,MAAc,EACd,WAAwB;IAExB,WAAW,CAAC,SAAS,CACnB,IAAA,2BAAU,EACR,4BAAW,CAAC,uBAAuB,EACnC,CAAC,CAAC,iBAAiB,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,EACpC,CAAC,EACD,CAAC,CACF,CACF,CAAC;AACJ,CAAC,CAAC;AAdW,QAAA,0BAA0B,8BAcrC;AAEK,IAAM,iBAAiB,GAAG,UAC/B,sBAAgC,EAChC,SAAiB,EACjB,eAAuB,EACvB,QAAgB,EAChB,UAAkB,EAClB,WAAwB;IAExB,wGAAwG;IACxG,IAAM,gBAAgB,GAAG,iBAAQ,CAAC,eAAe,EAAE,CAAC,MAAM,CACxD,CAAC,QAAQ,EAAE,SAAS,CAAC,EACrB,CAAC,SAAS,EAAE,eAAe,CAAC,CAC7B,CAAC;IAEF,WAAW,CAAC,SAAS,CACnB,IAAA,2BAAU,EACR,4BAAW,CAAC,WAAW,EACvB,CAAC,sBAAsB,EAAE,gBAAgB,CAAC,EAC1C,QAAQ,EACR,UAAU,CACX,CACF,CAAC;AACJ,CAAC,CAAC;AAtBW,QAAA,iBAAiB,qBAsB5B;AAEK,IAAM,gBAAgB,GAAG,UAC9B,WAAwB,EACxB,SAAiB,EACjB,mBAA2B;IAE3B,IAAM,iBAAiB,GAAG,SAAS,CAAC;IACpC,IAAM,UAAU,GAAG,CAAC,SAAS,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAErD,IAAM,SAAS,GAAG,IAAI,kBAAS,CAAC,oBAAG,CAAC,CAAC;IACrC,IAAM,QAAQ,GAAG,SAAS,CAAC,kBAAkB,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;IAC7E,OAAO;QACL,QAAQ,EAAE,QAAQ;QAClB,KAAK,EAAE,MAAM,CAAC,mBAAmB,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC;KAChD,CAAC;AACJ,CAAC,CAAC;AAdW,QAAA,gBAAgB,oBAc3B","sourcesContent":["//////////////////// ENCODE SINGLE ////////////////////\n\nimport { MethodParameters, MultiAction } from '../utils/action';\nimport { CommandType, getCommand } from '../utils/routerCommands';\nimport { AbiCoder, Interface } from 'ethers';\nimport { abi } from '../abis/CoreProxy.json';\n// const abi = [\n// 'function coreExecute(uint128 poolId, uint128 accountId, Command[] commands, EIP712Signature sig)',\n// ];\nexport const encodeSingleDeposit = (\n token: string,\n amount: bigint,\n multiAction: MultiAction,\n): void => {\n multiAction.newAction(getCommand(CommandType.DEPOSIT, [token, amount], 0, 0));\n};\n\nexport const encodeSingleWithdraw = (\n token: string,\n amount: bigint,\n multiAction: MultiAction,\n): void => {\n multiAction.newAction(\n getCommand(CommandType.WITHDRAW, [token, amount], 0, 0),\n );\n};\n\nexport const encodeSingleTransferMargin = (\n toMarginAccountId: number,\n token: string,\n amount: bigint,\n multiAction: MultiAction,\n): void => {\n multiAction.newAction(\n getCommand(\n CommandType.TRANSFER_MARGIN_ACCOUNT,\n [[toMarginAccountId, token, amount]],\n 0,\n 0,\n ),\n );\n};\n\nexport const encodeSingleTrade = (\n counterpartyAccountIds: number[],\n orderBase: bigint,\n orderPriceLimit: bigint,\n marketId: number,\n exchangeId: number,\n multiAction: MultiAction,\n): void => {\n // (int256 orderBase, UD60x18 orderPriceLimit) = abi.decode(matchOrderInputs.inputs, (int256, UD60x18));\n const encodedBasePrice = AbiCoder.defaultAbiCoder().encode(\n ['int256', 'uint256'],\n [orderBase, orderPriceLimit],\n );\n\n multiAction.newAction(\n getCommand(\n CommandType.MATCH_ORDER,\n [counterpartyAccountIds, encodedBasePrice],\n marketId,\n exchangeId,\n ),\n );\n};\n\nexport const encodeRouterCall = (\n multiAction: MultiAction,\n accountId: number,\n nativeCurrencyValue: bigint,\n): MethodParameters => {\n const functionSignature = 'execute';\n const parameters = [accountId, multiAction.commands];\n\n const INTERFACE = new Interface(abi);\n const calldata = INTERFACE.encodeFunctionData(functionSignature, parameters);\n return {\n calldata: calldata,\n value: BigInt(nativeCurrencyValue).toString(10),\n };\n};\n"]}
|