@myx-trade/sdk 0.1.245-beta.1 → 0.1.245-beta.2

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.mjs CHANGED
@@ -1769,7 +1769,7 @@ var RotationProvider = class extends BaseProvider {
1769
1769
  // package.json
1770
1770
  var package_default = {
1771
1771
  name: "@myx-trade/sdk",
1772
- version: "0.1.245-beta.1",
1772
+ version: "0.1.245-beta.2",
1773
1773
  private: false,
1774
1774
  publishConfig: {
1775
1775
  access: "public"
@@ -5193,6 +5193,16 @@ var Broker_default = [
5193
5193
  payable: false,
5194
5194
  inputs: []
5195
5195
  },
5196
+ {
5197
+ type: "error",
5198
+ name: "AddressEmptyCode",
5199
+ inputs: [
5200
+ {
5201
+ type: "address",
5202
+ name: "target"
5203
+ }
5204
+ ]
5205
+ },
5196
5206
  {
5197
5207
  type: "error",
5198
5208
  name: "ECDSAInvalidSignature",
@@ -5218,11 +5228,31 @@ var Broker_default = [
5218
5228
  }
5219
5229
  ]
5220
5230
  },
5231
+ {
5232
+ type: "error",
5233
+ name: "ERC1967InvalidImplementation",
5234
+ inputs: [
5235
+ {
5236
+ type: "address",
5237
+ name: "implementation"
5238
+ }
5239
+ ]
5240
+ },
5241
+ {
5242
+ type: "error",
5243
+ name: "ERC1967NonPayable",
5244
+ inputs: []
5245
+ },
5221
5246
  {
5222
5247
  type: "error",
5223
5248
  name: "ExpiredFeeData",
5224
5249
  inputs: []
5225
5250
  },
5251
+ {
5252
+ type: "error",
5253
+ name: "FailedCall",
5254
+ inputs: []
5255
+ },
5226
5256
  {
5227
5257
  type: "error",
5228
5258
  name: "InvalidFeeRate",
@@ -5283,6 +5313,11 @@ var Broker_default = [
5283
5313
  name: "NotPositionOwner",
5284
5314
  inputs: []
5285
5315
  },
5316
+ {
5317
+ type: "error",
5318
+ name: "NotProxyAdmin",
5319
+ inputs: []
5320
+ },
5286
5321
  {
5287
5322
  type: "error",
5288
5323
  name: "OwnableInvalidOwner",
@@ -5332,6 +5367,21 @@ var Broker_default = [
5332
5367
  }
5333
5368
  ]
5334
5369
  },
5370
+ {
5371
+ type: "error",
5372
+ name: "UUPSUnauthorizedCallContext",
5373
+ inputs: []
5374
+ },
5375
+ {
5376
+ type: "error",
5377
+ name: "UUPSUnsupportedProxiableUUID",
5378
+ inputs: [
5379
+ {
5380
+ type: "bytes32",
5381
+ name: "slot"
5382
+ }
5383
+ ]
5384
+ },
5335
5385
  {
5336
5386
  type: "error",
5337
5387
  name: "UnsupportedAssetClass",
@@ -5460,6 +5510,40 @@ var Broker_default = [
5460
5510
  }
5461
5511
  ]
5462
5512
  },
5513
+ {
5514
+ type: "event",
5515
+ anonymous: false,
5516
+ name: "Upgraded",
5517
+ inputs: [
5518
+ {
5519
+ type: "address",
5520
+ name: "implementation",
5521
+ indexed: true
5522
+ }
5523
+ ]
5524
+ },
5525
+ {
5526
+ type: "event",
5527
+ anonymous: false,
5528
+ name: "UserFeeDataReset",
5529
+ inputs: [
5530
+ {
5531
+ type: "address",
5532
+ name: "broker",
5533
+ indexed: false
5534
+ },
5535
+ {
5536
+ type: "address",
5537
+ name: "signer",
5538
+ indexed: false
5539
+ },
5540
+ {
5541
+ type: "uint256",
5542
+ name: "epoch",
5543
+ indexed: false
5544
+ }
5545
+ ]
5546
+ },
5463
5547
  {
5464
5548
  type: "event",
5465
5549
  anonymous: false,
@@ -5480,6 +5564,11 @@ var Broker_default = [
5480
5564
  name: "user",
5481
5565
  indexed: false
5482
5566
  },
5567
+ {
5568
+ type: "uint256",
5569
+ name: "epoch",
5570
+ indexed: false
5571
+ },
5483
5572
  {
5484
5573
  type: "uint8",
5485
5574
  name: "tier",
@@ -5515,6 +5604,19 @@ var Broker_default = [
5515
5604
  }
5516
5605
  ]
5517
5606
  },
5607
+ {
5608
+ type: "function",
5609
+ name: "UPGRADE_INTERFACE_VERSION",
5610
+ constant: true,
5611
+ stateMutability: "view",
5612
+ payable: false,
5613
+ inputs: [],
5614
+ outputs: [
5615
+ {
5616
+ type: "string"
5617
+ }
5618
+ ]
5619
+ },
5518
5620
  {
5519
5621
  type: "function",
5520
5622
  name: "__ERC2771ContextUpgradeable_init",
@@ -5593,37 +5695,6 @@ var Broker_default = [
5593
5695
  }
5594
5696
  ]
5595
5697
  },
5596
- {
5597
- type: "function",
5598
- name: "adjustCollateral",
5599
- constant: false,
5600
- payable: false,
5601
- inputs: [
5602
- {
5603
- type: "tuple",
5604
- name: "depositParams",
5605
- components: [
5606
- {
5607
- type: "address",
5608
- name: "token"
5609
- },
5610
- {
5611
- type: "uint256",
5612
- name: "amount"
5613
- }
5614
- ]
5615
- },
5616
- {
5617
- type: "bytes32",
5618
- name: "positionId"
5619
- },
5620
- {
5621
- type: "int256",
5622
- name: "adjustAmount"
5623
- }
5624
- ],
5625
- outputs: []
5626
- },
5627
5698
  {
5628
5699
  type: "function",
5629
5700
  name: "batchSetSpecialFeeTiers",
@@ -5752,6 +5823,32 @@ var Broker_default = [
5752
5823
  ],
5753
5824
  outputs: []
5754
5825
  },
5826
+ {
5827
+ type: "function",
5828
+ name: "currentFeeDataEpoch",
5829
+ constant: true,
5830
+ stateMutability: "view",
5831
+ payable: false,
5832
+ inputs: [],
5833
+ outputs: [
5834
+ {
5835
+ type: "uint256"
5836
+ }
5837
+ ]
5838
+ },
5839
+ {
5840
+ type: "function",
5841
+ name: "domainSeparatorV4",
5842
+ constant: true,
5843
+ stateMutability: "view",
5844
+ payable: false,
5845
+ inputs: [],
5846
+ outputs: [
5847
+ {
5848
+ type: "bytes32"
5849
+ }
5850
+ ]
5851
+ },
5755
5852
  {
5756
5853
  type: "function",
5757
5854
  name: "eip712Domain",
@@ -5850,6 +5947,19 @@ var Broker_default = [
5850
5947
  }
5851
5948
  ]
5852
5949
  },
5950
+ {
5951
+ type: "function",
5952
+ name: "getImplementation",
5953
+ constant: true,
5954
+ stateMutability: "view",
5955
+ payable: false,
5956
+ inputs: [],
5957
+ outputs: [
5958
+ {
5959
+ type: "address"
5960
+ }
5961
+ ]
5962
+ },
5853
5963
  {
5854
5964
  type: "function",
5855
5965
  name: "getSpecialFeeTier",
@@ -5881,6 +5991,55 @@ var Broker_default = [
5881
5991
  }
5882
5992
  ]
5883
5993
  },
5994
+ {
5995
+ type: "function",
5996
+ name: "getUserFeeDataDigest",
5997
+ constant: true,
5998
+ stateMutability: "view",
5999
+ payable: false,
6000
+ inputs: [
6001
+ {
6002
+ type: "address",
6003
+ name: "user"
6004
+ },
6005
+ {
6006
+ type: "uint64",
6007
+ name: "nonce"
6008
+ },
6009
+ {
6010
+ type: "uint64",
6011
+ name: "deadline"
6012
+ },
6013
+ {
6014
+ type: "tuple",
6015
+ name: "feeData",
6016
+ components: [
6017
+ {
6018
+ type: "uint8",
6019
+ name: "tier"
6020
+ },
6021
+ {
6022
+ type: "address",
6023
+ name: "referrer"
6024
+ },
6025
+ {
6026
+ type: "uint32",
6027
+ name: "totalReferralRebatePct"
6028
+ },
6029
+ {
6030
+ type: "uint32",
6031
+ name: "referrerRebatePct"
6032
+ }
6033
+ ]
6034
+ }
6035
+ ],
6036
+ outputs: [
6037
+ {
6038
+ type: "bytes32",
6039
+ name: "digest"
6040
+ }
6041
+ ]
6042
+ },
5884
6043
  {
5885
6044
  type: "function",
5886
6045
  name: "getUserFeeRate",
@@ -6479,6 +6638,19 @@ var Broker_default = [
6479
6638
  ],
6480
6639
  outputs: []
6481
6640
  },
6641
+ {
6642
+ type: "function",
6643
+ name: "proxiableUUID",
6644
+ constant: true,
6645
+ stateMutability: "view",
6646
+ payable: false,
6647
+ inputs: [],
6648
+ outputs: [
6649
+ {
6650
+ type: "bytes32"
6651
+ }
6652
+ ]
6653
+ },
6482
6654
  {
6483
6655
  type: "function",
6484
6656
  name: "renounceOwnership",
@@ -6487,6 +6659,14 @@ var Broker_default = [
6487
6659
  inputs: [],
6488
6660
  outputs: []
6489
6661
  },
6662
+ {
6663
+ type: "function",
6664
+ name: "resetAllUserFeeData",
6665
+ constant: false,
6666
+ payable: false,
6667
+ inputs: [],
6668
+ outputs: []
6669
+ },
6490
6670
  {
6491
6671
  type: "function",
6492
6672
  name: "setSigner",
@@ -6735,56 +6915,21 @@ var Broker_default = [
6735
6915
  },
6736
6916
  {
6737
6917
  type: "function",
6738
- name: "updateFeeTiers",
6918
+ name: "updateOrder",
6739
6919
  constant: false,
6740
6920
  payable: false,
6741
6921
  inputs: [
6742
6922
  {
6743
- type: "uint8",
6744
- name: "assetClass"
6745
- },
6746
- {
6747
- type: "uint8",
6748
- name: "riskTier"
6749
- },
6750
- {
6751
- type: "uint8[]",
6752
- name: "feeTiers"
6753
- },
6754
- {
6755
- type: "tuple[]",
6756
- name: "feeRates",
6923
+ type: "tuple",
6924
+ name: "depositParams",
6757
6925
  components: [
6758
6926
  {
6759
- type: "uint32",
6760
- name: "takerFeeRate"
6927
+ type: "address",
6928
+ name: "token"
6761
6929
  },
6762
6930
  {
6763
- type: "uint32",
6764
- name: "makerFeeRate"
6765
- }
6766
- ]
6767
- }
6768
- ],
6769
- outputs: []
6770
- },
6771
- {
6772
- type: "function",
6773
- name: "updateOrder",
6774
- constant: false,
6775
- payable: false,
6776
- inputs: [
6777
- {
6778
- type: "tuple",
6779
- name: "depositParams",
6780
- components: [
6781
- {
6782
- type: "address",
6783
- name: "token"
6784
- },
6785
- {
6786
- type: "uint256",
6787
- name: "amount"
6931
+ type: "uint256",
6932
+ name: "amount"
6788
6933
  }
6789
6934
  ]
6790
6935
  },
@@ -6889,6 +7034,77 @@ var Broker_default = [
6889
7034
  ],
6890
7035
  outputs: []
6891
7036
  },
7037
+ {
7038
+ type: "function",
7039
+ name: "updateUserFeeData",
7040
+ constant: false,
7041
+ payable: false,
7042
+ inputs: [
7043
+ {
7044
+ type: "address",
7045
+ name: "user"
7046
+ },
7047
+ {
7048
+ type: "tuple",
7049
+ name: "feeData",
7050
+ components: [
7051
+ {
7052
+ type: "uint8",
7053
+ name: "tier"
7054
+ },
7055
+ {
7056
+ type: "address",
7057
+ name: "referrer"
7058
+ },
7059
+ {
7060
+ type: "uint32",
7061
+ name: "totalReferralRebatePct"
7062
+ },
7063
+ {
7064
+ type: "uint32",
7065
+ name: "referrerRebatePct"
7066
+ }
7067
+ ]
7068
+ }
7069
+ ],
7070
+ outputs: []
7071
+ },
7072
+ {
7073
+ type: "function",
7074
+ name: "upgradeTo",
7075
+ constant: false,
7076
+ stateMutability: "payable",
7077
+ payable: true,
7078
+ inputs: [
7079
+ {
7080
+ type: "address",
7081
+ name: "newImplementation"
7082
+ },
7083
+ {
7084
+ type: "bytes",
7085
+ name: "data"
7086
+ }
7087
+ ],
7088
+ outputs: []
7089
+ },
7090
+ {
7091
+ type: "function",
7092
+ name: "upgradeToAndCall",
7093
+ constant: false,
7094
+ stateMutability: "payable",
7095
+ payable: true,
7096
+ inputs: [
7097
+ {
7098
+ type: "address",
7099
+ name: "newImplementation"
7100
+ },
7101
+ {
7102
+ type: "bytes",
7103
+ name: "data"
7104
+ }
7105
+ ],
7106
+ outputs: []
7107
+ },
6892
7108
  {
6893
7109
  type: "function",
6894
7110
  name: "userFeeData",
@@ -6896,6 +7112,10 @@ var Broker_default = [
6896
7112
  stateMutability: "view",
6897
7113
  payable: false,
6898
7114
  inputs: [
7115
+ {
7116
+ type: "uint256",
7117
+ name: "userFeeDataEpoch"
7118
+ },
6899
7119
  {
6900
7120
  type: "address",
6901
7121
  name: "user"
@@ -6960,1099 +7180,7 @@ var Broker_default = [
6960
7180
  type: "uint256",
6961
7181
  name: "rebateAmount"
6962
7182
  }
6963
- ]
6964
- }
6965
- ];
6966
-
6967
- // src/abi/OrderManager.json
6968
- var OrderManager_default = [
6969
- {
6970
- type: "error",
6971
- name: "AddressEmptyCode",
6972
- inputs: [
6973
- {
6974
- type: "address",
6975
- name: "target"
6976
- }
6977
- ]
6978
- },
6979
- {
6980
- type: "error",
6981
- name: "ERC1967InvalidImplementation",
6982
- inputs: [
6983
- {
6984
- type: "address",
6985
- name: "implementation"
6986
- }
6987
- ]
6988
- },
6989
- {
6990
- type: "error",
6991
- name: "ERC1967NonPayable",
6992
- inputs: []
6993
- },
6994
- {
6995
- type: "error",
6996
- name: "ExceedOrderSize",
6997
- inputs: [
6998
- {
6999
- type: "uint256",
7000
- name: "size"
7001
- }
7002
- ]
7003
- },
7004
- {
7005
- type: "error",
7006
- name: "ExecutionFeeNotSupport",
7007
- inputs: [
7008
- {
7009
- type: "address",
7010
- name: "token"
7011
- }
7012
- ]
7013
- },
7014
- {
7015
- type: "error",
7016
- name: "FailedCall",
7017
- inputs: []
7018
- },
7019
- {
7020
- type: "error",
7021
- name: "InsufficientCollateral",
7022
- inputs: [
7023
- {
7024
- type: "uint256",
7025
- name: "required"
7026
- },
7027
- {
7028
- type: "uint256",
7029
- name: "available"
7030
- }
7031
- ]
7032
- },
7033
- {
7034
- type: "error",
7035
- name: "InvalidInitialization",
7036
- inputs: []
7037
- },
7038
- {
7039
- type: "error",
7040
- name: "InvalidParameter",
7041
- inputs: []
7042
- },
7043
- {
7044
- type: "error",
7045
- name: "NotActiveBroker",
7046
- inputs: [
7047
- {
7048
- type: "address",
7049
- name: "broker"
7050
- }
7051
- ]
7052
- },
7053
- {
7054
- type: "error",
7055
- name: "NotAddressManager",
7056
- inputs: []
7057
- },
7058
- {
7059
- type: "error",
7060
- name: "NotDependencyManager",
7061
- inputs: []
7062
- },
7063
- {
7064
- type: "error",
7065
- name: "NotInitializing",
7066
- inputs: []
7067
- },
7068
- {
7069
- type: "error",
7070
- name: "NotOrderOwner",
7071
- inputs: []
7072
- },
7073
- {
7074
- type: "error",
7075
- name: "NotPositionOwner",
7076
- inputs: []
7077
- },
7078
- {
7079
- type: "error",
7080
- name: "NotProxyAdmin",
7081
- inputs: []
7082
- },
7083
- {
7084
- type: "error",
7085
- name: "OrderNotExist",
7086
- inputs: [
7087
- {
7088
- type: "uint256",
7089
- name: "orderId"
7090
- }
7091
- ]
7092
- },
7093
- {
7094
- type: "error",
7095
- name: "PermissionDenied",
7096
- inputs: [
7097
- {
7098
- type: "address",
7099
- name: "caller"
7100
- },
7101
- {
7102
- type: "address",
7103
- name: "target"
7104
- }
7105
- ]
7106
- },
7107
- {
7108
- type: "error",
7109
- name: "PoolNotActive",
7110
- inputs: [
7111
- {
7112
- type: "bytes32",
7113
- name: "poolId"
7114
- }
7115
- ]
7116
- },
7117
- {
7118
- type: "error",
7119
- name: "SafeERC20FailedOperation",
7120
- inputs: [
7121
- {
7122
- type: "address",
7123
- name: "token"
7124
- }
7125
- ]
7126
- },
7127
- {
7128
- type: "error",
7129
- name: "UUPSUnauthorizedCallContext",
7130
- inputs: []
7131
- },
7132
- {
7133
- type: "error",
7134
- name: "UUPSUnsupportedProxiableUUID",
7135
- inputs: [
7136
- {
7137
- type: "bytes32",
7138
- name: "slot"
7139
- }
7140
- ]
7141
- },
7142
- {
7143
- type: "event",
7144
- anonymous: false,
7145
- name: "ExecutionFeeUpdated",
7146
- inputs: [
7147
- {
7148
- type: "address",
7149
- name: "token",
7150
- indexed: false
7151
- },
7152
- {
7153
- type: "uint256",
7154
- name: "value",
7155
- indexed: false
7156
- },
7157
- {
7158
- type: "bool",
7159
- name: "isActive",
7160
- indexed: false
7161
- }
7162
- ]
7163
- },
7164
- {
7165
- type: "event",
7166
- anonymous: false,
7167
- name: "Initialized",
7168
- inputs: [
7169
- {
7170
- type: "uint64",
7171
- name: "version",
7172
- indexed: false
7173
- }
7174
- ]
7175
- },
7176
- {
7177
- type: "event",
7178
- anonymous: false,
7179
- name: "Upgraded",
7180
- inputs: [
7181
- {
7182
- type: "address",
7183
- name: "implementation",
7184
- indexed: true
7185
- }
7186
- ]
7187
- },
7188
- {
7189
- type: "function",
7190
- name: "UPGRADE_INTERFACE_VERSION",
7191
- constant: true,
7192
- stateMutability: "view",
7193
- payable: false,
7194
- inputs: [],
7195
- outputs: [
7196
- {
7197
- type: "string"
7198
- }
7199
- ]
7200
- },
7201
- {
7202
- type: "function",
7203
- name: "cancelOrder",
7204
- constant: false,
7205
- payable: false,
7206
- inputs: [
7207
- {
7208
- type: "uint256",
7209
- name: "orderId"
7210
- }
7211
- ],
7212
- outputs: []
7213
- },
7214
- {
7215
- type: "function",
7216
- name: "cancelOrders",
7217
- constant: false,
7218
- payable: false,
7219
- inputs: [
7220
- {
7221
- type: "uint256[]",
7222
- name: "orderIds"
7223
- }
7224
- ],
7225
- outputs: []
7226
- },
7227
- {
7228
- type: "function",
7229
- name: "fillOrder",
7230
- constant: false,
7231
- payable: false,
7232
- inputs: [
7233
- {
7234
- type: "tuple",
7235
- name: "params",
7236
- components: [
7237
- {
7238
- type: "uint256",
7239
- name: "orderId"
7240
- },
7241
- {
7242
- type: "bytes32",
7243
- name: "positionId"
7244
- },
7245
- {
7246
- type: "address",
7247
- name: "keeper"
7248
- },
7249
- {
7250
- type: "uint256",
7251
- name: "fillSize"
7252
- },
7253
- {
7254
- type: "uint256",
7255
- name: "fillPrice"
7256
- },
7257
- {
7258
- type: "int256",
7259
- name: "realizedPnl"
7260
- },
7261
- {
7262
- type: "int256",
7263
- name: "tradingFee"
7264
- },
7265
- {
7266
- type: "int256",
7267
- name: "fundingFee"
7268
- },
7269
- {
7270
- type: "bool",
7271
- name: "forceClose"
7272
- }
7273
- ]
7274
- }
7275
- ],
7276
- outputs: [
7277
- {
7278
- type: "uint256",
7279
- name: "tpOrderId"
7280
- },
7281
- {
7282
- type: "uint256",
7283
- name: "slOrderId"
7284
- }
7285
- ]
7286
- },
7287
- {
7288
- type: "function",
7289
- name: "getAddressManager",
7290
- constant: true,
7291
- stateMutability: "view",
7292
- payable: false,
7293
- inputs: [],
7294
- outputs: [
7295
- {
7296
- type: "address"
7297
- }
7298
- ]
7299
- },
7300
- {
7301
- type: "function",
7302
- name: "getDependencyAddress",
7303
- constant: true,
7304
- stateMutability: "view",
7305
- payable: false,
7306
- inputs: [
7307
- {
7308
- type: "bytes32",
7309
- name: "identifier"
7310
- }
7311
- ],
7312
- outputs: [
7313
- {
7314
- type: "address"
7315
- }
7316
- ]
7317
- },
7318
- {
7319
- type: "function",
7320
- name: "getExecutionFee",
7321
- constant: true,
7322
- stateMutability: "view",
7323
- payable: false,
7324
- inputs: [
7325
- {
7326
- type: "address",
7327
- name: "token"
7328
- }
7329
- ],
7330
- outputs: [
7331
- {
7332
- type: "uint256"
7333
- }
7334
- ]
7335
- },
7336
- {
7337
- type: "function",
7338
- name: "getImplementation",
7339
- constant: true,
7340
- stateMutability: "view",
7341
- payable: false,
7342
- inputs: [],
7343
- outputs: [
7344
- {
7345
- type: "address"
7346
- }
7347
- ]
7348
- },
7349
- {
7350
- type: "function",
7351
- name: "getOrder",
7352
- constant: true,
7353
- stateMutability: "view",
7354
- payable: false,
7355
- inputs: [
7356
- {
7357
- type: "uint256",
7358
- name: "orderId"
7359
- }
7360
- ],
7361
- outputs: [
7362
- {
7363
- type: "tuple",
7364
- components: [
7365
- {
7366
- type: "bytes32",
7367
- name: "poolId"
7368
- },
7369
- {
7370
- type: "bytes32",
7371
- name: "positionId"
7372
- },
7373
- {
7374
- type: "uint256",
7375
- name: "collateralAmount"
7376
- },
7377
- {
7378
- type: "uint256",
7379
- name: "size"
7380
- },
7381
- {
7382
- type: "uint256",
7383
- name: "price"
7384
- },
7385
- {
7386
- type: "uint256",
7387
- name: "filledSize"
7388
- },
7389
- {
7390
- type: "address",
7391
- name: "user"
7392
- },
7393
- {
7394
- type: "uint8",
7395
- name: "orderType"
7396
- },
7397
- {
7398
- type: "uint8",
7399
- name: "triggerType"
7400
- },
7401
- {
7402
- type: "uint8",
7403
- name: "operation"
7404
- },
7405
- {
7406
- type: "uint8",
7407
- name: "direction"
7408
- },
7409
- {
7410
- type: "uint8",
7411
- name: "timeInForce"
7412
- },
7413
- {
7414
- type: "uint16",
7415
- name: "slippagePct"
7416
- },
7417
- {
7418
- type: "bool",
7419
- name: "postOnly"
7420
- },
7421
- {
7422
- type: "uint64",
7423
- name: "createdAt"
7424
- },
7425
- {
7426
- type: "address",
7427
- name: "broker"
7428
- }
7429
- ]
7430
- }
7431
- ]
7432
- },
7433
- {
7434
- type: "function",
7435
- name: "getOrderExecutionFee",
7436
- constant: true,
7437
- stateMutability: "view",
7438
- payable: false,
7439
- inputs: [
7440
- {
7441
- type: "uint256",
7442
- name: "orderId"
7443
- }
7444
- ],
7445
- outputs: [
7446
- {
7447
- type: "uint256"
7448
- }
7449
- ]
7450
- },
7451
- {
7452
- type: "function",
7453
- name: "getOrderTPSL",
7454
- constant: true,
7455
- stateMutability: "view",
7456
- payable: false,
7457
- inputs: [
7458
- {
7459
- type: "uint256",
7460
- name: "orderId"
7461
- }
7462
- ],
7463
- outputs: [
7464
- {
7465
- type: "tuple",
7466
- components: [
7467
- {
7468
- type: "uint256",
7469
- name: "tpSize"
7470
- },
7471
- {
7472
- type: "uint256",
7473
- name: "tpPrice"
7474
- },
7475
- {
7476
- type: "uint256",
7477
- name: "tpExecutionFee"
7478
- },
7479
- {
7480
- type: "uint256",
7481
- name: "slSize"
7482
- },
7483
- {
7484
- type: "uint256",
7485
- name: "slPrice"
7486
- },
7487
- {
7488
- type: "uint256",
7489
- name: "slExecutionFee"
7490
- }
7491
- ]
7492
- }
7493
- ]
7494
- },
7495
- {
7496
- type: "function",
7497
- name: "getOrderWithTPSL",
7498
- constant: true,
7499
- stateMutability: "view",
7500
- payable: false,
7501
- inputs: [
7502
- {
7503
- type: "uint256",
7504
- name: "orderId"
7505
- }
7506
- ],
7507
- outputs: [
7508
- {
7509
- type: "tuple",
7510
- components: [
7511
- {
7512
- type: "bytes32",
7513
- name: "poolId"
7514
- },
7515
- {
7516
- type: "bytes32",
7517
- name: "positionId"
7518
- },
7519
- {
7520
- type: "uint256",
7521
- name: "collateralAmount"
7522
- },
7523
- {
7524
- type: "uint256",
7525
- name: "size"
7526
- },
7527
- {
7528
- type: "uint256",
7529
- name: "price"
7530
- },
7531
- {
7532
- type: "uint256",
7533
- name: "filledSize"
7534
- },
7535
- {
7536
- type: "address",
7537
- name: "user"
7538
- },
7539
- {
7540
- type: "uint8",
7541
- name: "orderType"
7542
- },
7543
- {
7544
- type: "uint8",
7545
- name: "triggerType"
7546
- },
7547
- {
7548
- type: "uint8",
7549
- name: "operation"
7550
- },
7551
- {
7552
- type: "uint8",
7553
- name: "direction"
7554
- },
7555
- {
7556
- type: "uint8",
7557
- name: "timeInForce"
7558
- },
7559
- {
7560
- type: "uint16",
7561
- name: "slippagePct"
7562
- },
7563
- {
7564
- type: "bool",
7565
- name: "postOnly"
7566
- },
7567
- {
7568
- type: "uint64",
7569
- name: "createdAt"
7570
- },
7571
- {
7572
- type: "address",
7573
- name: "broker"
7574
- }
7575
- ]
7576
- },
7577
- {
7578
- type: "tuple",
7579
- components: [
7580
- {
7581
- type: "uint256",
7582
- name: "tpSize"
7583
- },
7584
- {
7585
- type: "uint256",
7586
- name: "tpPrice"
7587
- },
7588
- {
7589
- type: "uint256",
7590
- name: "tpExecutionFee"
7591
- },
7592
- {
7593
- type: "uint256",
7594
- name: "slSize"
7595
- },
7596
- {
7597
- type: "uint256",
7598
- name: "slPrice"
7599
- },
7600
- {
7601
- type: "uint256",
7602
- name: "slExecutionFee"
7603
- }
7604
- ]
7605
- }
7606
- ]
7607
- },
7608
- {
7609
- type: "function",
7610
- name: "initialize",
7611
- constant: false,
7612
- payable: false,
7613
- inputs: [
7614
- {
7615
- type: "address",
7616
- name: "addressManager"
7617
- }
7618
- ],
7619
- outputs: []
7620
- },
7621
- {
7622
- type: "function",
7623
- name: "isAllOrderOwner",
7624
- constant: true,
7625
- stateMutability: "view",
7626
- payable: false,
7627
- inputs: [
7628
- {
7629
- type: "uint256[]",
7630
- name: "orderIds"
7631
- },
7632
- {
7633
- type: "address",
7634
- name: "user"
7635
- }
7636
- ],
7637
- outputs: [
7638
- {
7639
- type: "bool"
7640
- }
7641
- ]
7642
- },
7643
- {
7644
- type: "function",
7645
- name: "isOrderOwner",
7646
- constant: true,
7647
- stateMutability: "view",
7648
- payable: false,
7649
- inputs: [
7650
- {
7651
- type: "uint256",
7652
- name: "orderId"
7653
- },
7654
- {
7655
- type: "address",
7656
- name: "user"
7657
- }
7658
- ],
7659
- outputs: [
7660
- {
7661
- type: "bool"
7662
- }
7663
- ]
7664
- },
7665
- {
7666
- type: "function",
7667
- name: "placeOrderWithPosition",
7668
- constant: false,
7669
- payable: false,
7670
- inputs: [
7671
- {
7672
- type: "bytes32",
7673
- name: "positionId"
7674
- },
7675
- {
7676
- type: "tuple",
7677
- name: "params",
7678
- components: [
7679
- {
7680
- type: "address",
7681
- name: "user"
7682
- },
7683
- {
7684
- type: "bytes32",
7685
- name: "poolId"
7686
- },
7687
- {
7688
- type: "uint8",
7689
- name: "orderType"
7690
- },
7691
- {
7692
- type: "uint8",
7693
- name: "triggerType"
7694
- },
7695
- {
7696
- type: "uint8",
7697
- name: "operation"
7698
- },
7699
- {
7700
- type: "uint8",
7701
- name: "direction"
7702
- },
7703
- {
7704
- type: "uint256",
7705
- name: "collateralAmount"
7706
- },
7707
- {
7708
- type: "uint256",
7709
- name: "size"
7710
- },
7711
- {
7712
- type: "uint256",
7713
- name: "price"
7714
- },
7715
- {
7716
- type: "uint8",
7717
- name: "timeInForce"
7718
- },
7719
- {
7720
- type: "bool",
7721
- name: "postOnly"
7722
- },
7723
- {
7724
- type: "uint16",
7725
- name: "slippagePct"
7726
- },
7727
- {
7728
- type: "uint16",
7729
- name: "leverage"
7730
- },
7731
- {
7732
- type: "uint256",
7733
- name: "tpSize"
7734
- },
7735
- {
7736
- type: "uint256",
7737
- name: "tpPrice"
7738
- },
7739
- {
7740
- type: "uint256",
7741
- name: "slSize"
7742
- },
7743
- {
7744
- type: "uint256",
7745
- name: "slPrice"
7746
- }
7747
- ]
7748
- }
7749
- ],
7750
- outputs: [
7751
- {
7752
- type: "uint256",
7753
- name: "orderId"
7754
- }
7755
- ]
7756
- },
7757
- {
7758
- type: "function",
7759
- name: "placeOrderWithSalt",
7760
- constant: false,
7761
- payable: false,
7762
- inputs: [
7763
- {
7764
- type: "uint64",
7765
- name: "userPositionSalt"
7766
- },
7767
- {
7768
- type: "tuple",
7769
- name: "params",
7770
- components: [
7771
- {
7772
- type: "address",
7773
- name: "user"
7774
- },
7775
- {
7776
- type: "bytes32",
7777
- name: "poolId"
7778
- },
7779
- {
7780
- type: "uint8",
7781
- name: "orderType"
7782
- },
7783
- {
7784
- type: "uint8",
7785
- name: "triggerType"
7786
- },
7787
- {
7788
- type: "uint8",
7789
- name: "operation"
7790
- },
7791
- {
7792
- type: "uint8",
7793
- name: "direction"
7794
- },
7795
- {
7796
- type: "uint256",
7797
- name: "collateralAmount"
7798
- },
7799
- {
7800
- type: "uint256",
7801
- name: "size"
7802
- },
7803
- {
7804
- type: "uint256",
7805
- name: "price"
7806
- },
7807
- {
7808
- type: "uint8",
7809
- name: "timeInForce"
7810
- },
7811
- {
7812
- type: "bool",
7813
- name: "postOnly"
7814
- },
7815
- {
7816
- type: "uint16",
7817
- name: "slippagePct"
7818
- },
7819
- {
7820
- type: "uint16",
7821
- name: "leverage"
7822
- },
7823
- {
7824
- type: "uint256",
7825
- name: "tpSize"
7826
- },
7827
- {
7828
- type: "uint256",
7829
- name: "tpPrice"
7830
- },
7831
- {
7832
- type: "uint256",
7833
- name: "slSize"
7834
- },
7835
- {
7836
- type: "uint256",
7837
- name: "slPrice"
7838
- }
7839
- ]
7840
- }
7841
- ],
7842
- outputs: [
7843
- {
7844
- type: "uint256",
7845
- name: "orderId"
7846
- }
7847
- ]
7848
- },
7849
- {
7850
- type: "function",
7851
- name: "proxiableUUID",
7852
- constant: true,
7853
- stateMutability: "view",
7854
- payable: false,
7855
- inputs: [],
7856
- outputs: [
7857
- {
7858
- type: "bytes32"
7859
- }
7860
- ]
7861
- },
7862
- {
7863
- type: "function",
7864
- name: "removePositionOrders",
7865
- constant: false,
7866
- payable: false,
7867
- inputs: [
7868
- {
7869
- type: "bytes32",
7870
- name: "positionId"
7871
- }
7872
- ],
7873
- outputs: []
7874
- },
7875
- {
7876
- type: "function",
7877
- name: "saveAutoDecreaseOrder",
7878
- constant: false,
7879
- payable: false,
7880
- inputs: [
7881
- {
7882
- type: "address",
7883
- name: "user"
7884
- },
7885
- {
7886
- type: "bytes32",
7887
- name: "poolId"
7888
- },
7889
- {
7890
- type: "bytes32",
7891
- name: "positionId"
7892
- },
7893
- {
7894
- type: "uint256",
7895
- name: "size"
7896
- },
7897
- {
7898
- type: "uint256",
7899
- name: "price"
7900
- },
7901
- {
7902
- type: "uint8",
7903
- name: "direction"
7904
- },
7905
- {
7906
- type: "address",
7907
- name: "broker"
7908
- }
7909
- ],
7910
- outputs: [
7911
- {
7912
- type: "uint256",
7913
- name: "orderId"
7914
- }
7915
- ]
7916
- },
7917
- {
7918
- type: "function",
7919
- name: "setExecutionFee",
7920
- constant: false,
7921
- payable: false,
7922
- inputs: [
7923
- {
7924
- type: "address",
7925
- name: "token"
7926
- },
7927
- {
7928
- type: "uint256",
7929
- name: "value"
7930
- },
7931
- {
7932
- type: "bool",
7933
- name: "isActive"
7934
- }
7935
- ],
7936
- outputs: []
7937
- },
7938
- {
7939
- type: "function",
7940
- name: "uncompleteOrder",
7941
- constant: false,
7942
- payable: false,
7943
- inputs: [
7944
- {
7945
- type: "uint256",
7946
- name: "orderId"
7947
- },
7948
- {
7949
- type: "string",
7950
- name: "remark"
7951
- }
7952
- ],
7953
- outputs: []
7954
- },
7955
- {
7956
- type: "function",
7957
- name: "uncompleteOrders",
7958
- constant: false,
7959
- payable: false,
7960
- inputs: [
7961
- {
7962
- type: "uint256[]",
7963
- name: "orderIds"
7964
- },
7965
- {
7966
- type: "string",
7967
- name: "remark"
7968
- }
7969
- ],
7970
- outputs: []
7971
- },
7972
- {
7973
- type: "function",
7974
- name: "updateOrder",
7975
- constant: false,
7976
- payable: false,
7977
- inputs: [
7978
- {
7979
- type: "tuple",
7980
- name: "params",
7981
- components: [
7982
- {
7983
- type: "uint256",
7984
- name: "orderId"
7985
- },
7986
- {
7987
- type: "uint256",
7988
- name: "size"
7989
- },
7990
- {
7991
- type: "uint256",
7992
- name: "price"
7993
- },
7994
- {
7995
- type: "tuple",
7996
- name: "tpsl",
7997
- components: [
7998
- {
7999
- type: "uint256",
8000
- name: "tpSize"
8001
- },
8002
- {
8003
- type: "uint256",
8004
- name: "tpPrice"
8005
- },
8006
- {
8007
- type: "uint256",
8008
- name: "slSize"
8009
- },
8010
- {
8011
- type: "uint256",
8012
- name: "slPrice"
8013
- }
8014
- ]
8015
- }
8016
- ]
8017
- }
8018
- ],
8019
- outputs: []
8020
- },
8021
- {
8022
- type: "function",
8023
- name: "upgradeTo",
8024
- constant: false,
8025
- stateMutability: "payable",
8026
- payable: true,
8027
- inputs: [
8028
- {
8029
- type: "address",
8030
- name: "newImplementation"
8031
- },
8032
- {
8033
- type: "bytes",
8034
- name: "data"
8035
- }
8036
- ],
8037
- outputs: []
8038
- },
8039
- {
8040
- type: "function",
8041
- name: "upgradeToAndCall",
8042
- constant: false,
8043
- stateMutability: "payable",
8044
- payable: true,
8045
- inputs: [
8046
- {
8047
- type: "address",
8048
- name: "newImplementation"
8049
- },
8050
- {
8051
- type: "bytes",
8052
- name: "data"
8053
- }
8054
- ],
8055
- outputs: []
7183
+ ]
8056
7184
  }
8057
7185
  ];
8058
7186
 
@@ -8627,6 +7755,11 @@ var MarketManager_default = [
8627
7755
  name: "MarketAlreadyExisted",
8628
7756
  inputs: []
8629
7757
  },
7758
+ {
7759
+ type: "error",
7760
+ name: "MarketNotExisted",
7761
+ inputs: []
7762
+ },
8630
7763
  {
8631
7764
  type: "error",
8632
7765
  name: "NotAddressManager",
@@ -8676,6 +7809,50 @@ var MarketManager_default = [
8676
7809
  }
8677
7810
  ]
8678
7811
  },
7812
+ {
7813
+ type: "event",
7814
+ anonymous: false,
7815
+ name: "ExecutionFeeUpdated",
7816
+ inputs: [
7817
+ {
7818
+ type: "bytes32",
7819
+ name: "marketId",
7820
+ indexed: false
7821
+ },
7822
+ {
7823
+ type: "uint256",
7824
+ name: "oldExecutionFee",
7825
+ indexed: false
7826
+ },
7827
+ {
7828
+ type: "uint256",
7829
+ name: "newExecutionFee",
7830
+ indexed: false
7831
+ }
7832
+ ]
7833
+ },
7834
+ {
7835
+ type: "event",
7836
+ anonymous: false,
7837
+ name: "ForwardFeeUpdated",
7838
+ inputs: [
7839
+ {
7840
+ type: "bytes32",
7841
+ name: "marketId",
7842
+ indexed: false
7843
+ },
7844
+ {
7845
+ type: "uint256",
7846
+ name: "oldForwardFee",
7847
+ indexed: false
7848
+ },
7849
+ {
7850
+ type: "uint256",
7851
+ name: "newForwardFee",
7852
+ indexed: false
7853
+ }
7854
+ ]
7855
+ },
8679
7856
  {
8680
7857
  type: "event",
8681
7858
  anonymous: false,
@@ -8688,6 +7865,50 @@ var MarketManager_default = [
8688
7865
  }
8689
7866
  ]
8690
7867
  },
7868
+ {
7869
+ type: "event",
7870
+ anonymous: false,
7871
+ name: "MaxExecutionFeeUpdated",
7872
+ inputs: [
7873
+ {
7874
+ type: "bytes32",
7875
+ name: "marketId",
7876
+ indexed: false
7877
+ },
7878
+ {
7879
+ type: "uint256",
7880
+ name: "oldMaxExecutionFee",
7881
+ indexed: false
7882
+ },
7883
+ {
7884
+ type: "uint256",
7885
+ name: "newMaxExecutionFee",
7886
+ indexed: false
7887
+ }
7888
+ ]
7889
+ },
7890
+ {
7891
+ type: "event",
7892
+ anonymous: false,
7893
+ name: "MaxForwardFeeUpdated",
7894
+ inputs: [
7895
+ {
7896
+ type: "bytes32",
7897
+ name: "marketId",
7898
+ indexed: false
7899
+ },
7900
+ {
7901
+ type: "uint256",
7902
+ name: "oldMaxForwardFee",
7903
+ indexed: false
7904
+ },
7905
+ {
7906
+ type: "uint256",
7907
+ name: "newMaxForwardFee",
7908
+ indexed: false
7909
+ }
7910
+ ]
7911
+ },
8691
7912
  {
8692
7913
  type: "event",
8693
7914
  anonymous: false,
@@ -8750,6 +7971,22 @@ var MarketManager_default = [
8750
7971
  {
8751
7972
  type: "uint128",
8752
7973
  name: "poolPrimeThreshold"
7974
+ },
7975
+ {
7976
+ type: "uint128",
7977
+ name: "executionFee"
7978
+ },
7979
+ {
7980
+ type: "uint128",
7981
+ name: "maxExecutionFee"
7982
+ },
7983
+ {
7984
+ type: "uint128",
7985
+ name: "forwardFee"
7986
+ },
7987
+ {
7988
+ type: "uint128",
7989
+ name: "maxForwardFee"
8753
7990
  }
8754
7991
  ]
8755
7992
  }
@@ -8787,6 +8024,78 @@ var MarketManager_default = [
8787
8024
  }
8788
8025
  ]
8789
8026
  },
8027
+ {
8028
+ type: "function",
8029
+ name: "getExecutionFee",
8030
+ constant: true,
8031
+ stateMutability: "view",
8032
+ payable: false,
8033
+ inputs: [
8034
+ {
8035
+ type: "bytes32",
8036
+ name: "marketId"
8037
+ }
8038
+ ],
8039
+ outputs: [
8040
+ {
8041
+ type: "uint256"
8042
+ }
8043
+ ]
8044
+ },
8045
+ {
8046
+ type: "function",
8047
+ name: "getExecutionFeeByToken",
8048
+ constant: true,
8049
+ stateMutability: "view",
8050
+ payable: false,
8051
+ inputs: [
8052
+ {
8053
+ type: "address",
8054
+ name: "quoteToken"
8055
+ }
8056
+ ],
8057
+ outputs: [
8058
+ {
8059
+ type: "uint256"
8060
+ }
8061
+ ]
8062
+ },
8063
+ {
8064
+ type: "function",
8065
+ name: "getForwardFee",
8066
+ constant: true,
8067
+ stateMutability: "view",
8068
+ payable: false,
8069
+ inputs: [
8070
+ {
8071
+ type: "bytes32",
8072
+ name: "marketId"
8073
+ }
8074
+ ],
8075
+ outputs: [
8076
+ {
8077
+ type: "uint256"
8078
+ }
8079
+ ]
8080
+ },
8081
+ {
8082
+ type: "function",
8083
+ name: "getForwardFeeByToken",
8084
+ constant: true,
8085
+ stateMutability: "view",
8086
+ payable: false,
8087
+ inputs: [
8088
+ {
8089
+ type: "address",
8090
+ name: "quoteToken"
8091
+ }
8092
+ ],
8093
+ outputs: [
8094
+ {
8095
+ type: "uint256"
8096
+ }
8097
+ ]
8098
+ },
8790
8099
  {
8791
8100
  type: "function",
8792
8101
  name: "getImplementation",
@@ -8839,6 +8148,22 @@ var MarketManager_default = [
8839
8148
  {
8840
8149
  type: "uint128",
8841
8150
  name: "poolPrimeThreshold"
8151
+ },
8152
+ {
8153
+ type: "uint128",
8154
+ name: "executionFee"
8155
+ },
8156
+ {
8157
+ type: "uint128",
8158
+ name: "maxExecutionFee"
8159
+ },
8160
+ {
8161
+ type: "uint128",
8162
+ name: "forwardFee"
8163
+ },
8164
+ {
8165
+ type: "uint128",
8166
+ name: "maxForwardFee"
8842
8167
  }
8843
8168
  ]
8844
8169
  }
@@ -8919,6 +8244,74 @@ var MarketManager_default = [
8919
8244
  }
8920
8245
  ]
8921
8246
  },
8247
+ {
8248
+ type: "function",
8249
+ name: "updateExecutionFee",
8250
+ constant: false,
8251
+ payable: false,
8252
+ inputs: [
8253
+ {
8254
+ type: "bytes32",
8255
+ name: "marketId"
8256
+ },
8257
+ {
8258
+ type: "uint128",
8259
+ name: "_executionFee"
8260
+ }
8261
+ ],
8262
+ outputs: []
8263
+ },
8264
+ {
8265
+ type: "function",
8266
+ name: "updateForwardFee",
8267
+ constant: false,
8268
+ payable: false,
8269
+ inputs: [
8270
+ {
8271
+ type: "bytes32",
8272
+ name: "marketId"
8273
+ },
8274
+ {
8275
+ type: "uint128",
8276
+ name: "_forwardFee"
8277
+ }
8278
+ ],
8279
+ outputs: []
8280
+ },
8281
+ {
8282
+ type: "function",
8283
+ name: "updateMaxExecutionFee",
8284
+ constant: false,
8285
+ payable: false,
8286
+ inputs: [
8287
+ {
8288
+ type: "bytes32",
8289
+ name: "marketId"
8290
+ },
8291
+ {
8292
+ type: "uint128",
8293
+ name: "_maxExecutionFee"
8294
+ }
8295
+ ],
8296
+ outputs: []
8297
+ },
8298
+ {
8299
+ type: "function",
8300
+ name: "updateMaxForwardFee",
8301
+ constant: false,
8302
+ payable: false,
8303
+ inputs: [
8304
+ {
8305
+ type: "bytes32",
8306
+ name: "marketId"
8307
+ },
8308
+ {
8309
+ type: "uint128",
8310
+ name: "_maxForwardFee"
8311
+ }
8312
+ ],
8313
+ outputs: []
8314
+ },
8922
8315
  {
8923
8316
  type: "function",
8924
8317
  name: "upgradeTo",
@@ -15841,11 +15234,11 @@ var Order = class {
15841
15234
  this.account = account;
15842
15235
  this.api = api;
15843
15236
  }
15844
- async createIncreaseOrder(params, tradingFee) {
15237
+ async createIncreaseOrder(params, tradingFee, marketId) {
15845
15238
  try {
15846
15239
  const config = this.configManager.getConfig();
15847
15240
  const networkFee = await this.utils.getNetworkFee(
15848
- params.executionFeeToken,
15241
+ marketId,
15849
15242
  params.chainId
15850
15243
  );
15851
15244
  let totalNetWorkFee = BigInt(networkFee);
@@ -16015,10 +15408,9 @@ var Order = class {
16015
15408
  };
16016
15409
  }
16017
15410
  }
16018
- async closeAllPositions(chainId, params, tradingFee) {
15411
+ async closeAllPositions(chainId, params) {
16019
15412
  try {
16020
15413
  const config = this.configManager.getConfig();
16021
- const availableAccountMarginBalance = await this.account.getAvailableMarginBalance({ poolId: params[0].poolId, chainId, address: params[0].address });
16022
15414
  const depositData = {
16023
15415
  token: "0x0000000000000000000000000000000000000000",
16024
15416
  amount: "0"
@@ -16652,9 +16044,9 @@ var Order = class {
16652
16044
  };
16653
16045
  }
16654
16046
  }
16655
- async updateOrderTpSl(params, quoteAddress, chainId, address) {
16047
+ async updateOrderTpSl(params, quoteAddress, chainId, address, marketId) {
16656
16048
  const config = this.configManager.getConfig();
16657
- const networkFee = await this.utils.getNetworkFee(quoteAddress, chainId);
16049
+ const networkFee = await this.utils.getNetworkFee(marketId, chainId);
16658
16050
  const data = {
16659
16051
  orderId: params.orderId,
16660
16052
  size: params.size,
@@ -21555,17 +20947,17 @@ var Utils = class {
21555
20947
  };
21556
20948
  }
21557
20949
  }
21558
- async getNetworkFee(quoteAddress, chainId) {
21559
- const orderManagerAddress = getContractAddressByChainId(chainId).ORDER_MANAGER;
20950
+ async getNetworkFee(marketId, chainId) {
20951
+ const marketManagerAddress = getContractAddressByChainId(chainId).MARKET_MANAGER;
21560
20952
  const provider = await getJSONProvider(chainId);
21561
- const orderManagerContract = new ethers7.Contract(
21562
- orderManagerAddress,
21563
- OrderManager_default,
20953
+ const marketManagerContract = new ethers7.Contract(
20954
+ marketManagerAddress,
20955
+ MarketManager_default,
21564
20956
  provider
21565
20957
  );
21566
20958
  try {
21567
- const networkFee = await orderManagerContract.getExecutionFee(
21568
- quoteAddress
20959
+ const networkFee = await marketManagerContract.getExecutionFee(
20960
+ marketId
21569
20961
  );
21570
20962
  return networkFee.toString();
21571
20963
  } catch (error) {
@@ -22662,7 +22054,6 @@ var Account = class {
22662
22054
  data: functionHash,
22663
22055
  nonce: nonce.toString()
22664
22056
  };
22665
- this.logger.info("deposit forward tx params --->", forwardTxParams);
22666
22057
  const rs2 = await this.client.seamless.forwarderTx(forwardTxParams, chainId, seamlessWallet);
22667
22058
  return {
22668
22059
  code: 0,
@@ -22720,6 +22111,8 @@ var Account = class {
22720
22111
  };
22721
22112
  }
22722
22113
  }
22114
+ async getCurrentEpoch() {
22115
+ }
22723
22116
  async getAccountVipInfo(chainId, address) {
22724
22117
  const config = this.configManager.getConfig();
22725
22118
  const provider = await getJSONProvider(chainId);
@@ -22730,14 +22123,17 @@ var Account = class {
22730
22123
  );
22731
22124
  const latestBlock = await provider.getBlock("latest");
22732
22125
  const deadline = (latestBlock?.timestamp ?? dayjs3().unix()) + 60 * 5;
22733
- this.logger.info("deadline-->", deadline);
22126
+ const accessToken = await this.configManager.getAccessToken() ?? "";
22734
22127
  try {
22735
- this.logger.info("brokerContract-->", config.brokerAddress);
22736
- this.logger.info("address-->", address);
22737
- const accountVipInfo = await brokerContract.userFeeData(address);
22738
- this.logger.info("accountVipInfo-->", accountVipInfo);
22128
+ const currentEpoch = await this.client.api.getCurrentEpoch({ address, accessToken, broker: config.brokerAddress });
22129
+ if (currentEpoch.code !== 9200) {
22130
+ throw new MyxSDKError(
22131
+ "REQUEST_FAILED" /* RequestFailed */,
22132
+ currentEpoch.msg ?? "Failed to get current epoch"
22133
+ );
22134
+ }
22135
+ const accountVipInfo = await brokerContract.userFeeData(currentEpoch?.data ?? 0, address);
22739
22136
  const nonce = await brokerContract.userNonces(address);
22740
- this.logger.info("nonce-->", nonce);
22741
22137
  return {
22742
22138
  code: 0,
22743
22139
  data: { ...accountVipInfo, nonce: nonce.toString(), deadline }
@@ -23304,6 +22700,22 @@ var Api = class extends Request {
23304
22700
  /**
23305
22701
  * appeal module end ------>
23306
22702
  */
22703
+ async getCurrentEpoch({
22704
+ address,
22705
+ accessToken,
22706
+ broker
22707
+ }) {
22708
+ return http.get(
22709
+ `${this.getHost()}/openapi/gateway/scan/get-current-epoch`,
22710
+ { broker },
22711
+ {
22712
+ headers: {
22713
+ myx_openapi_account: address,
22714
+ myx_openapi_access_token: accessToken
22715
+ }
22716
+ }
22717
+ );
22718
+ }
23307
22719
  };
23308
22720
 
23309
22721
  // src/manager/seamless/index.ts