@myx-trade/sdk 0.1.246 → 0.1.247
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/index.js +147 -534
- package/dist/index.mjs +147 -534
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1851,7 +1851,7 @@ var RotationProvider = class extends import_providers.BaseProvider {
|
|
|
1851
1851
|
// package.json
|
|
1852
1852
|
var package_default = {
|
|
1853
1853
|
name: "@myx-trade/sdk",
|
|
1854
|
-
version: "0.1.
|
|
1854
|
+
version: "0.1.247",
|
|
1855
1855
|
private: false,
|
|
1856
1856
|
publishConfig: {
|
|
1857
1857
|
access: "public"
|
|
@@ -9326,6 +9326,24 @@ var Forwarder_default = [
|
|
|
9326
9326
|
name: "InvalidInitialization",
|
|
9327
9327
|
inputs: []
|
|
9328
9328
|
},
|
|
9329
|
+
{
|
|
9330
|
+
type: "error",
|
|
9331
|
+
name: "MismatchExecuteFee",
|
|
9332
|
+
inputs: [
|
|
9333
|
+
{
|
|
9334
|
+
type: "uint256",
|
|
9335
|
+
name: "balanceBefore"
|
|
9336
|
+
},
|
|
9337
|
+
{
|
|
9338
|
+
type: "uint256",
|
|
9339
|
+
name: "balanceAfter"
|
|
9340
|
+
},
|
|
9341
|
+
{
|
|
9342
|
+
type: "uint256",
|
|
9343
|
+
name: "expected"
|
|
9344
|
+
}
|
|
9345
|
+
]
|
|
9346
|
+
},
|
|
9329
9347
|
{
|
|
9330
9348
|
type: "error",
|
|
9331
9349
|
name: "MismatchedSender",
|
|
@@ -9402,13 +9420,8 @@ var Forwarder_default = [
|
|
|
9402
9420
|
},
|
|
9403
9421
|
{
|
|
9404
9422
|
type: "error",
|
|
9405
|
-
name: "
|
|
9406
|
-
inputs: [
|
|
9407
|
-
{
|
|
9408
|
-
type: "address",
|
|
9409
|
-
name: "token"
|
|
9410
|
-
}
|
|
9411
|
-
]
|
|
9423
|
+
name: "RemoveRelayerFailed",
|
|
9424
|
+
inputs: []
|
|
9412
9425
|
},
|
|
9413
9426
|
{
|
|
9414
9427
|
type: "error",
|
|
@@ -9437,6 +9450,28 @@ var Forwarder_default = [
|
|
|
9437
9450
|
}
|
|
9438
9451
|
]
|
|
9439
9452
|
},
|
|
9453
|
+
{
|
|
9454
|
+
type: "event",
|
|
9455
|
+
anonymous: false,
|
|
9456
|
+
name: "ChargeForwardFee",
|
|
9457
|
+
inputs: [
|
|
9458
|
+
{
|
|
9459
|
+
type: "address",
|
|
9460
|
+
name: "account",
|
|
9461
|
+
indexed: false
|
|
9462
|
+
},
|
|
9463
|
+
{
|
|
9464
|
+
type: "address",
|
|
9465
|
+
name: "feeToken",
|
|
9466
|
+
indexed: false
|
|
9467
|
+
},
|
|
9468
|
+
{
|
|
9469
|
+
type: "uint256",
|
|
9470
|
+
name: "relayFee",
|
|
9471
|
+
indexed: false
|
|
9472
|
+
}
|
|
9473
|
+
]
|
|
9474
|
+
},
|
|
9440
9475
|
{
|
|
9441
9476
|
type: "event",
|
|
9442
9477
|
anonymous: false,
|
|
@@ -9543,7 +9578,7 @@ var Forwarder_default = [
|
|
|
9543
9578
|
{
|
|
9544
9579
|
type: "event",
|
|
9545
9580
|
anonymous: false,
|
|
9546
|
-
name: "
|
|
9581
|
+
name: "UpdateAcquiescentFeeToken",
|
|
9547
9582
|
inputs: [
|
|
9548
9583
|
{
|
|
9549
9584
|
type: "address",
|
|
@@ -9551,13 +9586,13 @@ var Forwarder_default = [
|
|
|
9551
9586
|
indexed: false
|
|
9552
9587
|
},
|
|
9553
9588
|
{
|
|
9554
|
-
type: "
|
|
9555
|
-
name: "
|
|
9589
|
+
type: "address",
|
|
9590
|
+
name: "oldRelayGas",
|
|
9556
9591
|
indexed: false
|
|
9557
9592
|
},
|
|
9558
9593
|
{
|
|
9559
|
-
type: "
|
|
9560
|
-
name: "
|
|
9594
|
+
type: "address",
|
|
9595
|
+
name: "newRelayGas",
|
|
9561
9596
|
indexed: false
|
|
9562
9597
|
}
|
|
9563
9598
|
]
|
|
@@ -9565,7 +9600,7 @@ var Forwarder_default = [
|
|
|
9565
9600
|
{
|
|
9566
9601
|
type: "event",
|
|
9567
9602
|
anonymous: false,
|
|
9568
|
-
name: "
|
|
9603
|
+
name: "UpdateEquilibriumGas",
|
|
9569
9604
|
inputs: [
|
|
9570
9605
|
{
|
|
9571
9606
|
type: "address",
|
|
@@ -9574,22 +9609,34 @@ var Forwarder_default = [
|
|
|
9574
9609
|
},
|
|
9575
9610
|
{
|
|
9576
9611
|
type: "uint256",
|
|
9577
|
-
name: "
|
|
9612
|
+
name: "oldRelayGas",
|
|
9578
9613
|
indexed: false
|
|
9579
9614
|
},
|
|
9580
9615
|
{
|
|
9581
9616
|
type: "uint256",
|
|
9582
|
-
name: "
|
|
9617
|
+
name: "newRelayGas",
|
|
9618
|
+
indexed: false
|
|
9619
|
+
}
|
|
9620
|
+
]
|
|
9621
|
+
},
|
|
9622
|
+
{
|
|
9623
|
+
type: "event",
|
|
9624
|
+
anonymous: false,
|
|
9625
|
+
name: "UpdateMaxRelayFee",
|
|
9626
|
+
inputs: [
|
|
9627
|
+
{
|
|
9628
|
+
type: "address",
|
|
9629
|
+
name: "sender",
|
|
9583
9630
|
indexed: false
|
|
9584
9631
|
},
|
|
9585
9632
|
{
|
|
9586
9633
|
type: "uint256",
|
|
9587
|
-
name: "
|
|
9634
|
+
name: "oldMaxRelayFee",
|
|
9588
9635
|
indexed: false
|
|
9589
9636
|
},
|
|
9590
9637
|
{
|
|
9591
9638
|
type: "uint256",
|
|
9592
|
-
name: "
|
|
9639
|
+
name: "newMaxRelayFee",
|
|
9593
9640
|
indexed: false
|
|
9594
9641
|
}
|
|
9595
9642
|
]
|
|
@@ -9652,6 +9699,10 @@ var Forwarder_default = [
|
|
|
9652
9699
|
stateMutability: "payable",
|
|
9653
9700
|
payable: true,
|
|
9654
9701
|
inputs: [
|
|
9702
|
+
{
|
|
9703
|
+
type: "address",
|
|
9704
|
+
name: "forwardFeeToken"
|
|
9705
|
+
},
|
|
9655
9706
|
{
|
|
9656
9707
|
type: "tuple[]",
|
|
9657
9708
|
name: "bundleParams",
|
|
@@ -9727,6 +9778,19 @@ var Forwarder_default = [
|
|
|
9727
9778
|
}
|
|
9728
9779
|
]
|
|
9729
9780
|
},
|
|
9781
|
+
{
|
|
9782
|
+
type: "function",
|
|
9783
|
+
name: "equilibriumGas",
|
|
9784
|
+
constant: true,
|
|
9785
|
+
stateMutability: "view",
|
|
9786
|
+
payable: false,
|
|
9787
|
+
inputs: [],
|
|
9788
|
+
outputs: [
|
|
9789
|
+
{
|
|
9790
|
+
type: "uint256"
|
|
9791
|
+
}
|
|
9792
|
+
]
|
|
9793
|
+
},
|
|
9730
9794
|
{
|
|
9731
9795
|
type: "function",
|
|
9732
9796
|
name: "execute",
|
|
@@ -9767,6 +9831,10 @@ var Forwarder_default = [
|
|
|
9767
9831
|
name: "signature"
|
|
9768
9832
|
}
|
|
9769
9833
|
]
|
|
9834
|
+
},
|
|
9835
|
+
{
|
|
9836
|
+
type: "address",
|
|
9837
|
+
name: "masterAccount"
|
|
9770
9838
|
}
|
|
9771
9839
|
],
|
|
9772
9840
|
outputs: []
|
|
@@ -9812,6 +9880,10 @@ var Forwarder_default = [
|
|
|
9812
9880
|
}
|
|
9813
9881
|
]
|
|
9814
9882
|
},
|
|
9883
|
+
{
|
|
9884
|
+
type: "address",
|
|
9885
|
+
name: "masterAccount"
|
|
9886
|
+
},
|
|
9815
9887
|
{
|
|
9816
9888
|
type: "address",
|
|
9817
9889
|
name: "refundReceiver"
|
|
@@ -9826,6 +9898,10 @@ var Forwarder_default = [
|
|
|
9826
9898
|
stateMutability: "payable",
|
|
9827
9899
|
payable: true,
|
|
9828
9900
|
inputs: [
|
|
9901
|
+
{
|
|
9902
|
+
type: "address",
|
|
9903
|
+
name: "forwardFeeToken"
|
|
9904
|
+
},
|
|
9829
9905
|
{
|
|
9830
9906
|
type: "tuple",
|
|
9831
9907
|
name: "params",
|
|
@@ -9865,16 +9941,11 @@ var Forwarder_default = [
|
|
|
9865
9941
|
},
|
|
9866
9942
|
{
|
|
9867
9943
|
type: "function",
|
|
9868
|
-
name: "
|
|
9869
|
-
constant:
|
|
9870
|
-
stateMutability: "view",
|
|
9944
|
+
name: "exitForwardMode",
|
|
9945
|
+
constant: false,
|
|
9871
9946
|
payable: false,
|
|
9872
9947
|
inputs: [],
|
|
9873
|
-
outputs: [
|
|
9874
|
-
{
|
|
9875
|
-
type: "address"
|
|
9876
|
-
}
|
|
9877
|
-
]
|
|
9948
|
+
outputs: []
|
|
9878
9949
|
},
|
|
9879
9950
|
{
|
|
9880
9951
|
type: "function",
|
|
@@ -9922,7 +9993,7 @@ var Forwarder_default = [
|
|
|
9922
9993
|
},
|
|
9923
9994
|
{
|
|
9924
9995
|
type: "function",
|
|
9925
|
-
name: "
|
|
9996
|
+
name: "getDesignatedToken",
|
|
9926
9997
|
constant: true,
|
|
9927
9998
|
stateMutability: "view",
|
|
9928
9999
|
payable: false,
|
|
@@ -9935,71 +10006,58 @@ var Forwarder_default = [
|
|
|
9935
10006
|
},
|
|
9936
10007
|
{
|
|
9937
10008
|
type: "function",
|
|
9938
|
-
name: "
|
|
10009
|
+
name: "getEquilibriumGas",
|
|
9939
10010
|
constant: true,
|
|
9940
10011
|
stateMutability: "view",
|
|
9941
10012
|
payable: false,
|
|
9942
10013
|
inputs: [],
|
|
9943
10014
|
outputs: [
|
|
9944
10015
|
{
|
|
9945
|
-
type: "
|
|
10016
|
+
type: "uint256"
|
|
9946
10017
|
}
|
|
9947
10018
|
]
|
|
9948
10019
|
},
|
|
9949
10020
|
{
|
|
9950
10021
|
type: "function",
|
|
9951
|
-
name: "
|
|
10022
|
+
name: "getImplementation",
|
|
9952
10023
|
constant: true,
|
|
9953
10024
|
stateMutability: "view",
|
|
9954
10025
|
payable: false,
|
|
9955
10026
|
inputs: [],
|
|
9956
10027
|
outputs: [
|
|
9957
10028
|
{
|
|
9958
|
-
type: "
|
|
10029
|
+
type: "address"
|
|
9959
10030
|
}
|
|
9960
10031
|
]
|
|
9961
10032
|
},
|
|
9962
10033
|
{
|
|
9963
10034
|
type: "function",
|
|
9964
|
-
name: "
|
|
10035
|
+
name: "getUserRelayers",
|
|
9965
10036
|
constant: true,
|
|
9966
10037
|
stateMutability: "view",
|
|
9967
10038
|
payable: false,
|
|
9968
|
-
inputs: [
|
|
9969
|
-
outputs: [
|
|
10039
|
+
inputs: [
|
|
9970
10040
|
{
|
|
9971
|
-
type: "
|
|
10041
|
+
type: "address",
|
|
10042
|
+
name: "account"
|
|
9972
10043
|
}
|
|
9973
|
-
]
|
|
9974
|
-
},
|
|
9975
|
-
{
|
|
9976
|
-
type: "function",
|
|
9977
|
-
name: "getRelayGas",
|
|
9978
|
-
constant: true,
|
|
9979
|
-
stateMutability: "view",
|
|
9980
|
-
payable: false,
|
|
9981
|
-
inputs: [],
|
|
10044
|
+
],
|
|
9982
10045
|
outputs: [
|
|
9983
10046
|
{
|
|
9984
|
-
type: "
|
|
10047
|
+
type: "address[]"
|
|
9985
10048
|
}
|
|
9986
10049
|
]
|
|
9987
10050
|
},
|
|
9988
10051
|
{
|
|
9989
10052
|
type: "function",
|
|
9990
|
-
name: "
|
|
10053
|
+
name: "inForwardMode",
|
|
9991
10054
|
constant: true,
|
|
9992
10055
|
stateMutability: "view",
|
|
9993
10056
|
payable: false,
|
|
9994
|
-
inputs: [
|
|
9995
|
-
{
|
|
9996
|
-
type: "address",
|
|
9997
|
-
name: "account"
|
|
9998
|
-
}
|
|
9999
|
-
],
|
|
10057
|
+
inputs: [],
|
|
10000
10058
|
outputs: [
|
|
10001
10059
|
{
|
|
10002
|
-
type: "
|
|
10060
|
+
type: "bool"
|
|
10003
10061
|
}
|
|
10004
10062
|
]
|
|
10005
10063
|
},
|
|
@@ -10013,35 +10071,23 @@ var Forwarder_default = [
|
|
|
10013
10071
|
type: "address",
|
|
10014
10072
|
name: "addressManager"
|
|
10015
10073
|
},
|
|
10016
|
-
{
|
|
10017
|
-
type: "address",
|
|
10018
|
-
name: "_feeToken"
|
|
10019
|
-
},
|
|
10020
|
-
{
|
|
10021
|
-
type: "uint256",
|
|
10022
|
-
name: "_relayFee"
|
|
10023
|
-
},
|
|
10024
|
-
{
|
|
10025
|
-
type: "uint256",
|
|
10026
|
-
name: "_relayGas"
|
|
10027
|
-
},
|
|
10028
10074
|
{
|
|
10029
10075
|
type: "uint256",
|
|
10030
|
-
name: "
|
|
10076
|
+
name: "_equilibriumGas"
|
|
10031
10077
|
}
|
|
10032
10078
|
],
|
|
10033
10079
|
outputs: []
|
|
10034
10080
|
},
|
|
10035
10081
|
{
|
|
10036
10082
|
type: "function",
|
|
10037
|
-
name: "
|
|
10083
|
+
name: "isAllowedTargets",
|
|
10038
10084
|
constant: true,
|
|
10039
10085
|
stateMutability: "view",
|
|
10040
10086
|
payable: false,
|
|
10041
10087
|
inputs: [
|
|
10042
10088
|
{
|
|
10043
10089
|
type: "address",
|
|
10044
|
-
name: "
|
|
10090
|
+
name: "contractAddr"
|
|
10045
10091
|
}
|
|
10046
10092
|
],
|
|
10047
10093
|
outputs: [
|
|
@@ -10052,18 +10098,14 @@ var Forwarder_default = [
|
|
|
10052
10098
|
},
|
|
10053
10099
|
{
|
|
10054
10100
|
type: "function",
|
|
10055
|
-
name: "
|
|
10101
|
+
name: "isTrustedForwarder",
|
|
10056
10102
|
constant: true,
|
|
10057
10103
|
stateMutability: "view",
|
|
10058
10104
|
payable: false,
|
|
10059
10105
|
inputs: [
|
|
10060
10106
|
{
|
|
10061
10107
|
type: "address",
|
|
10062
|
-
name: "
|
|
10063
|
-
},
|
|
10064
|
-
{
|
|
10065
|
-
type: "address",
|
|
10066
|
-
name: "relayer"
|
|
10108
|
+
name: "forwarder"
|
|
10067
10109
|
}
|
|
10068
10110
|
],
|
|
10069
10111
|
outputs: [
|
|
@@ -10074,14 +10116,23 @@ var Forwarder_default = [
|
|
|
10074
10116
|
},
|
|
10075
10117
|
{
|
|
10076
10118
|
type: "function",
|
|
10077
|
-
name: "
|
|
10119
|
+
name: "isUserRelayerEnabled",
|
|
10078
10120
|
constant: true,
|
|
10079
10121
|
stateMutability: "view",
|
|
10080
10122
|
payable: false,
|
|
10081
|
-
inputs: [
|
|
10123
|
+
inputs: [
|
|
10124
|
+
{
|
|
10125
|
+
type: "address",
|
|
10126
|
+
name: "account"
|
|
10127
|
+
},
|
|
10128
|
+
{
|
|
10129
|
+
type: "address",
|
|
10130
|
+
name: "relayer"
|
|
10131
|
+
}
|
|
10132
|
+
],
|
|
10082
10133
|
outputs: [
|
|
10083
10134
|
{
|
|
10084
|
-
type: "
|
|
10135
|
+
type: "bool"
|
|
10085
10136
|
}
|
|
10086
10137
|
]
|
|
10087
10138
|
},
|
|
@@ -10190,32 +10241,6 @@ var Forwarder_default = [
|
|
|
10190
10241
|
}
|
|
10191
10242
|
]
|
|
10192
10243
|
},
|
|
10193
|
-
{
|
|
10194
|
-
type: "function",
|
|
10195
|
-
name: "relayFee",
|
|
10196
|
-
constant: true,
|
|
10197
|
-
stateMutability: "view",
|
|
10198
|
-
payable: false,
|
|
10199
|
-
inputs: [],
|
|
10200
|
-
outputs: [
|
|
10201
|
-
{
|
|
10202
|
-
type: "uint256"
|
|
10203
|
-
}
|
|
10204
|
-
]
|
|
10205
|
-
},
|
|
10206
|
-
{
|
|
10207
|
-
type: "function",
|
|
10208
|
-
name: "relayGas",
|
|
10209
|
-
constant: true,
|
|
10210
|
-
stateMutability: "view",
|
|
10211
|
-
payable: false,
|
|
10212
|
-
inputs: [],
|
|
10213
|
-
outputs: [
|
|
10214
|
-
{
|
|
10215
|
-
type: "uint256"
|
|
10216
|
-
}
|
|
10217
|
-
]
|
|
10218
|
-
},
|
|
10219
10244
|
{
|
|
10220
10245
|
type: "function",
|
|
10221
10246
|
name: "removeAllowedTarget",
|
|
@@ -10244,30 +10269,13 @@ var Forwarder_default = [
|
|
|
10244
10269
|
},
|
|
10245
10270
|
{
|
|
10246
10271
|
type: "function",
|
|
10247
|
-
name: "
|
|
10248
|
-
constant: false,
|
|
10249
|
-
payable: false,
|
|
10250
|
-
inputs: [
|
|
10251
|
-
{
|
|
10252
|
-
type: "uint256",
|
|
10253
|
-
name: "_maxRelayFee"
|
|
10254
|
-
}
|
|
10255
|
-
],
|
|
10256
|
-
outputs: []
|
|
10257
|
-
},
|
|
10258
|
-
{
|
|
10259
|
-
type: "function",
|
|
10260
|
-
name: "updateRelayInfo",
|
|
10272
|
+
name: "updateEquilibriumGas",
|
|
10261
10273
|
constant: false,
|
|
10262
10274
|
payable: false,
|
|
10263
10275
|
inputs: [
|
|
10264
10276
|
{
|
|
10265
10277
|
type: "uint256",
|
|
10266
|
-
name: "
|
|
10267
|
-
},
|
|
10268
|
-
{
|
|
10269
|
-
type: "uint256",
|
|
10270
|
-
name: "_relayGas"
|
|
10278
|
+
name: "_equilibriumGas"
|
|
10271
10279
|
}
|
|
10272
10280
|
],
|
|
10273
10281
|
outputs: []
|
|
@@ -19151,9 +19159,14 @@ var Utils = class {
|
|
|
19151
19159
|
}
|
|
19152
19160
|
}
|
|
19153
19161
|
async checkSeamlessGas(userAddress, chainId) {
|
|
19154
|
-
const forwarderContract = await getForwarderContract(chainId);
|
|
19155
|
-
const relayFee = await forwarderContract.getRelayFee();
|
|
19156
19162
|
const provider = await getJSONProvider(chainId);
|
|
19163
|
+
const marketManagerContract = new import_ethers25.ethers.Contract(
|
|
19164
|
+
getContractAddressByChainId(chainId).MARKET_MANAGER,
|
|
19165
|
+
MarketManager_default,
|
|
19166
|
+
provider
|
|
19167
|
+
);
|
|
19168
|
+
const forwardFeeToken = executeAddressByChainId(chainId);
|
|
19169
|
+
const relayFee = await marketManagerContract.getRelayFee(forwardFeeToken);
|
|
19157
19170
|
const contractAddress = getContractAddressByChainId(chainId);
|
|
19158
19171
|
const erc20Contract = new import_ethers25.ethers.Contract(
|
|
19159
19172
|
contractAddress.ERC20,
|
|
@@ -20660,408 +20673,6 @@ var getEIP712Domain = async (contract) => {
|
|
|
20660
20673
|
|
|
20661
20674
|
// src/manager/seamless/index.ts
|
|
20662
20675
|
var import_bytes = require("@ethersproject/bytes");
|
|
20663
|
-
|
|
20664
|
-
// src/abi/TradingRouter.json
|
|
20665
|
-
var TradingRouter_default = [
|
|
20666
|
-
{
|
|
20667
|
-
type: "error",
|
|
20668
|
-
name: "AddressEmptyCode",
|
|
20669
|
-
inputs: [
|
|
20670
|
-
{
|
|
20671
|
-
type: "address",
|
|
20672
|
-
name: "target"
|
|
20673
|
-
}
|
|
20674
|
-
]
|
|
20675
|
-
},
|
|
20676
|
-
{
|
|
20677
|
-
type: "error",
|
|
20678
|
-
name: "DesignatedTokenMismatch",
|
|
20679
|
-
inputs: [
|
|
20680
|
-
{
|
|
20681
|
-
type: "address",
|
|
20682
|
-
name: "collectToken"
|
|
20683
|
-
},
|
|
20684
|
-
{
|
|
20685
|
-
type: "address",
|
|
20686
|
-
name: "designatedToken"
|
|
20687
|
-
}
|
|
20688
|
-
]
|
|
20689
|
-
},
|
|
20690
|
-
{
|
|
20691
|
-
type: "error",
|
|
20692
|
-
name: "ERC1967InvalidImplementation",
|
|
20693
|
-
inputs: [
|
|
20694
|
-
{
|
|
20695
|
-
type: "address",
|
|
20696
|
-
name: "implementation"
|
|
20697
|
-
}
|
|
20698
|
-
]
|
|
20699
|
-
},
|
|
20700
|
-
{
|
|
20701
|
-
type: "error",
|
|
20702
|
-
name: "ERC1967NonPayable",
|
|
20703
|
-
inputs: []
|
|
20704
|
-
},
|
|
20705
|
-
{
|
|
20706
|
-
type: "error",
|
|
20707
|
-
name: "FailedCall",
|
|
20708
|
-
inputs: []
|
|
20709
|
-
},
|
|
20710
|
-
{
|
|
20711
|
-
type: "error",
|
|
20712
|
-
name: "InvalidInitialization",
|
|
20713
|
-
inputs: []
|
|
20714
|
-
},
|
|
20715
|
-
{
|
|
20716
|
-
type: "error",
|
|
20717
|
-
name: "NotActiveBroker",
|
|
20718
|
-
inputs: [
|
|
20719
|
-
{
|
|
20720
|
-
type: "address",
|
|
20721
|
-
name: "broker"
|
|
20722
|
-
}
|
|
20723
|
-
]
|
|
20724
|
-
},
|
|
20725
|
-
{
|
|
20726
|
-
type: "error",
|
|
20727
|
-
name: "NotAddressManager",
|
|
20728
|
-
inputs: []
|
|
20729
|
-
},
|
|
20730
|
-
{
|
|
20731
|
-
type: "error",
|
|
20732
|
-
name: "NotDependencyManager",
|
|
20733
|
-
inputs: []
|
|
20734
|
-
},
|
|
20735
|
-
{
|
|
20736
|
-
type: "error",
|
|
20737
|
-
name: "NotForwardAllowedTarget",
|
|
20738
|
-
inputs: [
|
|
20739
|
-
{
|
|
20740
|
-
type: "address",
|
|
20741
|
-
name: "from"
|
|
20742
|
-
}
|
|
20743
|
-
]
|
|
20744
|
-
},
|
|
20745
|
-
{
|
|
20746
|
-
type: "error",
|
|
20747
|
-
name: "NotInitializing",
|
|
20748
|
-
inputs: []
|
|
20749
|
-
},
|
|
20750
|
-
{
|
|
20751
|
-
type: "error",
|
|
20752
|
-
name: "NotProxyAdmin",
|
|
20753
|
-
inputs: []
|
|
20754
|
-
},
|
|
20755
|
-
{
|
|
20756
|
-
type: "error",
|
|
20757
|
-
name: "PermissionDenied",
|
|
20758
|
-
inputs: [
|
|
20759
|
-
{
|
|
20760
|
-
type: "address",
|
|
20761
|
-
name: "caller"
|
|
20762
|
-
},
|
|
20763
|
-
{
|
|
20764
|
-
type: "address",
|
|
20765
|
-
name: "target"
|
|
20766
|
-
}
|
|
20767
|
-
]
|
|
20768
|
-
},
|
|
20769
|
-
{
|
|
20770
|
-
type: "error",
|
|
20771
|
-
name: "ReentrancyGuardReentrantCall",
|
|
20772
|
-
inputs: []
|
|
20773
|
-
},
|
|
20774
|
-
{
|
|
20775
|
-
type: "error",
|
|
20776
|
-
name: "SafeERC20FailedOperation",
|
|
20777
|
-
inputs: [
|
|
20778
|
-
{
|
|
20779
|
-
type: "address",
|
|
20780
|
-
name: "token"
|
|
20781
|
-
}
|
|
20782
|
-
]
|
|
20783
|
-
},
|
|
20784
|
-
{
|
|
20785
|
-
type: "error",
|
|
20786
|
-
name: "UUPSUnauthorizedCallContext",
|
|
20787
|
-
inputs: []
|
|
20788
|
-
},
|
|
20789
|
-
{
|
|
20790
|
-
type: "error",
|
|
20791
|
-
name: "UUPSUnsupportedProxiableUUID",
|
|
20792
|
-
inputs: [
|
|
20793
|
-
{
|
|
20794
|
-
type: "bytes32",
|
|
20795
|
-
name: "slot"
|
|
20796
|
-
}
|
|
20797
|
-
]
|
|
20798
|
-
},
|
|
20799
|
-
{
|
|
20800
|
-
type: "event",
|
|
20801
|
-
anonymous: false,
|
|
20802
|
-
name: "Initialized",
|
|
20803
|
-
inputs: [
|
|
20804
|
-
{
|
|
20805
|
-
type: "uint64",
|
|
20806
|
-
name: "version",
|
|
20807
|
-
indexed: false
|
|
20808
|
-
}
|
|
20809
|
-
]
|
|
20810
|
-
},
|
|
20811
|
-
{
|
|
20812
|
-
type: "event",
|
|
20813
|
-
anonymous: false,
|
|
20814
|
-
name: "Upgraded",
|
|
20815
|
-
inputs: [
|
|
20816
|
-
{
|
|
20817
|
-
type: "address",
|
|
20818
|
-
name: "implementation",
|
|
20819
|
-
indexed: true
|
|
20820
|
-
}
|
|
20821
|
-
]
|
|
20822
|
-
},
|
|
20823
|
-
{
|
|
20824
|
-
type: "function",
|
|
20825
|
-
name: "UPGRADE_INTERFACE_VERSION",
|
|
20826
|
-
constant: true,
|
|
20827
|
-
stateMutability: "view",
|
|
20828
|
-
payable: false,
|
|
20829
|
-
inputs: [],
|
|
20830
|
-
outputs: [
|
|
20831
|
-
{
|
|
20832
|
-
type: "string"
|
|
20833
|
-
}
|
|
20834
|
-
]
|
|
20835
|
-
},
|
|
20836
|
-
{
|
|
20837
|
-
type: "function",
|
|
20838
|
-
name: "__ERC2771ContextUpgradeable_init",
|
|
20839
|
-
constant: false,
|
|
20840
|
-
payable: false,
|
|
20841
|
-
inputs: [
|
|
20842
|
-
{
|
|
20843
|
-
type: "address",
|
|
20844
|
-
name: "trustedForwarder_"
|
|
20845
|
-
}
|
|
20846
|
-
],
|
|
20847
|
-
outputs: []
|
|
20848
|
-
},
|
|
20849
|
-
{
|
|
20850
|
-
type: "function",
|
|
20851
|
-
name: "collectExecutionFee",
|
|
20852
|
-
constant: false,
|
|
20853
|
-
payable: false,
|
|
20854
|
-
inputs: [
|
|
20855
|
-
{
|
|
20856
|
-
type: "uint8",
|
|
20857
|
-
name: "source"
|
|
20858
|
-
},
|
|
20859
|
-
{
|
|
20860
|
-
type: "bytes",
|
|
20861
|
-
name: "data"
|
|
20862
|
-
}
|
|
20863
|
-
],
|
|
20864
|
-
outputs: []
|
|
20865
|
-
},
|
|
20866
|
-
{
|
|
20867
|
-
type: "function",
|
|
20868
|
-
name: "collectForwardFeeIfNecessary",
|
|
20869
|
-
constant: false,
|
|
20870
|
-
payable: false,
|
|
20871
|
-
inputs: [
|
|
20872
|
-
{
|
|
20873
|
-
type: "uint8",
|
|
20874
|
-
name: "source"
|
|
20875
|
-
},
|
|
20876
|
-
{
|
|
20877
|
-
type: "bytes",
|
|
20878
|
-
name: "data"
|
|
20879
|
-
}
|
|
20880
|
-
],
|
|
20881
|
-
outputs: []
|
|
20882
|
-
},
|
|
20883
|
-
{
|
|
20884
|
-
type: "function",
|
|
20885
|
-
name: "depositFor",
|
|
20886
|
-
constant: false,
|
|
20887
|
-
payable: false,
|
|
20888
|
-
inputs: [
|
|
20889
|
-
{
|
|
20890
|
-
type: "address",
|
|
20891
|
-
name: "user"
|
|
20892
|
-
},
|
|
20893
|
-
{
|
|
20894
|
-
type: "address",
|
|
20895
|
-
name: "token"
|
|
20896
|
-
},
|
|
20897
|
-
{
|
|
20898
|
-
type: "uint256",
|
|
20899
|
-
name: "amount"
|
|
20900
|
-
}
|
|
20901
|
-
],
|
|
20902
|
-
outputs: []
|
|
20903
|
-
},
|
|
20904
|
-
{
|
|
20905
|
-
type: "function",
|
|
20906
|
-
name: "depositToAccount",
|
|
20907
|
-
constant: false,
|
|
20908
|
-
payable: false,
|
|
20909
|
-
inputs: [
|
|
20910
|
-
{
|
|
20911
|
-
type: "address",
|
|
20912
|
-
name: "recipient"
|
|
20913
|
-
},
|
|
20914
|
-
{
|
|
20915
|
-
type: "address",
|
|
20916
|
-
name: "token"
|
|
20917
|
-
},
|
|
20918
|
-
{
|
|
20919
|
-
type: "uint256",
|
|
20920
|
-
name: "amount"
|
|
20921
|
-
}
|
|
20922
|
-
],
|
|
20923
|
-
outputs: []
|
|
20924
|
-
},
|
|
20925
|
-
{
|
|
20926
|
-
type: "function",
|
|
20927
|
-
name: "getAddressManager",
|
|
20928
|
-
constant: true,
|
|
20929
|
-
stateMutability: "view",
|
|
20930
|
-
payable: false,
|
|
20931
|
-
inputs: [],
|
|
20932
|
-
outputs: [
|
|
20933
|
-
{
|
|
20934
|
-
type: "address"
|
|
20935
|
-
}
|
|
20936
|
-
]
|
|
20937
|
-
},
|
|
20938
|
-
{
|
|
20939
|
-
type: "function",
|
|
20940
|
-
name: "getDependencyAddress",
|
|
20941
|
-
constant: true,
|
|
20942
|
-
stateMutability: "view",
|
|
20943
|
-
payable: false,
|
|
20944
|
-
inputs: [
|
|
20945
|
-
{
|
|
20946
|
-
type: "bytes32",
|
|
20947
|
-
name: "identifier"
|
|
20948
|
-
}
|
|
20949
|
-
],
|
|
20950
|
-
outputs: [
|
|
20951
|
-
{
|
|
20952
|
-
type: "address"
|
|
20953
|
-
}
|
|
20954
|
-
]
|
|
20955
|
-
},
|
|
20956
|
-
{
|
|
20957
|
-
type: "function",
|
|
20958
|
-
name: "getImplementation",
|
|
20959
|
-
constant: true,
|
|
20960
|
-
stateMutability: "view",
|
|
20961
|
-
payable: false,
|
|
20962
|
-
inputs: [],
|
|
20963
|
-
outputs: [
|
|
20964
|
-
{
|
|
20965
|
-
type: "address"
|
|
20966
|
-
}
|
|
20967
|
-
]
|
|
20968
|
-
},
|
|
20969
|
-
{
|
|
20970
|
-
type: "function",
|
|
20971
|
-
name: "initialize",
|
|
20972
|
-
constant: false,
|
|
20973
|
-
payable: false,
|
|
20974
|
-
inputs: [
|
|
20975
|
-
{
|
|
20976
|
-
type: "address",
|
|
20977
|
-
name: "addressManager"
|
|
20978
|
-
}
|
|
20979
|
-
],
|
|
20980
|
-
outputs: []
|
|
20981
|
-
},
|
|
20982
|
-
{
|
|
20983
|
-
type: "function",
|
|
20984
|
-
name: "isTrustedForwarder",
|
|
20985
|
-
constant: true,
|
|
20986
|
-
stateMutability: "view",
|
|
20987
|
-
payable: false,
|
|
20988
|
-
inputs: [
|
|
20989
|
-
{
|
|
20990
|
-
type: "address",
|
|
20991
|
-
name: "forwarder"
|
|
20992
|
-
}
|
|
20993
|
-
],
|
|
20994
|
-
outputs: [
|
|
20995
|
-
{
|
|
20996
|
-
type: "bool"
|
|
20997
|
-
}
|
|
20998
|
-
]
|
|
20999
|
-
},
|
|
21000
|
-
{
|
|
21001
|
-
type: "function",
|
|
21002
|
-
name: "proxiableUUID",
|
|
21003
|
-
constant: true,
|
|
21004
|
-
stateMutability: "view",
|
|
21005
|
-
payable: false,
|
|
21006
|
-
inputs: [],
|
|
21007
|
-
outputs: [
|
|
21008
|
-
{
|
|
21009
|
-
type: "bytes32"
|
|
21010
|
-
}
|
|
21011
|
-
]
|
|
21012
|
-
},
|
|
21013
|
-
{
|
|
21014
|
-
type: "function",
|
|
21015
|
-
name: "trustedForwarder",
|
|
21016
|
-
constant: true,
|
|
21017
|
-
stateMutability: "view",
|
|
21018
|
-
payable: false,
|
|
21019
|
-
inputs: [],
|
|
21020
|
-
outputs: [
|
|
21021
|
-
{
|
|
21022
|
-
type: "address"
|
|
21023
|
-
}
|
|
21024
|
-
]
|
|
21025
|
-
},
|
|
21026
|
-
{
|
|
21027
|
-
type: "function",
|
|
21028
|
-
name: "upgradeTo",
|
|
21029
|
-
constant: false,
|
|
21030
|
-
stateMutability: "payable",
|
|
21031
|
-
payable: true,
|
|
21032
|
-
inputs: [
|
|
21033
|
-
{
|
|
21034
|
-
type: "address",
|
|
21035
|
-
name: "newImplementation"
|
|
21036
|
-
},
|
|
21037
|
-
{
|
|
21038
|
-
type: "bytes",
|
|
21039
|
-
name: "data"
|
|
21040
|
-
}
|
|
21041
|
-
],
|
|
21042
|
-
outputs: []
|
|
21043
|
-
},
|
|
21044
|
-
{
|
|
21045
|
-
type: "function",
|
|
21046
|
-
name: "upgradeToAndCall",
|
|
21047
|
-
constant: false,
|
|
21048
|
-
stateMutability: "payable",
|
|
21049
|
-
payable: true,
|
|
21050
|
-
inputs: [
|
|
21051
|
-
{
|
|
21052
|
-
type: "address",
|
|
21053
|
-
name: "newImplementation"
|
|
21054
|
-
},
|
|
21055
|
-
{
|
|
21056
|
-
type: "bytes",
|
|
21057
|
-
name: "data"
|
|
21058
|
-
}
|
|
21059
|
-
],
|
|
21060
|
-
outputs: []
|
|
21061
|
-
}
|
|
21062
|
-
];
|
|
21063
|
-
|
|
21064
|
-
// src/manager/seamless/index.ts
|
|
21065
20676
|
var contractTypes = {
|
|
21066
20677
|
ForwardRequest: [
|
|
21067
20678
|
{ name: "from", type: "address" },
|
|
@@ -21149,11 +20760,6 @@ var Seamless = class {
|
|
|
21149
20760
|
}
|
|
21150
20761
|
const contractAddress = getContractAddressByChainId(chainId);
|
|
21151
20762
|
const masterAddress = await config.signer.getAddress();
|
|
21152
|
-
const tradingRouterContract = new import_ethers27.ethers.Contract(
|
|
21153
|
-
contractAddress.TRADING_ROUTER,
|
|
21154
|
-
TradingRouter_default,
|
|
21155
|
-
config.signer
|
|
21156
|
-
);
|
|
21157
20763
|
const erc20Contract = new import_ethers27.ethers.Contract(
|
|
21158
20764
|
contractAddress.ERC20,
|
|
21159
20765
|
ERC20Token_default,
|
|
@@ -21163,7 +20769,7 @@ var Seamless = class {
|
|
|
21163
20769
|
const nonces = await erc20Contract.nonces(masterAddress);
|
|
21164
20770
|
const tradingRouterSignPermit = await signPermit(
|
|
21165
20771
|
config.signer,
|
|
21166
|
-
|
|
20772
|
+
erc20Contract,
|
|
21167
20773
|
masterAddress,
|
|
21168
20774
|
contractAddress.TRADING_ROUTER,
|
|
21169
20775
|
import_ethers27.ethers.MaxUint256.toString(),
|
|
@@ -21182,6 +20788,7 @@ var Seamless = class {
|
|
|
21182
20788
|
};
|
|
21183
20789
|
return [tradingRouterPermitParams];
|
|
21184
20790
|
} catch (error) {
|
|
20791
|
+
console.log("error-->", error);
|
|
21185
20792
|
throw new MyxSDKError("INVALID_PRIVATE_KEY" /* InvalidPrivateKey */, "Invalid private key generated");
|
|
21186
20793
|
}
|
|
21187
20794
|
}
|
|
@@ -21219,11 +20826,17 @@ var Seamless = class {
|
|
|
21219
20826
|
async authorizeSeamlessAccount({ approve: approve2, seamlessAddress, chainId }) {
|
|
21220
20827
|
const config = this.configManager.getConfig();
|
|
21221
20828
|
const masterAddress = await config.signer?.getAddress() ?? "";
|
|
20829
|
+
const provider = await getSignerProvider(chainId);
|
|
21222
20830
|
if (approve2) {
|
|
21223
20831
|
const balanceRes = await this.account.getWalletQuoteTokenBalance(chainId, masterAddress);
|
|
21224
20832
|
const balance = balanceRes.data;
|
|
21225
|
-
const
|
|
21226
|
-
|
|
20833
|
+
const marketManagerContract = new import_ethers27.ethers.Contract(
|
|
20834
|
+
getContractAddressByChainId(chainId).MARKET_MANAGER,
|
|
20835
|
+
MarketManager_default,
|
|
20836
|
+
provider
|
|
20837
|
+
);
|
|
20838
|
+
const forwardFeeToken = executeAddressByChainId(chainId);
|
|
20839
|
+
const pledgeFee = await marketManagerContract.getForwardFeeByToken(forwardFeeToken);
|
|
21227
20840
|
const gasFee = BigInt(pledgeFee) * BigInt(FORWARD_PLEDGE_FEE_RADIO);
|
|
21228
20841
|
if (gasFee > 0 && gasFee > BigInt(balance)) {
|
|
21229
20842
|
throw new MyxSDKError("INSUFFICIENT_BALANCE" /* InsufficientBalance */, "Insufficient balance");
|