@myx-trade/sdk 0.1.31 → 0.1.33
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.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +190 -37
- package/dist/index.mjs +190 -37
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -128,7 +128,7 @@ declare const TimeInForce: {
|
|
|
128
128
|
};
|
|
129
129
|
type TimeInForce = (typeof TimeInForce)[keyof typeof TimeInForce];
|
|
130
130
|
interface Position$1 {
|
|
131
|
-
|
|
131
|
+
userPositionSalt: string;
|
|
132
132
|
poolId: string;
|
|
133
133
|
direction: Direction;
|
|
134
134
|
size: string;
|
|
@@ -145,7 +145,7 @@ interface Position$1 {
|
|
|
145
145
|
interface Order$1 {
|
|
146
146
|
orderId: string;
|
|
147
147
|
poolId: string;
|
|
148
|
-
|
|
148
|
+
userPositionSalt?: string;
|
|
149
149
|
orderType: OrderType;
|
|
150
150
|
triggerType: TriggerType;
|
|
151
151
|
operation: OperationType;
|
|
@@ -175,7 +175,7 @@ interface PlaceOrderParams {
|
|
|
175
175
|
chainId: number;
|
|
176
176
|
address: string;
|
|
177
177
|
poolId: string;
|
|
178
|
-
|
|
178
|
+
userPositionSalt: number;
|
|
179
179
|
orderType: OrderType;
|
|
180
180
|
triggerType: TriggerType;
|
|
181
181
|
direction: Direction;
|
|
@@ -196,7 +196,7 @@ interface PositionTpSlOrderParams {
|
|
|
196
196
|
chainId: number;
|
|
197
197
|
address: string;
|
|
198
198
|
poolId: string;
|
|
199
|
-
|
|
199
|
+
userPositionSalt: number;
|
|
200
200
|
executionFeeToken: string;
|
|
201
201
|
tpTriggerType: TriggerType;
|
|
202
202
|
slTriggerType: TriggerType;
|
package/dist/index.d.ts
CHANGED
|
@@ -128,7 +128,7 @@ declare const TimeInForce: {
|
|
|
128
128
|
};
|
|
129
129
|
type TimeInForce = (typeof TimeInForce)[keyof typeof TimeInForce];
|
|
130
130
|
interface Position$1 {
|
|
131
|
-
|
|
131
|
+
userPositionSalt: string;
|
|
132
132
|
poolId: string;
|
|
133
133
|
direction: Direction;
|
|
134
134
|
size: string;
|
|
@@ -145,7 +145,7 @@ interface Position$1 {
|
|
|
145
145
|
interface Order$1 {
|
|
146
146
|
orderId: string;
|
|
147
147
|
poolId: string;
|
|
148
|
-
|
|
148
|
+
userPositionSalt?: string;
|
|
149
149
|
orderType: OrderType;
|
|
150
150
|
triggerType: TriggerType;
|
|
151
151
|
operation: OperationType;
|
|
@@ -175,7 +175,7 @@ interface PlaceOrderParams {
|
|
|
175
175
|
chainId: number;
|
|
176
176
|
address: string;
|
|
177
177
|
poolId: string;
|
|
178
|
-
|
|
178
|
+
userPositionSalt: number;
|
|
179
179
|
orderType: OrderType;
|
|
180
180
|
triggerType: TriggerType;
|
|
181
181
|
direction: Direction;
|
|
@@ -196,7 +196,7 @@ interface PositionTpSlOrderParams {
|
|
|
196
196
|
chainId: number;
|
|
197
197
|
address: string;
|
|
198
198
|
poolId: string;
|
|
199
|
-
|
|
199
|
+
userPositionSalt: number;
|
|
200
200
|
executionFeeToken: string;
|
|
201
201
|
tpTriggerType: TriggerType;
|
|
202
202
|
slTriggerType: TriggerType;
|
package/dist/index.js
CHANGED
|
@@ -1827,7 +1827,7 @@ var RotationProvider = class extends import_providers.BaseProvider {
|
|
|
1827
1827
|
// package.json
|
|
1828
1828
|
var package_default = {
|
|
1829
1829
|
name: "@myx-trade/sdk",
|
|
1830
|
-
version: "0.1.
|
|
1830
|
+
version: "0.1.33",
|
|
1831
1831
|
private: false,
|
|
1832
1832
|
publishConfig: {
|
|
1833
1833
|
access: "public"
|
|
@@ -4926,11 +4926,6 @@ var BasePool_default = [
|
|
|
4926
4926
|
|
|
4927
4927
|
// src/abi/Broker.json
|
|
4928
4928
|
var Broker_default = [
|
|
4929
|
-
{
|
|
4930
|
-
type: "constructor",
|
|
4931
|
-
payable: false,
|
|
4932
|
-
inputs: []
|
|
4933
|
-
},
|
|
4934
4929
|
{
|
|
4935
4930
|
type: "error",
|
|
4936
4931
|
name: "ECDSAInvalidSignature",
|
|
@@ -4966,11 +4961,21 @@ var Broker_default = [
|
|
|
4966
4961
|
name: "InvalidFeeRate",
|
|
4967
4962
|
inputs: []
|
|
4968
4963
|
},
|
|
4964
|
+
{
|
|
4965
|
+
type: "error",
|
|
4966
|
+
name: "InvalidFeeTier",
|
|
4967
|
+
inputs: []
|
|
4968
|
+
},
|
|
4969
4969
|
{
|
|
4970
4970
|
type: "error",
|
|
4971
4971
|
name: "InvalidInitialization",
|
|
4972
4972
|
inputs: []
|
|
4973
4973
|
},
|
|
4974
|
+
{
|
|
4975
|
+
type: "error",
|
|
4976
|
+
name: "InvalidParameter",
|
|
4977
|
+
inputs: []
|
|
4978
|
+
},
|
|
4974
4979
|
{
|
|
4975
4980
|
type: "error",
|
|
4976
4981
|
name: "NoRebateToClaim",
|
|
@@ -5243,6 +5248,19 @@ var Broker_default = [
|
|
|
5243
5248
|
}
|
|
5244
5249
|
]
|
|
5245
5250
|
},
|
|
5251
|
+
{
|
|
5252
|
+
type: "function",
|
|
5253
|
+
name: "__ERC2771ContextUpgradeable_init",
|
|
5254
|
+
constant: false,
|
|
5255
|
+
payable: false,
|
|
5256
|
+
inputs: [
|
|
5257
|
+
{
|
|
5258
|
+
type: "address",
|
|
5259
|
+
name: "trustedForwarder_"
|
|
5260
|
+
}
|
|
5261
|
+
],
|
|
5262
|
+
outputs: []
|
|
5263
|
+
},
|
|
5246
5264
|
{
|
|
5247
5265
|
type: "function",
|
|
5248
5266
|
name: "acceptOwnership",
|
|
@@ -5264,6 +5282,19 @@ var Broker_default = [
|
|
|
5264
5282
|
}
|
|
5265
5283
|
]
|
|
5266
5284
|
},
|
|
5285
|
+
{
|
|
5286
|
+
type: "function",
|
|
5287
|
+
name: "activeSpecialFeeTierList",
|
|
5288
|
+
constant: true,
|
|
5289
|
+
stateMutability: "view",
|
|
5290
|
+
payable: false,
|
|
5291
|
+
inputs: [],
|
|
5292
|
+
outputs: [
|
|
5293
|
+
{
|
|
5294
|
+
type: "uint256[]"
|
|
5295
|
+
}
|
|
5296
|
+
]
|
|
5297
|
+
},
|
|
5267
5298
|
{
|
|
5268
5299
|
type: "function",
|
|
5269
5300
|
name: "addressManager",
|
|
@@ -5284,7 +5315,7 @@ var Broker_default = [
|
|
|
5284
5315
|
payable: false,
|
|
5285
5316
|
inputs: [
|
|
5286
5317
|
{
|
|
5287
|
-
type: "
|
|
5318
|
+
type: "bytes32",
|
|
5288
5319
|
name: "positionId"
|
|
5289
5320
|
},
|
|
5290
5321
|
{
|
|
@@ -5440,6 +5471,29 @@ var Broker_default = [
|
|
|
5440
5471
|
}
|
|
5441
5472
|
]
|
|
5442
5473
|
},
|
|
5474
|
+
{
|
|
5475
|
+
type: "function",
|
|
5476
|
+
name: "getSpecialFeeTier",
|
|
5477
|
+
constant: true,
|
|
5478
|
+
stateMutability: "view",
|
|
5479
|
+
payable: false,
|
|
5480
|
+
inputs: [
|
|
5481
|
+
{
|
|
5482
|
+
type: "uint8",
|
|
5483
|
+
name: "feeTier"
|
|
5484
|
+
}
|
|
5485
|
+
],
|
|
5486
|
+
outputs: [
|
|
5487
|
+
{
|
|
5488
|
+
type: "int32",
|
|
5489
|
+
name: "makerFeeRate"
|
|
5490
|
+
},
|
|
5491
|
+
{
|
|
5492
|
+
type: "uint32",
|
|
5493
|
+
name: "takerFeeRate"
|
|
5494
|
+
}
|
|
5495
|
+
]
|
|
5496
|
+
},
|
|
5443
5497
|
{
|
|
5444
5498
|
type: "function",
|
|
5445
5499
|
name: "getUserFeeRate",
|
|
@@ -5531,6 +5585,24 @@ var Broker_default = [
|
|
|
5531
5585
|
}
|
|
5532
5586
|
]
|
|
5533
5587
|
},
|
|
5588
|
+
{
|
|
5589
|
+
type: "function",
|
|
5590
|
+
name: "isTrustedForwarder",
|
|
5591
|
+
constant: true,
|
|
5592
|
+
stateMutability: "view",
|
|
5593
|
+
payable: false,
|
|
5594
|
+
inputs: [
|
|
5595
|
+
{
|
|
5596
|
+
type: "address",
|
|
5597
|
+
name: "forwarder"
|
|
5598
|
+
}
|
|
5599
|
+
],
|
|
5600
|
+
outputs: [
|
|
5601
|
+
{
|
|
5602
|
+
type: "bool"
|
|
5603
|
+
}
|
|
5604
|
+
]
|
|
5605
|
+
},
|
|
5534
5606
|
{
|
|
5535
5607
|
type: "function",
|
|
5536
5608
|
name: "name",
|
|
@@ -5628,8 +5700,8 @@ var Broker_default = [
|
|
|
5628
5700
|
name: "poolId"
|
|
5629
5701
|
},
|
|
5630
5702
|
{
|
|
5631
|
-
type: "
|
|
5632
|
-
name: "
|
|
5703
|
+
type: "uint64",
|
|
5704
|
+
name: "userPositionSalt"
|
|
5633
5705
|
},
|
|
5634
5706
|
{
|
|
5635
5707
|
type: "uint8",
|
|
@@ -5724,8 +5796,8 @@ var Broker_default = [
|
|
|
5724
5796
|
name: "poolId"
|
|
5725
5797
|
},
|
|
5726
5798
|
{
|
|
5727
|
-
type: "
|
|
5728
|
-
name: "
|
|
5799
|
+
type: "uint64",
|
|
5800
|
+
name: "userPositionSalt"
|
|
5729
5801
|
},
|
|
5730
5802
|
{
|
|
5731
5803
|
type: "uint8",
|
|
@@ -5827,43 +5899,91 @@ var Broker_default = [
|
|
|
5827
5899
|
},
|
|
5828
5900
|
{
|
|
5829
5901
|
type: "function",
|
|
5830
|
-
name: "
|
|
5902
|
+
name: "setSpecialFeeTier",
|
|
5831
5903
|
constant: false,
|
|
5832
5904
|
payable: false,
|
|
5833
5905
|
inputs: [
|
|
5834
5906
|
{
|
|
5835
|
-
type: "
|
|
5836
|
-
name: "
|
|
5907
|
+
type: "uint8",
|
|
5908
|
+
name: "feeTier"
|
|
5837
5909
|
},
|
|
5838
5910
|
{
|
|
5839
|
-
type: "
|
|
5840
|
-
name: "
|
|
5911
|
+
type: "int32",
|
|
5912
|
+
name: "makerFeeRate"
|
|
5841
5913
|
},
|
|
5914
|
+
{
|
|
5915
|
+
type: "uint32",
|
|
5916
|
+
name: "takerFeeRate"
|
|
5917
|
+
}
|
|
5918
|
+
],
|
|
5919
|
+
outputs: []
|
|
5920
|
+
},
|
|
5921
|
+
{
|
|
5922
|
+
type: "function",
|
|
5923
|
+
name: "setUserFeeData",
|
|
5924
|
+
constant: false,
|
|
5925
|
+
payable: false,
|
|
5926
|
+
inputs: [
|
|
5842
5927
|
{
|
|
5843
5928
|
type: "tuple",
|
|
5844
|
-
name: "
|
|
5929
|
+
name: "params",
|
|
5845
5930
|
components: [
|
|
5846
5931
|
{
|
|
5847
|
-
type: "
|
|
5848
|
-
name: "
|
|
5932
|
+
type: "address",
|
|
5933
|
+
name: "user"
|
|
5849
5934
|
},
|
|
5850
5935
|
{
|
|
5851
|
-
type: "
|
|
5852
|
-
name: "
|
|
5936
|
+
type: "uint64",
|
|
5937
|
+
name: "nonce"
|
|
5853
5938
|
},
|
|
5854
5939
|
{
|
|
5855
|
-
type: "
|
|
5856
|
-
name: "
|
|
5940
|
+
type: "uint64",
|
|
5941
|
+
name: "deadline"
|
|
5857
5942
|
},
|
|
5858
5943
|
{
|
|
5859
|
-
type: "
|
|
5860
|
-
name: "
|
|
5944
|
+
type: "tuple",
|
|
5945
|
+
name: "feeData",
|
|
5946
|
+
components: [
|
|
5947
|
+
{
|
|
5948
|
+
type: "uint8",
|
|
5949
|
+
name: "tier"
|
|
5950
|
+
},
|
|
5951
|
+
{
|
|
5952
|
+
type: "address",
|
|
5953
|
+
name: "referrer"
|
|
5954
|
+
},
|
|
5955
|
+
{
|
|
5956
|
+
type: "uint32",
|
|
5957
|
+
name: "totalReferralRebatePct"
|
|
5958
|
+
},
|
|
5959
|
+
{
|
|
5960
|
+
type: "uint32",
|
|
5961
|
+
name: "referrerRebatePct"
|
|
5962
|
+
}
|
|
5963
|
+
]
|
|
5964
|
+
},
|
|
5965
|
+
{
|
|
5966
|
+
type: "bytes",
|
|
5967
|
+
name: "signature"
|
|
5861
5968
|
}
|
|
5862
5969
|
]
|
|
5970
|
+
}
|
|
5971
|
+
],
|
|
5972
|
+
outputs: []
|
|
5973
|
+
},
|
|
5974
|
+
{
|
|
5975
|
+
type: "function",
|
|
5976
|
+
name: "setUserSpecialFeeTier",
|
|
5977
|
+
constant: false,
|
|
5978
|
+
payable: false,
|
|
5979
|
+
inputs: [
|
|
5980
|
+
{
|
|
5981
|
+
type: "address",
|
|
5982
|
+
name: "user"
|
|
5863
5983
|
},
|
|
5864
5984
|
{
|
|
5865
|
-
type: "
|
|
5866
|
-
name: "
|
|
5985
|
+
type: "uint8",
|
|
5986
|
+
name: "feeTier"
|
|
5867
5987
|
}
|
|
5868
5988
|
],
|
|
5869
5989
|
outputs: []
|
|
@@ -5894,6 +6014,19 @@ var Broker_default = [
|
|
|
5894
6014
|
],
|
|
5895
6015
|
outputs: []
|
|
5896
6016
|
},
|
|
6017
|
+
{
|
|
6018
|
+
type: "function",
|
|
6019
|
+
name: "trustedForwarder",
|
|
6020
|
+
constant: true,
|
|
6021
|
+
stateMutability: "view",
|
|
6022
|
+
payable: false,
|
|
6023
|
+
inputs: [],
|
|
6024
|
+
outputs: [
|
|
6025
|
+
{
|
|
6026
|
+
type: "address"
|
|
6027
|
+
}
|
|
6028
|
+
]
|
|
6029
|
+
},
|
|
5897
6030
|
{
|
|
5898
6031
|
type: "function",
|
|
5899
6032
|
name: "updateBaseFeeRates",
|
|
@@ -6083,7 +6216,7 @@ var Broker_default = [
|
|
|
6083
6216
|
]
|
|
6084
6217
|
},
|
|
6085
6218
|
{
|
|
6086
|
-
type: "
|
|
6219
|
+
type: "bytes32",
|
|
6087
6220
|
name: "positionId"
|
|
6088
6221
|
},
|
|
6089
6222
|
{
|
|
@@ -6128,6 +6261,25 @@ var Broker_default = [
|
|
|
6128
6261
|
}
|
|
6129
6262
|
]
|
|
6130
6263
|
},
|
|
6264
|
+
{
|
|
6265
|
+
type: "function",
|
|
6266
|
+
name: "userNonces",
|
|
6267
|
+
constant: true,
|
|
6268
|
+
stateMutability: "view",
|
|
6269
|
+
payable: false,
|
|
6270
|
+
inputs: [
|
|
6271
|
+
{
|
|
6272
|
+
type: "address",
|
|
6273
|
+
name: "user"
|
|
6274
|
+
}
|
|
6275
|
+
],
|
|
6276
|
+
outputs: [
|
|
6277
|
+
{
|
|
6278
|
+
type: "uint64",
|
|
6279
|
+
name: "nonce"
|
|
6280
|
+
}
|
|
6281
|
+
]
|
|
6282
|
+
},
|
|
6131
6283
|
{
|
|
6132
6284
|
type: "function",
|
|
6133
6285
|
name: "userRebates",
|
|
@@ -11943,6 +12095,7 @@ var ConfigManager = class {
|
|
|
11943
12095
|
};
|
|
11944
12096
|
}
|
|
11945
12097
|
auth(params) {
|
|
12098
|
+
this.clear();
|
|
11946
12099
|
this.config = {
|
|
11947
12100
|
...this.config,
|
|
11948
12101
|
...params
|
|
@@ -12553,7 +12706,7 @@ var Order = class {
|
|
|
12553
12706
|
console.log("createIncreaseOrder params--->", {
|
|
12554
12707
|
user: params.address,
|
|
12555
12708
|
poolId: params.poolId,
|
|
12556
|
-
|
|
12709
|
+
userPositionSalt: params.userPositionSalt,
|
|
12557
12710
|
orderType: params.orderType,
|
|
12558
12711
|
triggerType: params.triggerType,
|
|
12559
12712
|
operation: OperationType.INCREASE,
|
|
@@ -12575,7 +12728,7 @@ var Order = class {
|
|
|
12575
12728
|
const gasLimit = await brokerContract.placeOrder.estimateGas({
|
|
12576
12729
|
user: params.address,
|
|
12577
12730
|
poolId: params.poolId,
|
|
12578
|
-
|
|
12731
|
+
userPositionSalt: params.userPositionSalt,
|
|
12579
12732
|
orderType: params.orderType,
|
|
12580
12733
|
triggerType: params.triggerType,
|
|
12581
12734
|
operation: OperationType.INCREASE,
|
|
@@ -12598,7 +12751,7 @@ var Order = class {
|
|
|
12598
12751
|
{
|
|
12599
12752
|
user: params.address,
|
|
12600
12753
|
poolId: params.poolId,
|
|
12601
|
-
|
|
12754
|
+
userPositionSalt: params.userPositionSalt,
|
|
12602
12755
|
orderType: params.orderType,
|
|
12603
12756
|
triggerType: params.triggerType,
|
|
12604
12757
|
operation: OperationType.INCREASE,
|
|
@@ -12670,7 +12823,7 @@ var Order = class {
|
|
|
12670
12823
|
console.log("createDecreaseOrder params--->", {
|
|
12671
12824
|
user: params.address,
|
|
12672
12825
|
poolId: params.poolId,
|
|
12673
|
-
|
|
12826
|
+
userPositionSalt: params.userPositionSalt,
|
|
12674
12827
|
orderType: params.orderType,
|
|
12675
12828
|
triggerType: params.triggerType,
|
|
12676
12829
|
operation: OperationType.DECREASE,
|
|
@@ -12687,7 +12840,7 @@ var Order = class {
|
|
|
12687
12840
|
const gasLimit = await brokerContract.placeOrder.estimateGas({
|
|
12688
12841
|
user: params.address,
|
|
12689
12842
|
poolId: params.poolId,
|
|
12690
|
-
|
|
12843
|
+
userPositionSalt: params.userPositionSalt,
|
|
12691
12844
|
orderType: params.orderType,
|
|
12692
12845
|
triggerType: params.triggerType,
|
|
12693
12846
|
operation: OperationType.DECREASE,
|
|
@@ -12710,7 +12863,7 @@ var Order = class {
|
|
|
12710
12863
|
{
|
|
12711
12864
|
user: params.address,
|
|
12712
12865
|
poolId: params.poolId,
|
|
12713
|
-
|
|
12866
|
+
userPositionSalt: params.userPositionSalt,
|
|
12714
12867
|
orderType: params.orderType,
|
|
12715
12868
|
triggerType: params.triggerType,
|
|
12716
12869
|
operation: OperationType.DECREASE,
|
|
@@ -12785,7 +12938,7 @@ var Order = class {
|
|
|
12785
12938
|
{
|
|
12786
12939
|
user: params.address,
|
|
12787
12940
|
poolId: params.poolId,
|
|
12788
|
-
|
|
12941
|
+
userPositionSalt: params.userPositionSalt,
|
|
12789
12942
|
orderType: OrderType.STOP,
|
|
12790
12943
|
triggerType: params.tpTriggerType,
|
|
12791
12944
|
operation: OperationType.DECREASE,
|
|
@@ -12807,7 +12960,7 @@ var Order = class {
|
|
|
12807
12960
|
{
|
|
12808
12961
|
user: params.address,
|
|
12809
12962
|
poolId: params.poolId,
|
|
12810
|
-
|
|
12963
|
+
userPositionSalt: params.userPositionSalt,
|
|
12811
12964
|
orderType: OrderType.STOP,
|
|
12812
12965
|
triggerType: params.slTriggerType,
|
|
12813
12966
|
operation: OperationType.DECREASE,
|
|
@@ -12865,7 +13018,7 @@ var Order = class {
|
|
|
12865
13018
|
const data = {
|
|
12866
13019
|
user: params.address,
|
|
12867
13020
|
poolId: params.poolId,
|
|
12868
|
-
|
|
13021
|
+
userPositionSalt: params.userPositionSalt,
|
|
12869
13022
|
orderType: OrderType.STOP,
|
|
12870
13023
|
triggerType: params.tpSize !== "0" ? params.tpTriggerType : params.slTriggerType,
|
|
12871
13024
|
operation: OperationType.DECREASE,
|
package/dist/index.mjs
CHANGED
|
@@ -1742,7 +1742,7 @@ var RotationProvider = class extends BaseProvider {
|
|
|
1742
1742
|
// package.json
|
|
1743
1743
|
var package_default = {
|
|
1744
1744
|
name: "@myx-trade/sdk",
|
|
1745
|
-
version: "0.1.
|
|
1745
|
+
version: "0.1.33",
|
|
1746
1746
|
private: false,
|
|
1747
1747
|
publishConfig: {
|
|
1748
1748
|
access: "public"
|
|
@@ -4841,11 +4841,6 @@ var BasePool_default = [
|
|
|
4841
4841
|
|
|
4842
4842
|
// src/abi/Broker.json
|
|
4843
4843
|
var Broker_default = [
|
|
4844
|
-
{
|
|
4845
|
-
type: "constructor",
|
|
4846
|
-
payable: false,
|
|
4847
|
-
inputs: []
|
|
4848
|
-
},
|
|
4849
4844
|
{
|
|
4850
4845
|
type: "error",
|
|
4851
4846
|
name: "ECDSAInvalidSignature",
|
|
@@ -4881,11 +4876,21 @@ var Broker_default = [
|
|
|
4881
4876
|
name: "InvalidFeeRate",
|
|
4882
4877
|
inputs: []
|
|
4883
4878
|
},
|
|
4879
|
+
{
|
|
4880
|
+
type: "error",
|
|
4881
|
+
name: "InvalidFeeTier",
|
|
4882
|
+
inputs: []
|
|
4883
|
+
},
|
|
4884
4884
|
{
|
|
4885
4885
|
type: "error",
|
|
4886
4886
|
name: "InvalidInitialization",
|
|
4887
4887
|
inputs: []
|
|
4888
4888
|
},
|
|
4889
|
+
{
|
|
4890
|
+
type: "error",
|
|
4891
|
+
name: "InvalidParameter",
|
|
4892
|
+
inputs: []
|
|
4893
|
+
},
|
|
4889
4894
|
{
|
|
4890
4895
|
type: "error",
|
|
4891
4896
|
name: "NoRebateToClaim",
|
|
@@ -5158,6 +5163,19 @@ var Broker_default = [
|
|
|
5158
5163
|
}
|
|
5159
5164
|
]
|
|
5160
5165
|
},
|
|
5166
|
+
{
|
|
5167
|
+
type: "function",
|
|
5168
|
+
name: "__ERC2771ContextUpgradeable_init",
|
|
5169
|
+
constant: false,
|
|
5170
|
+
payable: false,
|
|
5171
|
+
inputs: [
|
|
5172
|
+
{
|
|
5173
|
+
type: "address",
|
|
5174
|
+
name: "trustedForwarder_"
|
|
5175
|
+
}
|
|
5176
|
+
],
|
|
5177
|
+
outputs: []
|
|
5178
|
+
},
|
|
5161
5179
|
{
|
|
5162
5180
|
type: "function",
|
|
5163
5181
|
name: "acceptOwnership",
|
|
@@ -5179,6 +5197,19 @@ var Broker_default = [
|
|
|
5179
5197
|
}
|
|
5180
5198
|
]
|
|
5181
5199
|
},
|
|
5200
|
+
{
|
|
5201
|
+
type: "function",
|
|
5202
|
+
name: "activeSpecialFeeTierList",
|
|
5203
|
+
constant: true,
|
|
5204
|
+
stateMutability: "view",
|
|
5205
|
+
payable: false,
|
|
5206
|
+
inputs: [],
|
|
5207
|
+
outputs: [
|
|
5208
|
+
{
|
|
5209
|
+
type: "uint256[]"
|
|
5210
|
+
}
|
|
5211
|
+
]
|
|
5212
|
+
},
|
|
5182
5213
|
{
|
|
5183
5214
|
type: "function",
|
|
5184
5215
|
name: "addressManager",
|
|
@@ -5199,7 +5230,7 @@ var Broker_default = [
|
|
|
5199
5230
|
payable: false,
|
|
5200
5231
|
inputs: [
|
|
5201
5232
|
{
|
|
5202
|
-
type: "
|
|
5233
|
+
type: "bytes32",
|
|
5203
5234
|
name: "positionId"
|
|
5204
5235
|
},
|
|
5205
5236
|
{
|
|
@@ -5355,6 +5386,29 @@ var Broker_default = [
|
|
|
5355
5386
|
}
|
|
5356
5387
|
]
|
|
5357
5388
|
},
|
|
5389
|
+
{
|
|
5390
|
+
type: "function",
|
|
5391
|
+
name: "getSpecialFeeTier",
|
|
5392
|
+
constant: true,
|
|
5393
|
+
stateMutability: "view",
|
|
5394
|
+
payable: false,
|
|
5395
|
+
inputs: [
|
|
5396
|
+
{
|
|
5397
|
+
type: "uint8",
|
|
5398
|
+
name: "feeTier"
|
|
5399
|
+
}
|
|
5400
|
+
],
|
|
5401
|
+
outputs: [
|
|
5402
|
+
{
|
|
5403
|
+
type: "int32",
|
|
5404
|
+
name: "makerFeeRate"
|
|
5405
|
+
},
|
|
5406
|
+
{
|
|
5407
|
+
type: "uint32",
|
|
5408
|
+
name: "takerFeeRate"
|
|
5409
|
+
}
|
|
5410
|
+
]
|
|
5411
|
+
},
|
|
5358
5412
|
{
|
|
5359
5413
|
type: "function",
|
|
5360
5414
|
name: "getUserFeeRate",
|
|
@@ -5446,6 +5500,24 @@ var Broker_default = [
|
|
|
5446
5500
|
}
|
|
5447
5501
|
]
|
|
5448
5502
|
},
|
|
5503
|
+
{
|
|
5504
|
+
type: "function",
|
|
5505
|
+
name: "isTrustedForwarder",
|
|
5506
|
+
constant: true,
|
|
5507
|
+
stateMutability: "view",
|
|
5508
|
+
payable: false,
|
|
5509
|
+
inputs: [
|
|
5510
|
+
{
|
|
5511
|
+
type: "address",
|
|
5512
|
+
name: "forwarder"
|
|
5513
|
+
}
|
|
5514
|
+
],
|
|
5515
|
+
outputs: [
|
|
5516
|
+
{
|
|
5517
|
+
type: "bool"
|
|
5518
|
+
}
|
|
5519
|
+
]
|
|
5520
|
+
},
|
|
5449
5521
|
{
|
|
5450
5522
|
type: "function",
|
|
5451
5523
|
name: "name",
|
|
@@ -5543,8 +5615,8 @@ var Broker_default = [
|
|
|
5543
5615
|
name: "poolId"
|
|
5544
5616
|
},
|
|
5545
5617
|
{
|
|
5546
|
-
type: "
|
|
5547
|
-
name: "
|
|
5618
|
+
type: "uint64",
|
|
5619
|
+
name: "userPositionSalt"
|
|
5548
5620
|
},
|
|
5549
5621
|
{
|
|
5550
5622
|
type: "uint8",
|
|
@@ -5639,8 +5711,8 @@ var Broker_default = [
|
|
|
5639
5711
|
name: "poolId"
|
|
5640
5712
|
},
|
|
5641
5713
|
{
|
|
5642
|
-
type: "
|
|
5643
|
-
name: "
|
|
5714
|
+
type: "uint64",
|
|
5715
|
+
name: "userPositionSalt"
|
|
5644
5716
|
},
|
|
5645
5717
|
{
|
|
5646
5718
|
type: "uint8",
|
|
@@ -5742,43 +5814,91 @@ var Broker_default = [
|
|
|
5742
5814
|
},
|
|
5743
5815
|
{
|
|
5744
5816
|
type: "function",
|
|
5745
|
-
name: "
|
|
5817
|
+
name: "setSpecialFeeTier",
|
|
5746
5818
|
constant: false,
|
|
5747
5819
|
payable: false,
|
|
5748
5820
|
inputs: [
|
|
5749
5821
|
{
|
|
5750
|
-
type: "
|
|
5751
|
-
name: "
|
|
5822
|
+
type: "uint8",
|
|
5823
|
+
name: "feeTier"
|
|
5752
5824
|
},
|
|
5753
5825
|
{
|
|
5754
|
-
type: "
|
|
5755
|
-
name: "
|
|
5826
|
+
type: "int32",
|
|
5827
|
+
name: "makerFeeRate"
|
|
5756
5828
|
},
|
|
5829
|
+
{
|
|
5830
|
+
type: "uint32",
|
|
5831
|
+
name: "takerFeeRate"
|
|
5832
|
+
}
|
|
5833
|
+
],
|
|
5834
|
+
outputs: []
|
|
5835
|
+
},
|
|
5836
|
+
{
|
|
5837
|
+
type: "function",
|
|
5838
|
+
name: "setUserFeeData",
|
|
5839
|
+
constant: false,
|
|
5840
|
+
payable: false,
|
|
5841
|
+
inputs: [
|
|
5757
5842
|
{
|
|
5758
5843
|
type: "tuple",
|
|
5759
|
-
name: "
|
|
5844
|
+
name: "params",
|
|
5760
5845
|
components: [
|
|
5761
5846
|
{
|
|
5762
|
-
type: "
|
|
5763
|
-
name: "
|
|
5847
|
+
type: "address",
|
|
5848
|
+
name: "user"
|
|
5764
5849
|
},
|
|
5765
5850
|
{
|
|
5766
|
-
type: "
|
|
5767
|
-
name: "
|
|
5851
|
+
type: "uint64",
|
|
5852
|
+
name: "nonce"
|
|
5768
5853
|
},
|
|
5769
5854
|
{
|
|
5770
|
-
type: "
|
|
5771
|
-
name: "
|
|
5855
|
+
type: "uint64",
|
|
5856
|
+
name: "deadline"
|
|
5772
5857
|
},
|
|
5773
5858
|
{
|
|
5774
|
-
type: "
|
|
5775
|
-
name: "
|
|
5859
|
+
type: "tuple",
|
|
5860
|
+
name: "feeData",
|
|
5861
|
+
components: [
|
|
5862
|
+
{
|
|
5863
|
+
type: "uint8",
|
|
5864
|
+
name: "tier"
|
|
5865
|
+
},
|
|
5866
|
+
{
|
|
5867
|
+
type: "address",
|
|
5868
|
+
name: "referrer"
|
|
5869
|
+
},
|
|
5870
|
+
{
|
|
5871
|
+
type: "uint32",
|
|
5872
|
+
name: "totalReferralRebatePct"
|
|
5873
|
+
},
|
|
5874
|
+
{
|
|
5875
|
+
type: "uint32",
|
|
5876
|
+
name: "referrerRebatePct"
|
|
5877
|
+
}
|
|
5878
|
+
]
|
|
5879
|
+
},
|
|
5880
|
+
{
|
|
5881
|
+
type: "bytes",
|
|
5882
|
+
name: "signature"
|
|
5776
5883
|
}
|
|
5777
5884
|
]
|
|
5885
|
+
}
|
|
5886
|
+
],
|
|
5887
|
+
outputs: []
|
|
5888
|
+
},
|
|
5889
|
+
{
|
|
5890
|
+
type: "function",
|
|
5891
|
+
name: "setUserSpecialFeeTier",
|
|
5892
|
+
constant: false,
|
|
5893
|
+
payable: false,
|
|
5894
|
+
inputs: [
|
|
5895
|
+
{
|
|
5896
|
+
type: "address",
|
|
5897
|
+
name: "user"
|
|
5778
5898
|
},
|
|
5779
5899
|
{
|
|
5780
|
-
type: "
|
|
5781
|
-
name: "
|
|
5900
|
+
type: "uint8",
|
|
5901
|
+
name: "feeTier"
|
|
5782
5902
|
}
|
|
5783
5903
|
],
|
|
5784
5904
|
outputs: []
|
|
@@ -5809,6 +5929,19 @@ var Broker_default = [
|
|
|
5809
5929
|
],
|
|
5810
5930
|
outputs: []
|
|
5811
5931
|
},
|
|
5932
|
+
{
|
|
5933
|
+
type: "function",
|
|
5934
|
+
name: "trustedForwarder",
|
|
5935
|
+
constant: true,
|
|
5936
|
+
stateMutability: "view",
|
|
5937
|
+
payable: false,
|
|
5938
|
+
inputs: [],
|
|
5939
|
+
outputs: [
|
|
5940
|
+
{
|
|
5941
|
+
type: "address"
|
|
5942
|
+
}
|
|
5943
|
+
]
|
|
5944
|
+
},
|
|
5812
5945
|
{
|
|
5813
5946
|
type: "function",
|
|
5814
5947
|
name: "updateBaseFeeRates",
|
|
@@ -5998,7 +6131,7 @@ var Broker_default = [
|
|
|
5998
6131
|
]
|
|
5999
6132
|
},
|
|
6000
6133
|
{
|
|
6001
|
-
type: "
|
|
6134
|
+
type: "bytes32",
|
|
6002
6135
|
name: "positionId"
|
|
6003
6136
|
},
|
|
6004
6137
|
{
|
|
@@ -6043,6 +6176,25 @@ var Broker_default = [
|
|
|
6043
6176
|
}
|
|
6044
6177
|
]
|
|
6045
6178
|
},
|
|
6179
|
+
{
|
|
6180
|
+
type: "function",
|
|
6181
|
+
name: "userNonces",
|
|
6182
|
+
constant: true,
|
|
6183
|
+
stateMutability: "view",
|
|
6184
|
+
payable: false,
|
|
6185
|
+
inputs: [
|
|
6186
|
+
{
|
|
6187
|
+
type: "address",
|
|
6188
|
+
name: "user"
|
|
6189
|
+
}
|
|
6190
|
+
],
|
|
6191
|
+
outputs: [
|
|
6192
|
+
{
|
|
6193
|
+
type: "uint64",
|
|
6194
|
+
name: "nonce"
|
|
6195
|
+
}
|
|
6196
|
+
]
|
|
6197
|
+
},
|
|
6046
6198
|
{
|
|
6047
6199
|
type: "function",
|
|
6048
6200
|
name: "userRebates",
|
|
@@ -11858,6 +12010,7 @@ var ConfigManager = class {
|
|
|
11858
12010
|
};
|
|
11859
12011
|
}
|
|
11860
12012
|
auth(params) {
|
|
12013
|
+
this.clear();
|
|
11861
12014
|
this.config = {
|
|
11862
12015
|
...this.config,
|
|
11863
12016
|
...params
|
|
@@ -12468,7 +12621,7 @@ var Order = class {
|
|
|
12468
12621
|
console.log("createIncreaseOrder params--->", {
|
|
12469
12622
|
user: params.address,
|
|
12470
12623
|
poolId: params.poolId,
|
|
12471
|
-
|
|
12624
|
+
userPositionSalt: params.userPositionSalt,
|
|
12472
12625
|
orderType: params.orderType,
|
|
12473
12626
|
triggerType: params.triggerType,
|
|
12474
12627
|
operation: OperationType.INCREASE,
|
|
@@ -12490,7 +12643,7 @@ var Order = class {
|
|
|
12490
12643
|
const gasLimit = await brokerContract.placeOrder.estimateGas({
|
|
12491
12644
|
user: params.address,
|
|
12492
12645
|
poolId: params.poolId,
|
|
12493
|
-
|
|
12646
|
+
userPositionSalt: params.userPositionSalt,
|
|
12494
12647
|
orderType: params.orderType,
|
|
12495
12648
|
triggerType: params.triggerType,
|
|
12496
12649
|
operation: OperationType.INCREASE,
|
|
@@ -12513,7 +12666,7 @@ var Order = class {
|
|
|
12513
12666
|
{
|
|
12514
12667
|
user: params.address,
|
|
12515
12668
|
poolId: params.poolId,
|
|
12516
|
-
|
|
12669
|
+
userPositionSalt: params.userPositionSalt,
|
|
12517
12670
|
orderType: params.orderType,
|
|
12518
12671
|
triggerType: params.triggerType,
|
|
12519
12672
|
operation: OperationType.INCREASE,
|
|
@@ -12585,7 +12738,7 @@ var Order = class {
|
|
|
12585
12738
|
console.log("createDecreaseOrder params--->", {
|
|
12586
12739
|
user: params.address,
|
|
12587
12740
|
poolId: params.poolId,
|
|
12588
|
-
|
|
12741
|
+
userPositionSalt: params.userPositionSalt,
|
|
12589
12742
|
orderType: params.orderType,
|
|
12590
12743
|
triggerType: params.triggerType,
|
|
12591
12744
|
operation: OperationType.DECREASE,
|
|
@@ -12602,7 +12755,7 @@ var Order = class {
|
|
|
12602
12755
|
const gasLimit = await brokerContract.placeOrder.estimateGas({
|
|
12603
12756
|
user: params.address,
|
|
12604
12757
|
poolId: params.poolId,
|
|
12605
|
-
|
|
12758
|
+
userPositionSalt: params.userPositionSalt,
|
|
12606
12759
|
orderType: params.orderType,
|
|
12607
12760
|
triggerType: params.triggerType,
|
|
12608
12761
|
operation: OperationType.DECREASE,
|
|
@@ -12625,7 +12778,7 @@ var Order = class {
|
|
|
12625
12778
|
{
|
|
12626
12779
|
user: params.address,
|
|
12627
12780
|
poolId: params.poolId,
|
|
12628
|
-
|
|
12781
|
+
userPositionSalt: params.userPositionSalt,
|
|
12629
12782
|
orderType: params.orderType,
|
|
12630
12783
|
triggerType: params.triggerType,
|
|
12631
12784
|
operation: OperationType.DECREASE,
|
|
@@ -12700,7 +12853,7 @@ var Order = class {
|
|
|
12700
12853
|
{
|
|
12701
12854
|
user: params.address,
|
|
12702
12855
|
poolId: params.poolId,
|
|
12703
|
-
|
|
12856
|
+
userPositionSalt: params.userPositionSalt,
|
|
12704
12857
|
orderType: OrderType.STOP,
|
|
12705
12858
|
triggerType: params.tpTriggerType,
|
|
12706
12859
|
operation: OperationType.DECREASE,
|
|
@@ -12722,7 +12875,7 @@ var Order = class {
|
|
|
12722
12875
|
{
|
|
12723
12876
|
user: params.address,
|
|
12724
12877
|
poolId: params.poolId,
|
|
12725
|
-
|
|
12878
|
+
userPositionSalt: params.userPositionSalt,
|
|
12726
12879
|
orderType: OrderType.STOP,
|
|
12727
12880
|
triggerType: params.slTriggerType,
|
|
12728
12881
|
operation: OperationType.DECREASE,
|
|
@@ -12780,7 +12933,7 @@ var Order = class {
|
|
|
12780
12933
|
const data = {
|
|
12781
12934
|
user: params.address,
|
|
12782
12935
|
poolId: params.poolId,
|
|
12783
|
-
|
|
12936
|
+
userPositionSalt: params.userPositionSalt,
|
|
12784
12937
|
orderType: OrderType.STOP,
|
|
12785
12938
|
triggerType: params.tpSize !== "0" ? params.tpTriggerType : params.slTriggerType,
|
|
12786
12939
|
operation: OperationType.DECREASE,
|