@myx-trade/sdk 0.1.43 → 0.1.45
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 +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +454 -185
- package/dist/index.mjs +454 -185
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1378,7 +1378,7 @@ var ARB_TEST_SEPOLIA = {
|
|
|
1378
1378
|
POOL_MANAGER: "0xA4A1dfbe40cB725A79D34bd529f0C1b54AB46954",
|
|
1379
1379
|
Account: "0x6136899e8c77C452bc46AcD786aA2C09fD31f947",
|
|
1380
1380
|
POSITION_MANAGER: "0x002F28be205E9A1e279d2eeF1f5e472CeA1d910C",
|
|
1381
|
-
ORDER_MANAGER: "
|
|
1381
|
+
ORDER_MANAGER: "0x3A3C7c4588Fb2aE46A4108994a47712E03F96B23",
|
|
1382
1382
|
PYTH: "0x4374e5a8b9C22271E9EB878A2AA31DE97DF15DAF",
|
|
1383
1383
|
// !!! 非Pyth Adapter
|
|
1384
1384
|
ERC20: "0x7E248Ec1721639413A280d9E82e2862Cae2E6E28",
|
|
@@ -1728,7 +1728,7 @@ var RotationProvider = class extends BaseProvider {
|
|
|
1728
1728
|
// package.json
|
|
1729
1729
|
var package_default = {
|
|
1730
1730
|
name: "@myx-trade/sdk",
|
|
1731
|
-
version: "0.1.
|
|
1731
|
+
version: "0.1.45",
|
|
1732
1732
|
private: false,
|
|
1733
1733
|
publishConfig: {
|
|
1734
1734
|
access: "public"
|
|
@@ -13051,9 +13051,10 @@ var Order = class {
|
|
|
13051
13051
|
slPrice: params.slPrice ? params.slPrice : 0,
|
|
13052
13052
|
useAccountBalance: false
|
|
13053
13053
|
};
|
|
13054
|
+
this.logger.info("positionId", params.positionId);
|
|
13054
13055
|
let transaction;
|
|
13055
13056
|
if (!params.positionId) {
|
|
13056
|
-
const positionId =
|
|
13057
|
+
const positionId = 1;
|
|
13057
13058
|
this.logger.info("createIncreaseOrder salt position params--->", { ...data, positionId });
|
|
13058
13059
|
const gasLimit = await brokerContract.placeOrderWithSalt.estimateGas(positionId.toString(), {
|
|
13059
13060
|
user: params.address,
|
|
@@ -13240,7 +13241,7 @@ var Order = class {
|
|
|
13240
13241
|
};
|
|
13241
13242
|
let transaction;
|
|
13242
13243
|
if (!params.positionId) {
|
|
13243
|
-
const positionId =
|
|
13244
|
+
const positionId = 1;
|
|
13244
13245
|
this.logger.info("createDecreaseOrder salt position params--->", { ...data, positionId });
|
|
13245
13246
|
const gasLimit = await brokerContract.placeOrderWithPosition.estimateGas(positionId.toString(), {
|
|
13246
13247
|
user: params.address,
|
|
@@ -13436,7 +13437,7 @@ var Order = class {
|
|
|
13436
13437
|
let transaction2;
|
|
13437
13438
|
if (!params.positionId) {
|
|
13438
13439
|
this.logger.info("createPositionTpSlOrder salt position data--->", data2);
|
|
13439
|
-
const positionId =
|
|
13440
|
+
const positionId = 1;
|
|
13440
13441
|
const gasLimit = await brokerContract.placeOrdersWithSalt.estimateGas([positionId.toString(), positionId.toString()], data2);
|
|
13441
13442
|
transaction2 = await brokerContract.placeOrdersWithSalt([positionId.toString(), positionId.toString()], data2, {
|
|
13442
13443
|
gasLimit: gasLimit * 120n / 100n
|
|
@@ -13502,9 +13503,9 @@ var Order = class {
|
|
|
13502
13503
|
let transaction;
|
|
13503
13504
|
if (!params.positionId) {
|
|
13504
13505
|
this.logger.info("createPositionTpOrSlOrder salt position data--->", data);
|
|
13505
|
-
const positionId =
|
|
13506
|
-
const gasLimit = await brokerContract.
|
|
13507
|
-
transaction = await brokerContract.
|
|
13506
|
+
const positionId = 1;
|
|
13507
|
+
const gasLimit = await brokerContract.placeOrderWithSalt.estimateGas(positionId.toString(), data);
|
|
13508
|
+
transaction = await brokerContract.placeOrderWithSalt(positionId.toString(), data, {
|
|
13508
13509
|
gasLimit: gasLimit * 120n / 100n
|
|
13509
13510
|
});
|
|
13510
13511
|
} else {
|
|
@@ -13636,7 +13637,11 @@ var Order = class {
|
|
|
13636
13637
|
});
|
|
13637
13638
|
const receipt = await request?.wait();
|
|
13638
13639
|
this.logger.info("updateOrderTpSl receipt", receipt);
|
|
13639
|
-
return
|
|
13640
|
+
return {
|
|
13641
|
+
code: 0,
|
|
13642
|
+
data: receipt,
|
|
13643
|
+
message: "update order success"
|
|
13644
|
+
};
|
|
13640
13645
|
} catch (error) {
|
|
13641
13646
|
this.logger.error("Error updating order:", error);
|
|
13642
13647
|
return {
|
|
@@ -13764,33 +13769,6 @@ var Emiter_default = [
|
|
|
13764
13769
|
}
|
|
13765
13770
|
]
|
|
13766
13771
|
},
|
|
13767
|
-
{
|
|
13768
|
-
type: "event",
|
|
13769
|
-
anonymous: false,
|
|
13770
|
-
name: "AddOnFeeTierUpdated",
|
|
13771
|
-
inputs: [
|
|
13772
|
-
{
|
|
13773
|
-
type: "address",
|
|
13774
|
-
name: "broker",
|
|
13775
|
-
indexed: false
|
|
13776
|
-
},
|
|
13777
|
-
{
|
|
13778
|
-
type: "uint8",
|
|
13779
|
-
name: "tier",
|
|
13780
|
-
indexed: false
|
|
13781
|
-
},
|
|
13782
|
-
{
|
|
13783
|
-
type: "uint32",
|
|
13784
|
-
name: "takerFeeRate",
|
|
13785
|
-
indexed: false
|
|
13786
|
-
},
|
|
13787
|
-
{
|
|
13788
|
-
type: "uint32",
|
|
13789
|
-
name: "makerFeeRate",
|
|
13790
|
-
indexed: false
|
|
13791
|
-
}
|
|
13792
|
-
]
|
|
13793
|
-
},
|
|
13794
13772
|
{
|
|
13795
13773
|
type: "event",
|
|
13796
13774
|
anonymous: false,
|
|
@@ -13866,7 +13844,7 @@ var Emiter_default = [
|
|
|
13866
13844
|
indexed: false
|
|
13867
13845
|
},
|
|
13868
13846
|
{
|
|
13869
|
-
type: "
|
|
13847
|
+
type: "bytes32",
|
|
13870
13848
|
name: "positionId",
|
|
13871
13849
|
indexed: false
|
|
13872
13850
|
},
|
|
@@ -13977,7 +13955,7 @@ var Emiter_default = [
|
|
|
13977
13955
|
indexed: false
|
|
13978
13956
|
},
|
|
13979
13957
|
{
|
|
13980
|
-
type: "
|
|
13958
|
+
type: "int32",
|
|
13981
13959
|
name: "tradingFeeRate",
|
|
13982
13960
|
indexed: false
|
|
13983
13961
|
},
|
|
@@ -14133,6 +14111,11 @@ var Emiter_default = [
|
|
|
14133
14111
|
type: "bytes32",
|
|
14134
14112
|
name: "poolId",
|
|
14135
14113
|
indexed: false
|
|
14114
|
+
},
|
|
14115
|
+
{
|
|
14116
|
+
type: "string",
|
|
14117
|
+
name: "reason",
|
|
14118
|
+
indexed: false
|
|
14136
14119
|
}
|
|
14137
14120
|
]
|
|
14138
14121
|
},
|
|
@@ -14193,6 +14176,11 @@ var Emiter_default = [
|
|
|
14193
14176
|
name: "orderId",
|
|
14194
14177
|
indexed: false
|
|
14195
14178
|
},
|
|
14179
|
+
{
|
|
14180
|
+
type: "bytes32",
|
|
14181
|
+
name: "poolId",
|
|
14182
|
+
indexed: false
|
|
14183
|
+
},
|
|
14196
14184
|
{
|
|
14197
14185
|
type: "address",
|
|
14198
14186
|
name: "executor",
|
|
@@ -14285,7 +14273,7 @@ var Emiter_default = [
|
|
|
14285
14273
|
indexed: false
|
|
14286
14274
|
},
|
|
14287
14275
|
{
|
|
14288
|
-
type: "
|
|
14276
|
+
type: "bytes32",
|
|
14289
14277
|
name: "positionId",
|
|
14290
14278
|
indexed: false
|
|
14291
14279
|
},
|
|
@@ -14338,6 +14326,21 @@ var Emiter_default = [
|
|
|
14338
14326
|
type: "int256",
|
|
14339
14327
|
name: "fundingFee",
|
|
14340
14328
|
indexed: false
|
|
14329
|
+
},
|
|
14330
|
+
{
|
|
14331
|
+
type: "address",
|
|
14332
|
+
name: "executionFeeToken",
|
|
14333
|
+
indexed: false
|
|
14334
|
+
},
|
|
14335
|
+
{
|
|
14336
|
+
type: "uint256",
|
|
14337
|
+
name: "executionFeeAmount",
|
|
14338
|
+
indexed: false
|
|
14339
|
+
},
|
|
14340
|
+
{
|
|
14341
|
+
type: "address",
|
|
14342
|
+
name: "keeper",
|
|
14343
|
+
indexed: false
|
|
14341
14344
|
}
|
|
14342
14345
|
]
|
|
14343
14346
|
},
|
|
@@ -14399,7 +14402,7 @@ var Emiter_default = [
|
|
|
14399
14402
|
indexed: false
|
|
14400
14403
|
},
|
|
14401
14404
|
{
|
|
14402
|
-
type: "
|
|
14405
|
+
type: "bytes32",
|
|
14403
14406
|
name: "positionId",
|
|
14404
14407
|
indexed: false
|
|
14405
14408
|
},
|
|
@@ -15024,7 +15027,7 @@ var Emiter_default = [
|
|
|
15024
15027
|
indexed: false
|
|
15025
15028
|
},
|
|
15026
15029
|
{
|
|
15027
|
-
type: "
|
|
15030
|
+
type: "bytes32",
|
|
15028
15031
|
name: "positionId",
|
|
15029
15032
|
indexed: false
|
|
15030
15033
|
},
|
|
@@ -15071,7 +15074,7 @@ var Emiter_default = [
|
|
|
15071
15074
|
indexed: false
|
|
15072
15075
|
},
|
|
15073
15076
|
{
|
|
15074
|
-
type: "
|
|
15077
|
+
type: "bytes32",
|
|
15075
15078
|
name: "positionId",
|
|
15076
15079
|
indexed: false
|
|
15077
15080
|
},
|
|
@@ -15128,7 +15131,7 @@ var Emiter_default = [
|
|
|
15128
15131
|
indexed: false
|
|
15129
15132
|
},
|
|
15130
15133
|
{
|
|
15131
|
-
type: "
|
|
15134
|
+
type: "bytes32",
|
|
15132
15135
|
name: "positionId",
|
|
15133
15136
|
indexed: false
|
|
15134
15137
|
},
|
|
@@ -15154,6 +15157,43 @@ var Emiter_default = [
|
|
|
15154
15157
|
}
|
|
15155
15158
|
]
|
|
15156
15159
|
},
|
|
15160
|
+
{
|
|
15161
|
+
type: "event",
|
|
15162
|
+
anonymous: false,
|
|
15163
|
+
name: "PositionNFTMinted",
|
|
15164
|
+
inputs: [
|
|
15165
|
+
{
|
|
15166
|
+
type: "bytes32",
|
|
15167
|
+
name: "poolId",
|
|
15168
|
+
indexed: false
|
|
15169
|
+
},
|
|
15170
|
+
{
|
|
15171
|
+
type: "bytes32",
|
|
15172
|
+
name: "oldPositionId",
|
|
15173
|
+
indexed: false
|
|
15174
|
+
},
|
|
15175
|
+
{
|
|
15176
|
+
type: "bytes32",
|
|
15177
|
+
name: "newPositionId",
|
|
15178
|
+
indexed: false
|
|
15179
|
+
},
|
|
15180
|
+
{
|
|
15181
|
+
type: "uint256",
|
|
15182
|
+
name: "tokenId",
|
|
15183
|
+
indexed: false
|
|
15184
|
+
},
|
|
15185
|
+
{
|
|
15186
|
+
type: "address",
|
|
15187
|
+
name: "owner",
|
|
15188
|
+
indexed: false
|
|
15189
|
+
},
|
|
15190
|
+
{
|
|
15191
|
+
type: "address",
|
|
15192
|
+
name: "recipient",
|
|
15193
|
+
indexed: false
|
|
15194
|
+
}
|
|
15195
|
+
]
|
|
15196
|
+
},
|
|
15157
15197
|
{
|
|
15158
15198
|
type: "event",
|
|
15159
15199
|
anonymous: false,
|
|
@@ -15170,7 +15210,7 @@ var Emiter_default = [
|
|
|
15170
15210
|
indexed: false
|
|
15171
15211
|
},
|
|
15172
15212
|
{
|
|
15173
|
-
type: "
|
|
15213
|
+
type: "bytes32",
|
|
15174
15214
|
name: "positionId",
|
|
15175
15215
|
indexed: false
|
|
15176
15216
|
}
|
|
@@ -15192,7 +15232,7 @@ var Emiter_default = [
|
|
|
15192
15232
|
indexed: false
|
|
15193
15233
|
},
|
|
15194
15234
|
{
|
|
15195
|
-
type: "
|
|
15235
|
+
type: "bytes32",
|
|
15196
15236
|
name: "positionId",
|
|
15197
15237
|
indexed: false
|
|
15198
15238
|
},
|
|
@@ -15389,6 +15429,43 @@ var Emiter_default = [
|
|
|
15389
15429
|
}
|
|
15390
15430
|
]
|
|
15391
15431
|
},
|
|
15432
|
+
{
|
|
15433
|
+
type: "event",
|
|
15434
|
+
anonymous: false,
|
|
15435
|
+
name: "TradingFeeTierUpdated",
|
|
15436
|
+
inputs: [
|
|
15437
|
+
{
|
|
15438
|
+
type: "address",
|
|
15439
|
+
name: "broker",
|
|
15440
|
+
indexed: false
|
|
15441
|
+
},
|
|
15442
|
+
{
|
|
15443
|
+
type: "uint8",
|
|
15444
|
+
name: "feeType",
|
|
15445
|
+
indexed: false
|
|
15446
|
+
},
|
|
15447
|
+
{
|
|
15448
|
+
type: "uint8",
|
|
15449
|
+
name: "tier",
|
|
15450
|
+
indexed: false
|
|
15451
|
+
},
|
|
15452
|
+
{
|
|
15453
|
+
type: "uint32",
|
|
15454
|
+
name: "takerFeeRate",
|
|
15455
|
+
indexed: false
|
|
15456
|
+
},
|
|
15457
|
+
{
|
|
15458
|
+
type: "int32",
|
|
15459
|
+
name: "makerFeeRate",
|
|
15460
|
+
indexed: false
|
|
15461
|
+
},
|
|
15462
|
+
{
|
|
15463
|
+
type: "bool",
|
|
15464
|
+
name: "isEnabled",
|
|
15465
|
+
indexed: false
|
|
15466
|
+
}
|
|
15467
|
+
]
|
|
15468
|
+
},
|
|
15392
15469
|
{
|
|
15393
15470
|
type: "event",
|
|
15394
15471
|
anonymous: false,
|
|
@@ -15485,6 +15562,33 @@ var Emiter_default = [
|
|
|
15485
15562
|
}
|
|
15486
15563
|
]
|
|
15487
15564
|
},
|
|
15565
|
+
{
|
|
15566
|
+
type: "event",
|
|
15567
|
+
anonymous: false,
|
|
15568
|
+
name: "UserSpecialFeeTierUpdated",
|
|
15569
|
+
inputs: [
|
|
15570
|
+
{
|
|
15571
|
+
type: "address",
|
|
15572
|
+
name: "broker",
|
|
15573
|
+
indexed: false
|
|
15574
|
+
},
|
|
15575
|
+
{
|
|
15576
|
+
type: "address",
|
|
15577
|
+
name: "user",
|
|
15578
|
+
indexed: false
|
|
15579
|
+
},
|
|
15580
|
+
{
|
|
15581
|
+
type: "uint8",
|
|
15582
|
+
name: "oldTier",
|
|
15583
|
+
indexed: false
|
|
15584
|
+
},
|
|
15585
|
+
{
|
|
15586
|
+
type: "uint8",
|
|
15587
|
+
name: "newTier",
|
|
15588
|
+
indexed: false
|
|
15589
|
+
}
|
|
15590
|
+
]
|
|
15591
|
+
},
|
|
15488
15592
|
{
|
|
15489
15593
|
type: "function",
|
|
15490
15594
|
name: "UPGRADE_INTERFACE_VERSION",
|
|
@@ -15500,7 +15604,7 @@ var Emiter_default = [
|
|
|
15500
15604
|
},
|
|
15501
15605
|
{
|
|
15502
15606
|
type: "function",
|
|
15503
|
-
name: "
|
|
15607
|
+
name: "emitCollateralAccepted",
|
|
15504
15608
|
constant: false,
|
|
15505
15609
|
payable: false,
|
|
15506
15610
|
inputs: [
|
|
@@ -15509,20 +15613,28 @@ var Emiter_default = [
|
|
|
15509
15613
|
name: "params",
|
|
15510
15614
|
components: [
|
|
15511
15615
|
{
|
|
15512
|
-
type: "
|
|
15513
|
-
name: "
|
|
15616
|
+
type: "bytes32",
|
|
15617
|
+
name: "poolId"
|
|
15514
15618
|
},
|
|
15515
15619
|
{
|
|
15516
|
-
type: "
|
|
15517
|
-
name: "
|
|
15620
|
+
type: "uint256",
|
|
15621
|
+
name: "quoteDebt"
|
|
15518
15622
|
},
|
|
15519
15623
|
{
|
|
15520
|
-
type: "
|
|
15521
|
-
name: "
|
|
15624
|
+
type: "uint256",
|
|
15625
|
+
name: "baseCollateral"
|
|
15522
15626
|
},
|
|
15523
15627
|
{
|
|
15524
|
-
type: "
|
|
15525
|
-
name: "
|
|
15628
|
+
type: "uint256",
|
|
15629
|
+
name: "quoteCollateral"
|
|
15630
|
+
},
|
|
15631
|
+
{
|
|
15632
|
+
type: "uint256",
|
|
15633
|
+
name: "totalQuoteDebt"
|
|
15634
|
+
},
|
|
15635
|
+
{
|
|
15636
|
+
type: "uint256",
|
|
15637
|
+
name: "totalBaseCollateral"
|
|
15526
15638
|
}
|
|
15527
15639
|
]
|
|
15528
15640
|
}
|
|
@@ -15531,7 +15643,7 @@ var Emiter_default = [
|
|
|
15531
15643
|
},
|
|
15532
15644
|
{
|
|
15533
15645
|
type: "function",
|
|
15534
|
-
name: "
|
|
15646
|
+
name: "emitCollateralAdjusted",
|
|
15535
15647
|
constant: false,
|
|
15536
15648
|
payable: false,
|
|
15537
15649
|
inputs: [
|
|
@@ -15540,28 +15652,28 @@ var Emiter_default = [
|
|
|
15540
15652
|
name: "params",
|
|
15541
15653
|
components: [
|
|
15542
15654
|
{
|
|
15543
|
-
type: "
|
|
15544
|
-
name: "
|
|
15655
|
+
type: "address",
|
|
15656
|
+
name: "user"
|
|
15545
15657
|
},
|
|
15546
15658
|
{
|
|
15547
|
-
type: "
|
|
15548
|
-
name: "
|
|
15659
|
+
type: "bytes32",
|
|
15660
|
+
name: "poolId"
|
|
15549
15661
|
},
|
|
15550
15662
|
{
|
|
15551
|
-
type: "
|
|
15552
|
-
name: "
|
|
15663
|
+
type: "bytes32",
|
|
15664
|
+
name: "positionId"
|
|
15553
15665
|
},
|
|
15554
15666
|
{
|
|
15555
|
-
type: "
|
|
15556
|
-
name: "
|
|
15667
|
+
type: "uint8",
|
|
15668
|
+
name: "direction"
|
|
15557
15669
|
},
|
|
15558
15670
|
{
|
|
15559
15671
|
type: "uint256",
|
|
15560
|
-
name: "
|
|
15672
|
+
name: "beforeCollateralAmount"
|
|
15561
15673
|
},
|
|
15562
15674
|
{
|
|
15563
15675
|
type: "uint256",
|
|
15564
|
-
name: "
|
|
15676
|
+
name: "afterCollateralAmount"
|
|
15565
15677
|
}
|
|
15566
15678
|
]
|
|
15567
15679
|
}
|
|
@@ -15741,6 +15853,10 @@ var Emiter_default = [
|
|
|
15741
15853
|
{
|
|
15742
15854
|
type: "bytes32",
|
|
15743
15855
|
name: "poolId"
|
|
15856
|
+
},
|
|
15857
|
+
{
|
|
15858
|
+
type: "string",
|
|
15859
|
+
name: "reason"
|
|
15744
15860
|
}
|
|
15745
15861
|
]
|
|
15746
15862
|
}
|
|
@@ -15808,6 +15924,10 @@ var Emiter_default = [
|
|
|
15808
15924
|
type: "uint256",
|
|
15809
15925
|
name: "orderId"
|
|
15810
15926
|
},
|
|
15927
|
+
{
|
|
15928
|
+
type: "bytes32",
|
|
15929
|
+
name: "poolId"
|
|
15930
|
+
},
|
|
15811
15931
|
{
|
|
15812
15932
|
type: "address",
|
|
15813
15933
|
name: "executor"
|
|
@@ -15910,7 +16030,7 @@ var Emiter_default = [
|
|
|
15910
16030
|
name: "poolId"
|
|
15911
16031
|
},
|
|
15912
16032
|
{
|
|
15913
|
-
type: "
|
|
16033
|
+
type: "bytes32",
|
|
15914
16034
|
name: "positionId"
|
|
15915
16035
|
},
|
|
15916
16036
|
{
|
|
@@ -15952,6 +16072,18 @@ var Emiter_default = [
|
|
|
15952
16072
|
{
|
|
15953
16073
|
type: "int256",
|
|
15954
16074
|
name: "fundingFee"
|
|
16075
|
+
},
|
|
16076
|
+
{
|
|
16077
|
+
type: "address",
|
|
16078
|
+
name: "executionFeeToken"
|
|
16079
|
+
},
|
|
16080
|
+
{
|
|
16081
|
+
type: "uint256",
|
|
16082
|
+
name: "executionFeeAmount"
|
|
16083
|
+
},
|
|
16084
|
+
{
|
|
16085
|
+
type: "address",
|
|
16086
|
+
name: "keeper"
|
|
15955
16087
|
}
|
|
15956
16088
|
]
|
|
15957
16089
|
}
|
|
@@ -16020,7 +16152,7 @@ var Emiter_default = [
|
|
|
16020
16152
|
name: "poolId"
|
|
16021
16153
|
},
|
|
16022
16154
|
{
|
|
16023
|
-
type: "
|
|
16155
|
+
type: "bytes32",
|
|
16024
16156
|
name: "positionId"
|
|
16025
16157
|
},
|
|
16026
16158
|
{
|
|
@@ -16669,7 +16801,7 @@ var Emiter_default = [
|
|
|
16669
16801
|
name: "poolId"
|
|
16670
16802
|
},
|
|
16671
16803
|
{
|
|
16672
|
-
type: "
|
|
16804
|
+
type: "bytes32",
|
|
16673
16805
|
name: "positionId"
|
|
16674
16806
|
},
|
|
16675
16807
|
{
|
|
@@ -16716,7 +16848,7 @@ var Emiter_default = [
|
|
|
16716
16848
|
name: "poolId"
|
|
16717
16849
|
},
|
|
16718
16850
|
{
|
|
16719
|
-
type: "
|
|
16851
|
+
type: "bytes32",
|
|
16720
16852
|
name: "positionId"
|
|
16721
16853
|
},
|
|
16722
16854
|
{
|
|
@@ -16763,7 +16895,7 @@ var Emiter_default = [
|
|
|
16763
16895
|
name: "poolId"
|
|
16764
16896
|
},
|
|
16765
16897
|
{
|
|
16766
|
-
type: "
|
|
16898
|
+
type: "bytes32",
|
|
16767
16899
|
name: "positionId"
|
|
16768
16900
|
},
|
|
16769
16901
|
{
|
|
@@ -16789,7 +16921,7 @@ var Emiter_default = [
|
|
|
16789
16921
|
},
|
|
16790
16922
|
{
|
|
16791
16923
|
type: "function",
|
|
16792
|
-
name: "
|
|
16924
|
+
name: "emitPositionNFTMinted",
|
|
16793
16925
|
constant: false,
|
|
16794
16926
|
payable: false,
|
|
16795
16927
|
inputs: [
|
|
@@ -16798,21 +16930,60 @@ var Emiter_default = [
|
|
|
16798
16930
|
name: "params",
|
|
16799
16931
|
components: [
|
|
16800
16932
|
{
|
|
16801
|
-
type: "
|
|
16802
|
-
name: "
|
|
16933
|
+
type: "bytes32",
|
|
16934
|
+
name: "poolId"
|
|
16803
16935
|
},
|
|
16804
16936
|
{
|
|
16805
|
-
type: "
|
|
16806
|
-
name: "
|
|
16937
|
+
type: "bytes32",
|
|
16938
|
+
name: "oldPositionId"
|
|
16939
|
+
},
|
|
16940
|
+
{
|
|
16941
|
+
type: "bytes32",
|
|
16942
|
+
name: "newPositionId"
|
|
16807
16943
|
},
|
|
16808
16944
|
{
|
|
16809
16945
|
type: "uint256",
|
|
16810
|
-
name: "
|
|
16811
|
-
}
|
|
16812
|
-
|
|
16813
|
-
|
|
16814
|
-
|
|
16815
|
-
|
|
16946
|
+
name: "tokenId"
|
|
16947
|
+
},
|
|
16948
|
+
{
|
|
16949
|
+
type: "address",
|
|
16950
|
+
name: "owner"
|
|
16951
|
+
},
|
|
16952
|
+
{
|
|
16953
|
+
type: "address",
|
|
16954
|
+
name: "recipient"
|
|
16955
|
+
}
|
|
16956
|
+
]
|
|
16957
|
+
}
|
|
16958
|
+
],
|
|
16959
|
+
outputs: []
|
|
16960
|
+
},
|
|
16961
|
+
{
|
|
16962
|
+
type: "function",
|
|
16963
|
+
name: "emitPositionTransfer",
|
|
16964
|
+
constant: false,
|
|
16965
|
+
payable: false,
|
|
16966
|
+
inputs: [
|
|
16967
|
+
{
|
|
16968
|
+
type: "tuple",
|
|
16969
|
+
name: "params",
|
|
16970
|
+
components: [
|
|
16971
|
+
{
|
|
16972
|
+
type: "address",
|
|
16973
|
+
name: "from"
|
|
16974
|
+
},
|
|
16975
|
+
{
|
|
16976
|
+
type: "address",
|
|
16977
|
+
name: "to"
|
|
16978
|
+
},
|
|
16979
|
+
{
|
|
16980
|
+
type: "bytes32",
|
|
16981
|
+
name: "positionId"
|
|
16982
|
+
}
|
|
16983
|
+
]
|
|
16984
|
+
}
|
|
16985
|
+
],
|
|
16986
|
+
outputs: []
|
|
16816
16987
|
},
|
|
16817
16988
|
{
|
|
16818
16989
|
type: "function",
|
|
@@ -16833,7 +17004,7 @@ var Emiter_default = [
|
|
|
16833
17004
|
name: "owner"
|
|
16834
17005
|
},
|
|
16835
17006
|
{
|
|
16836
|
-
type: "
|
|
17007
|
+
type: "bytes32",
|
|
16837
17008
|
name: "positionId"
|
|
16838
17009
|
},
|
|
16839
17010
|
{
|
|
@@ -17022,6 +17193,45 @@ var Emiter_default = [
|
|
|
17022
17193
|
],
|
|
17023
17194
|
outputs: []
|
|
17024
17195
|
},
|
|
17196
|
+
{
|
|
17197
|
+
type: "function",
|
|
17198
|
+
name: "emitTradingFeeTierUpdated",
|
|
17199
|
+
constant: false,
|
|
17200
|
+
payable: false,
|
|
17201
|
+
inputs: [
|
|
17202
|
+
{
|
|
17203
|
+
type: "tuple",
|
|
17204
|
+
name: "params",
|
|
17205
|
+
components: [
|
|
17206
|
+
{
|
|
17207
|
+
type: "address",
|
|
17208
|
+
name: "broker"
|
|
17209
|
+
},
|
|
17210
|
+
{
|
|
17211
|
+
type: "uint8",
|
|
17212
|
+
name: "feeType"
|
|
17213
|
+
},
|
|
17214
|
+
{
|
|
17215
|
+
type: "uint8",
|
|
17216
|
+
name: "tier"
|
|
17217
|
+
},
|
|
17218
|
+
{
|
|
17219
|
+
type: "uint32",
|
|
17220
|
+
name: "takerFeeRate"
|
|
17221
|
+
},
|
|
17222
|
+
{
|
|
17223
|
+
type: "int32",
|
|
17224
|
+
name: "makerFeeRate"
|
|
17225
|
+
},
|
|
17226
|
+
{
|
|
17227
|
+
type: "bool",
|
|
17228
|
+
name: "isEnabled"
|
|
17229
|
+
}
|
|
17230
|
+
]
|
|
17231
|
+
}
|
|
17232
|
+
],
|
|
17233
|
+
outputs: []
|
|
17234
|
+
},
|
|
17025
17235
|
{
|
|
17026
17236
|
type: "function",
|
|
17027
17237
|
name: "emitUserFeeDataUpdated",
|
|
@@ -17104,7 +17314,7 @@ var Emiter_default = [
|
|
|
17104
17314
|
name: "fundingFee"
|
|
17105
17315
|
},
|
|
17106
17316
|
{
|
|
17107
|
-
type: "
|
|
17317
|
+
type: "int32",
|
|
17108
17318
|
name: "tradingFeeRate"
|
|
17109
17319
|
},
|
|
17110
17320
|
{
|
|
@@ -17146,29 +17356,42 @@ var Emiter_default = [
|
|
|
17146
17356
|
},
|
|
17147
17357
|
{
|
|
17148
17358
|
type: "function",
|
|
17149
|
-
name: "
|
|
17150
|
-
constant:
|
|
17151
|
-
stateMutability: "view",
|
|
17359
|
+
name: "emitUserSpecialFeeTierUpdated",
|
|
17360
|
+
constant: false,
|
|
17152
17361
|
payable: false,
|
|
17153
|
-
inputs: [
|
|
17154
|
-
outputs: [
|
|
17362
|
+
inputs: [
|
|
17155
17363
|
{
|
|
17156
|
-
type: "
|
|
17364
|
+
type: "tuple",
|
|
17365
|
+
name: "params",
|
|
17366
|
+
components: [
|
|
17367
|
+
{
|
|
17368
|
+
type: "address",
|
|
17369
|
+
name: "broker"
|
|
17370
|
+
},
|
|
17371
|
+
{
|
|
17372
|
+
type: "address",
|
|
17373
|
+
name: "user"
|
|
17374
|
+
},
|
|
17375
|
+
{
|
|
17376
|
+
type: "uint8",
|
|
17377
|
+
name: "oldTier"
|
|
17378
|
+
},
|
|
17379
|
+
{
|
|
17380
|
+
type: "uint8",
|
|
17381
|
+
name: "newTier"
|
|
17382
|
+
}
|
|
17383
|
+
]
|
|
17157
17384
|
}
|
|
17158
|
-
]
|
|
17385
|
+
],
|
|
17386
|
+
outputs: []
|
|
17159
17387
|
},
|
|
17160
17388
|
{
|
|
17161
17389
|
type: "function",
|
|
17162
|
-
name: "
|
|
17390
|
+
name: "getAddressManager",
|
|
17163
17391
|
constant: true,
|
|
17164
17392
|
stateMutability: "view",
|
|
17165
17393
|
payable: false,
|
|
17166
|
-
inputs: [
|
|
17167
|
-
{
|
|
17168
|
-
type: "bytes32",
|
|
17169
|
-
name: "identifier"
|
|
17170
|
-
}
|
|
17171
|
-
],
|
|
17394
|
+
inputs: [],
|
|
17172
17395
|
outputs: [
|
|
17173
17396
|
{
|
|
17174
17397
|
type: "address"
|
|
@@ -17177,19 +17400,19 @@ var Emiter_default = [
|
|
|
17177
17400
|
},
|
|
17178
17401
|
{
|
|
17179
17402
|
type: "function",
|
|
17180
|
-
name: "
|
|
17403
|
+
name: "getDependencyAddress",
|
|
17181
17404
|
constant: true,
|
|
17182
17405
|
stateMutability: "view",
|
|
17183
17406
|
payable: false,
|
|
17184
17407
|
inputs: [
|
|
17185
17408
|
{
|
|
17186
|
-
type: "
|
|
17187
|
-
name: "
|
|
17409
|
+
type: "bytes32",
|
|
17410
|
+
name: "identifier"
|
|
17188
17411
|
}
|
|
17189
17412
|
],
|
|
17190
17413
|
outputs: [
|
|
17191
17414
|
{
|
|
17192
|
-
type: "
|
|
17415
|
+
type: "address"
|
|
17193
17416
|
}
|
|
17194
17417
|
]
|
|
17195
17418
|
},
|
|
@@ -17263,19 +17486,6 @@ var Emiter_default = [
|
|
|
17263
17486
|
],
|
|
17264
17487
|
outputs: []
|
|
17265
17488
|
},
|
|
17266
|
-
{
|
|
17267
|
-
type: "function",
|
|
17268
|
-
name: "registerDependencies",
|
|
17269
|
-
constant: false,
|
|
17270
|
-
payable: false,
|
|
17271
|
-
inputs: [
|
|
17272
|
-
{
|
|
17273
|
-
type: "bytes32[]",
|
|
17274
|
-
name: "identifiers"
|
|
17275
|
-
}
|
|
17276
|
-
],
|
|
17277
|
-
outputs: []
|
|
17278
|
-
},
|
|
17279
17489
|
{
|
|
17280
17490
|
type: "function",
|
|
17281
17491
|
name: "sequencer",
|
|
@@ -17289,36 +17499,6 @@ var Emiter_default = [
|
|
|
17289
17499
|
}
|
|
17290
17500
|
]
|
|
17291
17501
|
},
|
|
17292
|
-
{
|
|
17293
|
-
type: "function",
|
|
17294
|
-
name: "unregisterDependencies",
|
|
17295
|
-
constant: false,
|
|
17296
|
-
payable: false,
|
|
17297
|
-
inputs: [
|
|
17298
|
-
{
|
|
17299
|
-
type: "bytes32[]",
|
|
17300
|
-
name: "identifiers"
|
|
17301
|
-
}
|
|
17302
|
-
],
|
|
17303
|
-
outputs: []
|
|
17304
|
-
},
|
|
17305
|
-
{
|
|
17306
|
-
type: "function",
|
|
17307
|
-
name: "update",
|
|
17308
|
-
constant: false,
|
|
17309
|
-
payable: false,
|
|
17310
|
-
inputs: [
|
|
17311
|
-
{
|
|
17312
|
-
type: "bytes32",
|
|
17313
|
-
name: "identifier"
|
|
17314
|
-
},
|
|
17315
|
-
{
|
|
17316
|
-
type: "address",
|
|
17317
|
-
name: "newAddress"
|
|
17318
|
-
}
|
|
17319
|
-
],
|
|
17320
|
-
outputs: []
|
|
17321
|
-
},
|
|
17322
17502
|
{
|
|
17323
17503
|
type: "function",
|
|
17324
17504
|
name: "upgradeTo",
|
|
@@ -17662,6 +17842,11 @@ var Account_default = [
|
|
|
17662
17842
|
name: "InvalidInitialization",
|
|
17663
17843
|
inputs: []
|
|
17664
17844
|
},
|
|
17845
|
+
{
|
|
17846
|
+
type: "error",
|
|
17847
|
+
name: "NotAddressManager",
|
|
17848
|
+
inputs: []
|
|
17849
|
+
},
|
|
17665
17850
|
{
|
|
17666
17851
|
type: "error",
|
|
17667
17852
|
name: "NotDependencyManager",
|
|
@@ -17871,6 +18056,19 @@ var Account_default = [
|
|
|
17871
18056
|
}
|
|
17872
18057
|
]
|
|
17873
18058
|
},
|
|
18059
|
+
{
|
|
18060
|
+
type: "function",
|
|
18061
|
+
name: "__ERC2771ContextUpgradeable_init",
|
|
18062
|
+
constant: false,
|
|
18063
|
+
payable: false,
|
|
18064
|
+
inputs: [
|
|
18065
|
+
{
|
|
18066
|
+
type: "address",
|
|
18067
|
+
name: "trustedForwarder_"
|
|
18068
|
+
}
|
|
18069
|
+
],
|
|
18070
|
+
outputs: []
|
|
18071
|
+
},
|
|
17874
18072
|
{
|
|
17875
18073
|
type: "function",
|
|
17876
18074
|
name: "deposit",
|
|
@@ -17923,24 +18121,6 @@ var Account_default = [
|
|
|
17923
18121
|
}
|
|
17924
18122
|
]
|
|
17925
18123
|
},
|
|
17926
|
-
{
|
|
17927
|
-
type: "function",
|
|
17928
|
-
name: "getDependencyIdentifier",
|
|
17929
|
-
constant: true,
|
|
17930
|
-
stateMutability: "view",
|
|
17931
|
-
payable: false,
|
|
17932
|
-
inputs: [
|
|
17933
|
-
{
|
|
17934
|
-
type: "address",
|
|
17935
|
-
name: "contractAddress"
|
|
17936
|
-
}
|
|
17937
|
-
],
|
|
17938
|
-
outputs: [
|
|
17939
|
-
{
|
|
17940
|
-
type: "bytes32"
|
|
17941
|
-
}
|
|
17942
|
-
]
|
|
17943
|
-
},
|
|
17944
18124
|
{
|
|
17945
18125
|
type: "function",
|
|
17946
18126
|
name: "getImplementation",
|
|
@@ -17982,6 +18162,28 @@ var Account_default = [
|
|
|
17982
18162
|
}
|
|
17983
18163
|
]
|
|
17984
18164
|
},
|
|
18165
|
+
{
|
|
18166
|
+
type: "function",
|
|
18167
|
+
name: "getUserAsset",
|
|
18168
|
+
constant: true,
|
|
18169
|
+
stateMutability: "view",
|
|
18170
|
+
payable: false,
|
|
18171
|
+
inputs: [
|
|
18172
|
+
{
|
|
18173
|
+
type: "address",
|
|
18174
|
+
name: "account"
|
|
18175
|
+
},
|
|
18176
|
+
{
|
|
18177
|
+
type: "bytes32",
|
|
18178
|
+
name: "marketId"
|
|
18179
|
+
}
|
|
18180
|
+
],
|
|
18181
|
+
outputs: [
|
|
18182
|
+
{
|
|
18183
|
+
type: "uint256"
|
|
18184
|
+
}
|
|
18185
|
+
]
|
|
18186
|
+
},
|
|
17985
18187
|
{
|
|
17986
18188
|
type: "function",
|
|
17987
18189
|
name: "getUserAssets",
|
|
@@ -18023,6 +18225,24 @@ var Account_default = [
|
|
|
18023
18225
|
],
|
|
18024
18226
|
outputs: []
|
|
18025
18227
|
},
|
|
18228
|
+
{
|
|
18229
|
+
type: "function",
|
|
18230
|
+
name: "isTrustedForwarder",
|
|
18231
|
+
constant: true,
|
|
18232
|
+
stateMutability: "view",
|
|
18233
|
+
payable: false,
|
|
18234
|
+
inputs: [
|
|
18235
|
+
{
|
|
18236
|
+
type: "address",
|
|
18237
|
+
name: "forwarder"
|
|
18238
|
+
}
|
|
18239
|
+
],
|
|
18240
|
+
outputs: [
|
|
18241
|
+
{
|
|
18242
|
+
type: "bool"
|
|
18243
|
+
}
|
|
18244
|
+
]
|
|
18245
|
+
},
|
|
18026
18246
|
{
|
|
18027
18247
|
type: "function",
|
|
18028
18248
|
name: "payWithPrincipal",
|
|
@@ -18087,19 +18307,6 @@ var Account_default = [
|
|
|
18087
18307
|
}
|
|
18088
18308
|
]
|
|
18089
18309
|
},
|
|
18090
|
-
{
|
|
18091
|
-
type: "function",
|
|
18092
|
-
name: "registerDependencies",
|
|
18093
|
-
constant: false,
|
|
18094
|
-
payable: false,
|
|
18095
|
-
inputs: [
|
|
18096
|
-
{
|
|
18097
|
-
type: "bytes32[]",
|
|
18098
|
-
name: "identifiers"
|
|
18099
|
-
}
|
|
18100
|
-
],
|
|
18101
|
-
outputs: []
|
|
18102
|
-
},
|
|
18103
18310
|
{
|
|
18104
18311
|
type: "function",
|
|
18105
18312
|
name: "releaseFromProfitUnlock",
|
|
@@ -18136,8 +18343,66 @@ var Account_default = [
|
|
|
18136
18343
|
name: "user"
|
|
18137
18344
|
},
|
|
18138
18345
|
{
|
|
18139
|
-
type: "
|
|
18140
|
-
name: "
|
|
18346
|
+
type: "tuple",
|
|
18347
|
+
name: "pool",
|
|
18348
|
+
components: [
|
|
18349
|
+
{
|
|
18350
|
+
type: "bytes32",
|
|
18351
|
+
name: "marketId"
|
|
18352
|
+
},
|
|
18353
|
+
{
|
|
18354
|
+
type: "bytes32",
|
|
18355
|
+
name: "poolId"
|
|
18356
|
+
},
|
|
18357
|
+
{
|
|
18358
|
+
type: "address",
|
|
18359
|
+
name: "baseToken"
|
|
18360
|
+
},
|
|
18361
|
+
{
|
|
18362
|
+
type: "address",
|
|
18363
|
+
name: "quoteToken"
|
|
18364
|
+
},
|
|
18365
|
+
{
|
|
18366
|
+
type: "uint8",
|
|
18367
|
+
name: "riskTier"
|
|
18368
|
+
},
|
|
18369
|
+
{
|
|
18370
|
+
type: "uint8",
|
|
18371
|
+
name: "state"
|
|
18372
|
+
},
|
|
18373
|
+
{
|
|
18374
|
+
type: "address",
|
|
18375
|
+
name: "basePoolToken"
|
|
18376
|
+
},
|
|
18377
|
+
{
|
|
18378
|
+
type: "address",
|
|
18379
|
+
name: "quotePoolToken"
|
|
18380
|
+
},
|
|
18381
|
+
{
|
|
18382
|
+
type: "uint16",
|
|
18383
|
+
name: "maxPriceDeviation"
|
|
18384
|
+
},
|
|
18385
|
+
{
|
|
18386
|
+
type: "bool",
|
|
18387
|
+
name: "compoundEnabled"
|
|
18388
|
+
},
|
|
18389
|
+
{
|
|
18390
|
+
type: "uint64",
|
|
18391
|
+
name: "windowCapUsd"
|
|
18392
|
+
},
|
|
18393
|
+
{
|
|
18394
|
+
type: "address",
|
|
18395
|
+
name: "poolVault"
|
|
18396
|
+
},
|
|
18397
|
+
{
|
|
18398
|
+
type: "address",
|
|
18399
|
+
name: "settler"
|
|
18400
|
+
},
|
|
18401
|
+
{
|
|
18402
|
+
type: "address",
|
|
18403
|
+
name: "tradingVault"
|
|
18404
|
+
}
|
|
18405
|
+
]
|
|
18141
18406
|
},
|
|
18142
18407
|
{
|
|
18143
18408
|
type: "uint256",
|
|
@@ -18160,16 +18425,16 @@ var Account_default = [
|
|
|
18160
18425
|
},
|
|
18161
18426
|
{
|
|
18162
18427
|
type: "function",
|
|
18163
|
-
name: "
|
|
18164
|
-
constant:
|
|
18428
|
+
name: "trustedForwarder",
|
|
18429
|
+
constant: true,
|
|
18430
|
+
stateMutability: "view",
|
|
18165
18431
|
payable: false,
|
|
18166
|
-
inputs: [
|
|
18432
|
+
inputs: [],
|
|
18433
|
+
outputs: [
|
|
18167
18434
|
{
|
|
18168
|
-
type: "
|
|
18169
|
-
name: "identifiers"
|
|
18435
|
+
type: "address"
|
|
18170
18436
|
}
|
|
18171
|
-
]
|
|
18172
|
-
outputs: []
|
|
18437
|
+
]
|
|
18173
18438
|
},
|
|
18174
18439
|
{
|
|
18175
18440
|
type: "function",
|
|
@@ -18221,6 +18486,10 @@ var Account_default = [
|
|
|
18221
18486
|
type: "address",
|
|
18222
18487
|
name: "receiver"
|
|
18223
18488
|
},
|
|
18489
|
+
{
|
|
18490
|
+
type: "bool",
|
|
18491
|
+
name: "isQuoteToken"
|
|
18492
|
+
},
|
|
18224
18493
|
{
|
|
18225
18494
|
type: "uint256",
|
|
18226
18495
|
name: "amount"
|
|
@@ -18841,7 +19110,7 @@ var Account = class {
|
|
|
18841
19110
|
try {
|
|
18842
19111
|
const account = await config.signer?.getAddress() ?? "";
|
|
18843
19112
|
console.log("withdraw", account, amount, poolId);
|
|
18844
|
-
const rs = await accountContract.withdraw(poolId, account, amount);
|
|
19113
|
+
const rs = await accountContract.withdraw(poolId, account, true, amount);
|
|
18845
19114
|
const receipt = await rs?.wait(1);
|
|
18846
19115
|
return {
|
|
18847
19116
|
code: 0,
|