@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.
Files changed (3) hide show
  1. package/dist/index.js +147 -534
  2. package/dist/index.mjs +147 -534
  3. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1775,7 +1775,7 @@ var RotationProvider = class extends BaseProvider {
1775
1775
  // package.json
1776
1776
  var package_default = {
1777
1777
  name: "@myx-trade/sdk",
1778
- version: "0.1.246",
1778
+ version: "0.1.247",
1779
1779
  private: false,
1780
1780
  publishConfig: {
1781
1781
  access: "public"
@@ -9250,6 +9250,24 @@ var Forwarder_default = [
9250
9250
  name: "InvalidInitialization",
9251
9251
  inputs: []
9252
9252
  },
9253
+ {
9254
+ type: "error",
9255
+ name: "MismatchExecuteFee",
9256
+ inputs: [
9257
+ {
9258
+ type: "uint256",
9259
+ name: "balanceBefore"
9260
+ },
9261
+ {
9262
+ type: "uint256",
9263
+ name: "balanceAfter"
9264
+ },
9265
+ {
9266
+ type: "uint256",
9267
+ name: "expected"
9268
+ }
9269
+ ]
9270
+ },
9253
9271
  {
9254
9272
  type: "error",
9255
9273
  name: "MismatchedSender",
@@ -9326,13 +9344,8 @@ var Forwarder_default = [
9326
9344
  },
9327
9345
  {
9328
9346
  type: "error",
9329
- name: "SafeERC20FailedOperation",
9330
- inputs: [
9331
- {
9332
- type: "address",
9333
- name: "token"
9334
- }
9335
- ]
9347
+ name: "RemoveRelayerFailed",
9348
+ inputs: []
9336
9349
  },
9337
9350
  {
9338
9351
  type: "error",
@@ -9361,6 +9374,28 @@ var Forwarder_default = [
9361
9374
  }
9362
9375
  ]
9363
9376
  },
9377
+ {
9378
+ type: "event",
9379
+ anonymous: false,
9380
+ name: "ChargeForwardFee",
9381
+ inputs: [
9382
+ {
9383
+ type: "address",
9384
+ name: "account",
9385
+ indexed: false
9386
+ },
9387
+ {
9388
+ type: "address",
9389
+ name: "feeToken",
9390
+ indexed: false
9391
+ },
9392
+ {
9393
+ type: "uint256",
9394
+ name: "relayFee",
9395
+ indexed: false
9396
+ }
9397
+ ]
9398
+ },
9364
9399
  {
9365
9400
  type: "event",
9366
9401
  anonymous: false,
@@ -9467,7 +9502,7 @@ var Forwarder_default = [
9467
9502
  {
9468
9503
  type: "event",
9469
9504
  anonymous: false,
9470
- name: "UpdateMaxRelayFee",
9505
+ name: "UpdateAcquiescentFeeToken",
9471
9506
  inputs: [
9472
9507
  {
9473
9508
  type: "address",
@@ -9475,13 +9510,13 @@ var Forwarder_default = [
9475
9510
  indexed: false
9476
9511
  },
9477
9512
  {
9478
- type: "uint256",
9479
- name: "oldMaxRelayFee",
9513
+ type: "address",
9514
+ name: "oldRelayGas",
9480
9515
  indexed: false
9481
9516
  },
9482
9517
  {
9483
- type: "uint256",
9484
- name: "newMaxRelayFee",
9518
+ type: "address",
9519
+ name: "newRelayGas",
9485
9520
  indexed: false
9486
9521
  }
9487
9522
  ]
@@ -9489,7 +9524,7 @@ var Forwarder_default = [
9489
9524
  {
9490
9525
  type: "event",
9491
9526
  anonymous: false,
9492
- name: "UpdateRelayInfo",
9527
+ name: "UpdateEquilibriumGas",
9493
9528
  inputs: [
9494
9529
  {
9495
9530
  type: "address",
@@ -9498,22 +9533,34 @@ var Forwarder_default = [
9498
9533
  },
9499
9534
  {
9500
9535
  type: "uint256",
9501
- name: "oldRelayFee",
9536
+ name: "oldRelayGas",
9502
9537
  indexed: false
9503
9538
  },
9504
9539
  {
9505
9540
  type: "uint256",
9506
- name: "newRelayFee",
9541
+ name: "newRelayGas",
9542
+ indexed: false
9543
+ }
9544
+ ]
9545
+ },
9546
+ {
9547
+ type: "event",
9548
+ anonymous: false,
9549
+ name: "UpdateMaxRelayFee",
9550
+ inputs: [
9551
+ {
9552
+ type: "address",
9553
+ name: "sender",
9507
9554
  indexed: false
9508
9555
  },
9509
9556
  {
9510
9557
  type: "uint256",
9511
- name: "oldRelayGas",
9558
+ name: "oldMaxRelayFee",
9512
9559
  indexed: false
9513
9560
  },
9514
9561
  {
9515
9562
  type: "uint256",
9516
- name: "newRelayGas",
9563
+ name: "newMaxRelayFee",
9517
9564
  indexed: false
9518
9565
  }
9519
9566
  ]
@@ -9576,6 +9623,10 @@ var Forwarder_default = [
9576
9623
  stateMutability: "payable",
9577
9624
  payable: true,
9578
9625
  inputs: [
9626
+ {
9627
+ type: "address",
9628
+ name: "forwardFeeToken"
9629
+ },
9579
9630
  {
9580
9631
  type: "tuple[]",
9581
9632
  name: "bundleParams",
@@ -9651,6 +9702,19 @@ var Forwarder_default = [
9651
9702
  }
9652
9703
  ]
9653
9704
  },
9705
+ {
9706
+ type: "function",
9707
+ name: "equilibriumGas",
9708
+ constant: true,
9709
+ stateMutability: "view",
9710
+ payable: false,
9711
+ inputs: [],
9712
+ outputs: [
9713
+ {
9714
+ type: "uint256"
9715
+ }
9716
+ ]
9717
+ },
9654
9718
  {
9655
9719
  type: "function",
9656
9720
  name: "execute",
@@ -9691,6 +9755,10 @@ var Forwarder_default = [
9691
9755
  name: "signature"
9692
9756
  }
9693
9757
  ]
9758
+ },
9759
+ {
9760
+ type: "address",
9761
+ name: "masterAccount"
9694
9762
  }
9695
9763
  ],
9696
9764
  outputs: []
@@ -9736,6 +9804,10 @@ var Forwarder_default = [
9736
9804
  }
9737
9805
  ]
9738
9806
  },
9807
+ {
9808
+ type: "address",
9809
+ name: "masterAccount"
9810
+ },
9739
9811
  {
9740
9812
  type: "address",
9741
9813
  name: "refundReceiver"
@@ -9750,6 +9822,10 @@ var Forwarder_default = [
9750
9822
  stateMutability: "payable",
9751
9823
  payable: true,
9752
9824
  inputs: [
9825
+ {
9826
+ type: "address",
9827
+ name: "forwardFeeToken"
9828
+ },
9753
9829
  {
9754
9830
  type: "tuple",
9755
9831
  name: "params",
@@ -9789,16 +9865,11 @@ var Forwarder_default = [
9789
9865
  },
9790
9866
  {
9791
9867
  type: "function",
9792
- name: "feeToken",
9793
- constant: true,
9794
- stateMutability: "view",
9868
+ name: "exitForwardMode",
9869
+ constant: false,
9795
9870
  payable: false,
9796
9871
  inputs: [],
9797
- outputs: [
9798
- {
9799
- type: "address"
9800
- }
9801
- ]
9872
+ outputs: []
9802
9873
  },
9803
9874
  {
9804
9875
  type: "function",
@@ -9846,7 +9917,7 @@ var Forwarder_default = [
9846
9917
  },
9847
9918
  {
9848
9919
  type: "function",
9849
- name: "getFeeToken",
9920
+ name: "getDesignatedToken",
9850
9921
  constant: true,
9851
9922
  stateMutability: "view",
9852
9923
  payable: false,
@@ -9859,71 +9930,58 @@ var Forwarder_default = [
9859
9930
  },
9860
9931
  {
9861
9932
  type: "function",
9862
- name: "getImplementation",
9933
+ name: "getEquilibriumGas",
9863
9934
  constant: true,
9864
9935
  stateMutability: "view",
9865
9936
  payable: false,
9866
9937
  inputs: [],
9867
9938
  outputs: [
9868
9939
  {
9869
- type: "address"
9940
+ type: "uint256"
9870
9941
  }
9871
9942
  ]
9872
9943
  },
9873
9944
  {
9874
9945
  type: "function",
9875
- name: "getMaxRelayFee",
9946
+ name: "getImplementation",
9876
9947
  constant: true,
9877
9948
  stateMutability: "view",
9878
9949
  payable: false,
9879
9950
  inputs: [],
9880
9951
  outputs: [
9881
9952
  {
9882
- type: "uint256"
9953
+ type: "address"
9883
9954
  }
9884
9955
  ]
9885
9956
  },
9886
9957
  {
9887
9958
  type: "function",
9888
- name: "getRelayFee",
9959
+ name: "getUserRelayers",
9889
9960
  constant: true,
9890
9961
  stateMutability: "view",
9891
9962
  payable: false,
9892
- inputs: [],
9893
- outputs: [
9963
+ inputs: [
9894
9964
  {
9895
- type: "uint256"
9965
+ type: "address",
9966
+ name: "account"
9896
9967
  }
9897
- ]
9898
- },
9899
- {
9900
- type: "function",
9901
- name: "getRelayGas",
9902
- constant: true,
9903
- stateMutability: "view",
9904
- payable: false,
9905
- inputs: [],
9968
+ ],
9906
9969
  outputs: [
9907
9970
  {
9908
- type: "uint256"
9971
+ type: "address[]"
9909
9972
  }
9910
9973
  ]
9911
9974
  },
9912
9975
  {
9913
9976
  type: "function",
9914
- name: "getUserRelayers",
9977
+ name: "inForwardMode",
9915
9978
  constant: true,
9916
9979
  stateMutability: "view",
9917
9980
  payable: false,
9918
- inputs: [
9919
- {
9920
- type: "address",
9921
- name: "account"
9922
- }
9923
- ],
9981
+ inputs: [],
9924
9982
  outputs: [
9925
9983
  {
9926
- type: "address[]"
9984
+ type: "bool"
9927
9985
  }
9928
9986
  ]
9929
9987
  },
@@ -9937,35 +9995,23 @@ var Forwarder_default = [
9937
9995
  type: "address",
9938
9996
  name: "addressManager"
9939
9997
  },
9940
- {
9941
- type: "address",
9942
- name: "_feeToken"
9943
- },
9944
- {
9945
- type: "uint256",
9946
- name: "_relayFee"
9947
- },
9948
- {
9949
- type: "uint256",
9950
- name: "_relayGas"
9951
- },
9952
9998
  {
9953
9999
  type: "uint256",
9954
- name: "_maxRelayFee"
10000
+ name: "_equilibriumGas"
9955
10001
  }
9956
10002
  ],
9957
10003
  outputs: []
9958
10004
  },
9959
10005
  {
9960
10006
  type: "function",
9961
- name: "isTrustedForwarder",
10007
+ name: "isAllowedTargets",
9962
10008
  constant: true,
9963
10009
  stateMutability: "view",
9964
10010
  payable: false,
9965
10011
  inputs: [
9966
10012
  {
9967
10013
  type: "address",
9968
- name: "forwarder"
10014
+ name: "contractAddr"
9969
10015
  }
9970
10016
  ],
9971
10017
  outputs: [
@@ -9976,18 +10022,14 @@ var Forwarder_default = [
9976
10022
  },
9977
10023
  {
9978
10024
  type: "function",
9979
- name: "isUserRelayerEnabled",
10025
+ name: "isTrustedForwarder",
9980
10026
  constant: true,
9981
10027
  stateMutability: "view",
9982
10028
  payable: false,
9983
10029
  inputs: [
9984
10030
  {
9985
10031
  type: "address",
9986
- name: "account"
9987
- },
9988
- {
9989
- type: "address",
9990
- name: "relayer"
10032
+ name: "forwarder"
9991
10033
  }
9992
10034
  ],
9993
10035
  outputs: [
@@ -9998,14 +10040,23 @@ var Forwarder_default = [
9998
10040
  },
9999
10041
  {
10000
10042
  type: "function",
10001
- name: "maxRelayFee",
10043
+ name: "isUserRelayerEnabled",
10002
10044
  constant: true,
10003
10045
  stateMutability: "view",
10004
10046
  payable: false,
10005
- inputs: [],
10047
+ inputs: [
10048
+ {
10049
+ type: "address",
10050
+ name: "account"
10051
+ },
10052
+ {
10053
+ type: "address",
10054
+ name: "relayer"
10055
+ }
10056
+ ],
10006
10057
  outputs: [
10007
10058
  {
10008
- type: "uint256"
10059
+ type: "bool"
10009
10060
  }
10010
10061
  ]
10011
10062
  },
@@ -10114,32 +10165,6 @@ var Forwarder_default = [
10114
10165
  }
10115
10166
  ]
10116
10167
  },
10117
- {
10118
- type: "function",
10119
- name: "relayFee",
10120
- constant: true,
10121
- stateMutability: "view",
10122
- payable: false,
10123
- inputs: [],
10124
- outputs: [
10125
- {
10126
- type: "uint256"
10127
- }
10128
- ]
10129
- },
10130
- {
10131
- type: "function",
10132
- name: "relayGas",
10133
- constant: true,
10134
- stateMutability: "view",
10135
- payable: false,
10136
- inputs: [],
10137
- outputs: [
10138
- {
10139
- type: "uint256"
10140
- }
10141
- ]
10142
- },
10143
10168
  {
10144
10169
  type: "function",
10145
10170
  name: "removeAllowedTarget",
@@ -10168,30 +10193,13 @@ var Forwarder_default = [
10168
10193
  },
10169
10194
  {
10170
10195
  type: "function",
10171
- name: "updateMaxRelayFee",
10172
- constant: false,
10173
- payable: false,
10174
- inputs: [
10175
- {
10176
- type: "uint256",
10177
- name: "_maxRelayFee"
10178
- }
10179
- ],
10180
- outputs: []
10181
- },
10182
- {
10183
- type: "function",
10184
- name: "updateRelayInfo",
10196
+ name: "updateEquilibriumGas",
10185
10197
  constant: false,
10186
10198
  payable: false,
10187
10199
  inputs: [
10188
10200
  {
10189
10201
  type: "uint256",
10190
- name: "_relayFee"
10191
- },
10192
- {
10193
- type: "uint256",
10194
- name: "_relayGas"
10202
+ name: "_equilibriumGas"
10195
10203
  }
10196
10204
  ],
10197
10205
  outputs: []
@@ -19075,9 +19083,14 @@ var Utils = class {
19075
19083
  }
19076
19084
  }
19077
19085
  async checkSeamlessGas(userAddress, chainId) {
19078
- const forwarderContract = await getForwarderContract(chainId);
19079
- const relayFee = await forwarderContract.getRelayFee();
19080
19086
  const provider = await getJSONProvider(chainId);
19087
+ const marketManagerContract = new ethers7.Contract(
19088
+ getContractAddressByChainId(chainId).MARKET_MANAGER,
19089
+ MarketManager_default,
19090
+ provider
19091
+ );
19092
+ const forwardFeeToken = executeAddressByChainId(chainId);
19093
+ const relayFee = await marketManagerContract.getRelayFee(forwardFeeToken);
19081
19094
  const contractAddress = getContractAddressByChainId(chainId);
19082
19095
  const erc20Contract = new ethers7.Contract(
19083
19096
  contractAddress.ERC20,
@@ -20584,408 +20597,6 @@ var getEIP712Domain = async (contract) => {
20584
20597
 
20585
20598
  // src/manager/seamless/index.ts
20586
20599
  import { splitSignature } from "@ethersproject/bytes";
20587
-
20588
- // src/abi/TradingRouter.json
20589
- var TradingRouter_default = [
20590
- {
20591
- type: "error",
20592
- name: "AddressEmptyCode",
20593
- inputs: [
20594
- {
20595
- type: "address",
20596
- name: "target"
20597
- }
20598
- ]
20599
- },
20600
- {
20601
- type: "error",
20602
- name: "DesignatedTokenMismatch",
20603
- inputs: [
20604
- {
20605
- type: "address",
20606
- name: "collectToken"
20607
- },
20608
- {
20609
- type: "address",
20610
- name: "designatedToken"
20611
- }
20612
- ]
20613
- },
20614
- {
20615
- type: "error",
20616
- name: "ERC1967InvalidImplementation",
20617
- inputs: [
20618
- {
20619
- type: "address",
20620
- name: "implementation"
20621
- }
20622
- ]
20623
- },
20624
- {
20625
- type: "error",
20626
- name: "ERC1967NonPayable",
20627
- inputs: []
20628
- },
20629
- {
20630
- type: "error",
20631
- name: "FailedCall",
20632
- inputs: []
20633
- },
20634
- {
20635
- type: "error",
20636
- name: "InvalidInitialization",
20637
- inputs: []
20638
- },
20639
- {
20640
- type: "error",
20641
- name: "NotActiveBroker",
20642
- inputs: [
20643
- {
20644
- type: "address",
20645
- name: "broker"
20646
- }
20647
- ]
20648
- },
20649
- {
20650
- type: "error",
20651
- name: "NotAddressManager",
20652
- inputs: []
20653
- },
20654
- {
20655
- type: "error",
20656
- name: "NotDependencyManager",
20657
- inputs: []
20658
- },
20659
- {
20660
- type: "error",
20661
- name: "NotForwardAllowedTarget",
20662
- inputs: [
20663
- {
20664
- type: "address",
20665
- name: "from"
20666
- }
20667
- ]
20668
- },
20669
- {
20670
- type: "error",
20671
- name: "NotInitializing",
20672
- inputs: []
20673
- },
20674
- {
20675
- type: "error",
20676
- name: "NotProxyAdmin",
20677
- inputs: []
20678
- },
20679
- {
20680
- type: "error",
20681
- name: "PermissionDenied",
20682
- inputs: [
20683
- {
20684
- type: "address",
20685
- name: "caller"
20686
- },
20687
- {
20688
- type: "address",
20689
- name: "target"
20690
- }
20691
- ]
20692
- },
20693
- {
20694
- type: "error",
20695
- name: "ReentrancyGuardReentrantCall",
20696
- inputs: []
20697
- },
20698
- {
20699
- type: "error",
20700
- name: "SafeERC20FailedOperation",
20701
- inputs: [
20702
- {
20703
- type: "address",
20704
- name: "token"
20705
- }
20706
- ]
20707
- },
20708
- {
20709
- type: "error",
20710
- name: "UUPSUnauthorizedCallContext",
20711
- inputs: []
20712
- },
20713
- {
20714
- type: "error",
20715
- name: "UUPSUnsupportedProxiableUUID",
20716
- inputs: [
20717
- {
20718
- type: "bytes32",
20719
- name: "slot"
20720
- }
20721
- ]
20722
- },
20723
- {
20724
- type: "event",
20725
- anonymous: false,
20726
- name: "Initialized",
20727
- inputs: [
20728
- {
20729
- type: "uint64",
20730
- name: "version",
20731
- indexed: false
20732
- }
20733
- ]
20734
- },
20735
- {
20736
- type: "event",
20737
- anonymous: false,
20738
- name: "Upgraded",
20739
- inputs: [
20740
- {
20741
- type: "address",
20742
- name: "implementation",
20743
- indexed: true
20744
- }
20745
- ]
20746
- },
20747
- {
20748
- type: "function",
20749
- name: "UPGRADE_INTERFACE_VERSION",
20750
- constant: true,
20751
- stateMutability: "view",
20752
- payable: false,
20753
- inputs: [],
20754
- outputs: [
20755
- {
20756
- type: "string"
20757
- }
20758
- ]
20759
- },
20760
- {
20761
- type: "function",
20762
- name: "__ERC2771ContextUpgradeable_init",
20763
- constant: false,
20764
- payable: false,
20765
- inputs: [
20766
- {
20767
- type: "address",
20768
- name: "trustedForwarder_"
20769
- }
20770
- ],
20771
- outputs: []
20772
- },
20773
- {
20774
- type: "function",
20775
- name: "collectExecutionFee",
20776
- constant: false,
20777
- payable: false,
20778
- inputs: [
20779
- {
20780
- type: "uint8",
20781
- name: "source"
20782
- },
20783
- {
20784
- type: "bytes",
20785
- name: "data"
20786
- }
20787
- ],
20788
- outputs: []
20789
- },
20790
- {
20791
- type: "function",
20792
- name: "collectForwardFeeIfNecessary",
20793
- constant: false,
20794
- payable: false,
20795
- inputs: [
20796
- {
20797
- type: "uint8",
20798
- name: "source"
20799
- },
20800
- {
20801
- type: "bytes",
20802
- name: "data"
20803
- }
20804
- ],
20805
- outputs: []
20806
- },
20807
- {
20808
- type: "function",
20809
- name: "depositFor",
20810
- constant: false,
20811
- payable: false,
20812
- inputs: [
20813
- {
20814
- type: "address",
20815
- name: "user"
20816
- },
20817
- {
20818
- type: "address",
20819
- name: "token"
20820
- },
20821
- {
20822
- type: "uint256",
20823
- name: "amount"
20824
- }
20825
- ],
20826
- outputs: []
20827
- },
20828
- {
20829
- type: "function",
20830
- name: "depositToAccount",
20831
- constant: false,
20832
- payable: false,
20833
- inputs: [
20834
- {
20835
- type: "address",
20836
- name: "recipient"
20837
- },
20838
- {
20839
- type: "address",
20840
- name: "token"
20841
- },
20842
- {
20843
- type: "uint256",
20844
- name: "amount"
20845
- }
20846
- ],
20847
- outputs: []
20848
- },
20849
- {
20850
- type: "function",
20851
- name: "getAddressManager",
20852
- constant: true,
20853
- stateMutability: "view",
20854
- payable: false,
20855
- inputs: [],
20856
- outputs: [
20857
- {
20858
- type: "address"
20859
- }
20860
- ]
20861
- },
20862
- {
20863
- type: "function",
20864
- name: "getDependencyAddress",
20865
- constant: true,
20866
- stateMutability: "view",
20867
- payable: false,
20868
- inputs: [
20869
- {
20870
- type: "bytes32",
20871
- name: "identifier"
20872
- }
20873
- ],
20874
- outputs: [
20875
- {
20876
- type: "address"
20877
- }
20878
- ]
20879
- },
20880
- {
20881
- type: "function",
20882
- name: "getImplementation",
20883
- constant: true,
20884
- stateMutability: "view",
20885
- payable: false,
20886
- inputs: [],
20887
- outputs: [
20888
- {
20889
- type: "address"
20890
- }
20891
- ]
20892
- },
20893
- {
20894
- type: "function",
20895
- name: "initialize",
20896
- constant: false,
20897
- payable: false,
20898
- inputs: [
20899
- {
20900
- type: "address",
20901
- name: "addressManager"
20902
- }
20903
- ],
20904
- outputs: []
20905
- },
20906
- {
20907
- type: "function",
20908
- name: "isTrustedForwarder",
20909
- constant: true,
20910
- stateMutability: "view",
20911
- payable: false,
20912
- inputs: [
20913
- {
20914
- type: "address",
20915
- name: "forwarder"
20916
- }
20917
- ],
20918
- outputs: [
20919
- {
20920
- type: "bool"
20921
- }
20922
- ]
20923
- },
20924
- {
20925
- type: "function",
20926
- name: "proxiableUUID",
20927
- constant: true,
20928
- stateMutability: "view",
20929
- payable: false,
20930
- inputs: [],
20931
- outputs: [
20932
- {
20933
- type: "bytes32"
20934
- }
20935
- ]
20936
- },
20937
- {
20938
- type: "function",
20939
- name: "trustedForwarder",
20940
- constant: true,
20941
- stateMutability: "view",
20942
- payable: false,
20943
- inputs: [],
20944
- outputs: [
20945
- {
20946
- type: "address"
20947
- }
20948
- ]
20949
- },
20950
- {
20951
- type: "function",
20952
- name: "upgradeTo",
20953
- constant: false,
20954
- stateMutability: "payable",
20955
- payable: true,
20956
- inputs: [
20957
- {
20958
- type: "address",
20959
- name: "newImplementation"
20960
- },
20961
- {
20962
- type: "bytes",
20963
- name: "data"
20964
- }
20965
- ],
20966
- outputs: []
20967
- },
20968
- {
20969
- type: "function",
20970
- name: "upgradeToAndCall",
20971
- constant: false,
20972
- stateMutability: "payable",
20973
- payable: true,
20974
- inputs: [
20975
- {
20976
- type: "address",
20977
- name: "newImplementation"
20978
- },
20979
- {
20980
- type: "bytes",
20981
- name: "data"
20982
- }
20983
- ],
20984
- outputs: []
20985
- }
20986
- ];
20987
-
20988
- // src/manager/seamless/index.ts
20989
20600
  var contractTypes = {
20990
20601
  ForwardRequest: [
20991
20602
  { name: "from", type: "address" },
@@ -21073,11 +20684,6 @@ var Seamless = class {
21073
20684
  }
21074
20685
  const contractAddress = getContractAddressByChainId(chainId);
21075
20686
  const masterAddress = await config.signer.getAddress();
21076
- const tradingRouterContract = new ethers9.Contract(
21077
- contractAddress.TRADING_ROUTER,
21078
- TradingRouter_default,
21079
- config.signer
21080
- );
21081
20687
  const erc20Contract = new ethers9.Contract(
21082
20688
  contractAddress.ERC20,
21083
20689
  ERC20Token_default,
@@ -21087,7 +20693,7 @@ var Seamless = class {
21087
20693
  const nonces = await erc20Contract.nonces(masterAddress);
21088
20694
  const tradingRouterSignPermit = await signPermit(
21089
20695
  config.signer,
21090
- tradingRouterContract,
20696
+ erc20Contract,
21091
20697
  masterAddress,
21092
20698
  contractAddress.TRADING_ROUTER,
21093
20699
  ethers9.MaxUint256.toString(),
@@ -21106,6 +20712,7 @@ var Seamless = class {
21106
20712
  };
21107
20713
  return [tradingRouterPermitParams];
21108
20714
  } catch (error) {
20715
+ console.log("error-->", error);
21109
20716
  throw new MyxSDKError("INVALID_PRIVATE_KEY" /* InvalidPrivateKey */, "Invalid private key generated");
21110
20717
  }
21111
20718
  }
@@ -21143,11 +20750,17 @@ var Seamless = class {
21143
20750
  async authorizeSeamlessAccount({ approve: approve2, seamlessAddress, chainId }) {
21144
20751
  const config = this.configManager.getConfig();
21145
20752
  const masterAddress = await config.signer?.getAddress() ?? "";
20753
+ const provider = await getSignerProvider(chainId);
21146
20754
  if (approve2) {
21147
20755
  const balanceRes = await this.account.getWalletQuoteTokenBalance(chainId, masterAddress);
21148
20756
  const balance = balanceRes.data;
21149
- const forwarderContract2 = await getForwarderContract(chainId);
21150
- const pledgeFee = await forwarderContract2.getRelayFee();
20757
+ const marketManagerContract = new ethers9.Contract(
20758
+ getContractAddressByChainId(chainId).MARKET_MANAGER,
20759
+ MarketManager_default,
20760
+ provider
20761
+ );
20762
+ const forwardFeeToken = executeAddressByChainId(chainId);
20763
+ const pledgeFee = await marketManagerContract.getForwardFeeByToken(forwardFeeToken);
21151
20764
  const gasFee = BigInt(pledgeFee) * BigInt(FORWARD_PLEDGE_FEE_RADIO);
21152
20765
  if (gasFee > 0 && gasFee > BigInt(balance)) {
21153
20766
  throw new MyxSDKError("INSUFFICIENT_BALANCE" /* InsufficientBalance */, "Insufficient balance");