@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.js
CHANGED
|
@@ -1469,7 +1469,7 @@ var ARB_TEST_SEPOLIA = {
|
|
|
1469
1469
|
POOL_MANAGER: "0xA4A1dfbe40cB725A79D34bd529f0C1b54AB46954",
|
|
1470
1470
|
Account: "0x6136899e8c77C452bc46AcD786aA2C09fD31f947",
|
|
1471
1471
|
POSITION_MANAGER: "0x002F28be205E9A1e279d2eeF1f5e472CeA1d910C",
|
|
1472
|
-
ORDER_MANAGER: "
|
|
1472
|
+
ORDER_MANAGER: "0x3A3C7c4588Fb2aE46A4108994a47712E03F96B23",
|
|
1473
1473
|
PYTH: "0x4374e5a8b9C22271E9EB878A2AA31DE97DF15DAF",
|
|
1474
1474
|
// !!! 非Pyth Adapter
|
|
1475
1475
|
ERC20: "0x7E248Ec1721639413A280d9E82e2862Cae2E6E28",
|
|
@@ -1813,7 +1813,7 @@ var RotationProvider = class extends import_providers.BaseProvider {
|
|
|
1813
1813
|
// package.json
|
|
1814
1814
|
var package_default = {
|
|
1815
1815
|
name: "@myx-trade/sdk",
|
|
1816
|
-
version: "0.1.
|
|
1816
|
+
version: "0.1.45",
|
|
1817
1817
|
private: false,
|
|
1818
1818
|
publishConfig: {
|
|
1819
1819
|
access: "public"
|
|
@@ -13136,9 +13136,10 @@ var Order = class {
|
|
|
13136
13136
|
slPrice: params.slPrice ? params.slPrice : 0,
|
|
13137
13137
|
useAccountBalance: false
|
|
13138
13138
|
};
|
|
13139
|
+
this.logger.info("positionId", params.positionId);
|
|
13139
13140
|
let transaction;
|
|
13140
13141
|
if (!params.positionId) {
|
|
13141
|
-
const positionId =
|
|
13142
|
+
const positionId = 1;
|
|
13142
13143
|
this.logger.info("createIncreaseOrder salt position params--->", { ...data, positionId });
|
|
13143
13144
|
const gasLimit = await brokerContract.placeOrderWithSalt.estimateGas(positionId.toString(), {
|
|
13144
13145
|
user: params.address,
|
|
@@ -13325,7 +13326,7 @@ var Order = class {
|
|
|
13325
13326
|
};
|
|
13326
13327
|
let transaction;
|
|
13327
13328
|
if (!params.positionId) {
|
|
13328
|
-
const positionId =
|
|
13329
|
+
const positionId = 1;
|
|
13329
13330
|
this.logger.info("createDecreaseOrder salt position params--->", { ...data, positionId });
|
|
13330
13331
|
const gasLimit = await brokerContract.placeOrderWithPosition.estimateGas(positionId.toString(), {
|
|
13331
13332
|
user: params.address,
|
|
@@ -13521,7 +13522,7 @@ var Order = class {
|
|
|
13521
13522
|
let transaction2;
|
|
13522
13523
|
if (!params.positionId) {
|
|
13523
13524
|
this.logger.info("createPositionTpSlOrder salt position data--->", data2);
|
|
13524
|
-
const positionId =
|
|
13525
|
+
const positionId = 1;
|
|
13525
13526
|
const gasLimit = await brokerContract.placeOrdersWithSalt.estimateGas([positionId.toString(), positionId.toString()], data2);
|
|
13526
13527
|
transaction2 = await brokerContract.placeOrdersWithSalt([positionId.toString(), positionId.toString()], data2, {
|
|
13527
13528
|
gasLimit: gasLimit * 120n / 100n
|
|
@@ -13587,9 +13588,9 @@ var Order = class {
|
|
|
13587
13588
|
let transaction;
|
|
13588
13589
|
if (!params.positionId) {
|
|
13589
13590
|
this.logger.info("createPositionTpOrSlOrder salt position data--->", data);
|
|
13590
|
-
const positionId =
|
|
13591
|
-
const gasLimit = await brokerContract.
|
|
13592
|
-
transaction = await brokerContract.
|
|
13591
|
+
const positionId = 1;
|
|
13592
|
+
const gasLimit = await brokerContract.placeOrderWithSalt.estimateGas(positionId.toString(), data);
|
|
13593
|
+
transaction = await brokerContract.placeOrderWithSalt(positionId.toString(), data, {
|
|
13593
13594
|
gasLimit: gasLimit * 120n / 100n
|
|
13594
13595
|
});
|
|
13595
13596
|
} else {
|
|
@@ -13721,7 +13722,11 @@ var Order = class {
|
|
|
13721
13722
|
});
|
|
13722
13723
|
const receipt = await request?.wait();
|
|
13723
13724
|
this.logger.info("updateOrderTpSl receipt", receipt);
|
|
13724
|
-
return
|
|
13725
|
+
return {
|
|
13726
|
+
code: 0,
|
|
13727
|
+
data: receipt,
|
|
13728
|
+
message: "update order success"
|
|
13729
|
+
};
|
|
13725
13730
|
} catch (error) {
|
|
13726
13731
|
this.logger.error("Error updating order:", error);
|
|
13727
13732
|
return {
|
|
@@ -13849,33 +13854,6 @@ var Emiter_default = [
|
|
|
13849
13854
|
}
|
|
13850
13855
|
]
|
|
13851
13856
|
},
|
|
13852
|
-
{
|
|
13853
|
-
type: "event",
|
|
13854
|
-
anonymous: false,
|
|
13855
|
-
name: "AddOnFeeTierUpdated",
|
|
13856
|
-
inputs: [
|
|
13857
|
-
{
|
|
13858
|
-
type: "address",
|
|
13859
|
-
name: "broker",
|
|
13860
|
-
indexed: false
|
|
13861
|
-
},
|
|
13862
|
-
{
|
|
13863
|
-
type: "uint8",
|
|
13864
|
-
name: "tier",
|
|
13865
|
-
indexed: false
|
|
13866
|
-
},
|
|
13867
|
-
{
|
|
13868
|
-
type: "uint32",
|
|
13869
|
-
name: "takerFeeRate",
|
|
13870
|
-
indexed: false
|
|
13871
|
-
},
|
|
13872
|
-
{
|
|
13873
|
-
type: "uint32",
|
|
13874
|
-
name: "makerFeeRate",
|
|
13875
|
-
indexed: false
|
|
13876
|
-
}
|
|
13877
|
-
]
|
|
13878
|
-
},
|
|
13879
13857
|
{
|
|
13880
13858
|
type: "event",
|
|
13881
13859
|
anonymous: false,
|
|
@@ -13951,7 +13929,7 @@ var Emiter_default = [
|
|
|
13951
13929
|
indexed: false
|
|
13952
13930
|
},
|
|
13953
13931
|
{
|
|
13954
|
-
type: "
|
|
13932
|
+
type: "bytes32",
|
|
13955
13933
|
name: "positionId",
|
|
13956
13934
|
indexed: false
|
|
13957
13935
|
},
|
|
@@ -14062,7 +14040,7 @@ var Emiter_default = [
|
|
|
14062
14040
|
indexed: false
|
|
14063
14041
|
},
|
|
14064
14042
|
{
|
|
14065
|
-
type: "
|
|
14043
|
+
type: "int32",
|
|
14066
14044
|
name: "tradingFeeRate",
|
|
14067
14045
|
indexed: false
|
|
14068
14046
|
},
|
|
@@ -14218,6 +14196,11 @@ var Emiter_default = [
|
|
|
14218
14196
|
type: "bytes32",
|
|
14219
14197
|
name: "poolId",
|
|
14220
14198
|
indexed: false
|
|
14199
|
+
},
|
|
14200
|
+
{
|
|
14201
|
+
type: "string",
|
|
14202
|
+
name: "reason",
|
|
14203
|
+
indexed: false
|
|
14221
14204
|
}
|
|
14222
14205
|
]
|
|
14223
14206
|
},
|
|
@@ -14278,6 +14261,11 @@ var Emiter_default = [
|
|
|
14278
14261
|
name: "orderId",
|
|
14279
14262
|
indexed: false
|
|
14280
14263
|
},
|
|
14264
|
+
{
|
|
14265
|
+
type: "bytes32",
|
|
14266
|
+
name: "poolId",
|
|
14267
|
+
indexed: false
|
|
14268
|
+
},
|
|
14281
14269
|
{
|
|
14282
14270
|
type: "address",
|
|
14283
14271
|
name: "executor",
|
|
@@ -14370,7 +14358,7 @@ var Emiter_default = [
|
|
|
14370
14358
|
indexed: false
|
|
14371
14359
|
},
|
|
14372
14360
|
{
|
|
14373
|
-
type: "
|
|
14361
|
+
type: "bytes32",
|
|
14374
14362
|
name: "positionId",
|
|
14375
14363
|
indexed: false
|
|
14376
14364
|
},
|
|
@@ -14423,6 +14411,21 @@ var Emiter_default = [
|
|
|
14423
14411
|
type: "int256",
|
|
14424
14412
|
name: "fundingFee",
|
|
14425
14413
|
indexed: false
|
|
14414
|
+
},
|
|
14415
|
+
{
|
|
14416
|
+
type: "address",
|
|
14417
|
+
name: "executionFeeToken",
|
|
14418
|
+
indexed: false
|
|
14419
|
+
},
|
|
14420
|
+
{
|
|
14421
|
+
type: "uint256",
|
|
14422
|
+
name: "executionFeeAmount",
|
|
14423
|
+
indexed: false
|
|
14424
|
+
},
|
|
14425
|
+
{
|
|
14426
|
+
type: "address",
|
|
14427
|
+
name: "keeper",
|
|
14428
|
+
indexed: false
|
|
14426
14429
|
}
|
|
14427
14430
|
]
|
|
14428
14431
|
},
|
|
@@ -14484,7 +14487,7 @@ var Emiter_default = [
|
|
|
14484
14487
|
indexed: false
|
|
14485
14488
|
},
|
|
14486
14489
|
{
|
|
14487
|
-
type: "
|
|
14490
|
+
type: "bytes32",
|
|
14488
14491
|
name: "positionId",
|
|
14489
14492
|
indexed: false
|
|
14490
14493
|
},
|
|
@@ -15109,7 +15112,7 @@ var Emiter_default = [
|
|
|
15109
15112
|
indexed: false
|
|
15110
15113
|
},
|
|
15111
15114
|
{
|
|
15112
|
-
type: "
|
|
15115
|
+
type: "bytes32",
|
|
15113
15116
|
name: "positionId",
|
|
15114
15117
|
indexed: false
|
|
15115
15118
|
},
|
|
@@ -15156,7 +15159,7 @@ var Emiter_default = [
|
|
|
15156
15159
|
indexed: false
|
|
15157
15160
|
},
|
|
15158
15161
|
{
|
|
15159
|
-
type: "
|
|
15162
|
+
type: "bytes32",
|
|
15160
15163
|
name: "positionId",
|
|
15161
15164
|
indexed: false
|
|
15162
15165
|
},
|
|
@@ -15213,7 +15216,7 @@ var Emiter_default = [
|
|
|
15213
15216
|
indexed: false
|
|
15214
15217
|
},
|
|
15215
15218
|
{
|
|
15216
|
-
type: "
|
|
15219
|
+
type: "bytes32",
|
|
15217
15220
|
name: "positionId",
|
|
15218
15221
|
indexed: false
|
|
15219
15222
|
},
|
|
@@ -15239,6 +15242,43 @@ var Emiter_default = [
|
|
|
15239
15242
|
}
|
|
15240
15243
|
]
|
|
15241
15244
|
},
|
|
15245
|
+
{
|
|
15246
|
+
type: "event",
|
|
15247
|
+
anonymous: false,
|
|
15248
|
+
name: "PositionNFTMinted",
|
|
15249
|
+
inputs: [
|
|
15250
|
+
{
|
|
15251
|
+
type: "bytes32",
|
|
15252
|
+
name: "poolId",
|
|
15253
|
+
indexed: false
|
|
15254
|
+
},
|
|
15255
|
+
{
|
|
15256
|
+
type: "bytes32",
|
|
15257
|
+
name: "oldPositionId",
|
|
15258
|
+
indexed: false
|
|
15259
|
+
},
|
|
15260
|
+
{
|
|
15261
|
+
type: "bytes32",
|
|
15262
|
+
name: "newPositionId",
|
|
15263
|
+
indexed: false
|
|
15264
|
+
},
|
|
15265
|
+
{
|
|
15266
|
+
type: "uint256",
|
|
15267
|
+
name: "tokenId",
|
|
15268
|
+
indexed: false
|
|
15269
|
+
},
|
|
15270
|
+
{
|
|
15271
|
+
type: "address",
|
|
15272
|
+
name: "owner",
|
|
15273
|
+
indexed: false
|
|
15274
|
+
},
|
|
15275
|
+
{
|
|
15276
|
+
type: "address",
|
|
15277
|
+
name: "recipient",
|
|
15278
|
+
indexed: false
|
|
15279
|
+
}
|
|
15280
|
+
]
|
|
15281
|
+
},
|
|
15242
15282
|
{
|
|
15243
15283
|
type: "event",
|
|
15244
15284
|
anonymous: false,
|
|
@@ -15255,7 +15295,7 @@ var Emiter_default = [
|
|
|
15255
15295
|
indexed: false
|
|
15256
15296
|
},
|
|
15257
15297
|
{
|
|
15258
|
-
type: "
|
|
15298
|
+
type: "bytes32",
|
|
15259
15299
|
name: "positionId",
|
|
15260
15300
|
indexed: false
|
|
15261
15301
|
}
|
|
@@ -15277,7 +15317,7 @@ var Emiter_default = [
|
|
|
15277
15317
|
indexed: false
|
|
15278
15318
|
},
|
|
15279
15319
|
{
|
|
15280
|
-
type: "
|
|
15320
|
+
type: "bytes32",
|
|
15281
15321
|
name: "positionId",
|
|
15282
15322
|
indexed: false
|
|
15283
15323
|
},
|
|
@@ -15474,6 +15514,43 @@ var Emiter_default = [
|
|
|
15474
15514
|
}
|
|
15475
15515
|
]
|
|
15476
15516
|
},
|
|
15517
|
+
{
|
|
15518
|
+
type: "event",
|
|
15519
|
+
anonymous: false,
|
|
15520
|
+
name: "TradingFeeTierUpdated",
|
|
15521
|
+
inputs: [
|
|
15522
|
+
{
|
|
15523
|
+
type: "address",
|
|
15524
|
+
name: "broker",
|
|
15525
|
+
indexed: false
|
|
15526
|
+
},
|
|
15527
|
+
{
|
|
15528
|
+
type: "uint8",
|
|
15529
|
+
name: "feeType",
|
|
15530
|
+
indexed: false
|
|
15531
|
+
},
|
|
15532
|
+
{
|
|
15533
|
+
type: "uint8",
|
|
15534
|
+
name: "tier",
|
|
15535
|
+
indexed: false
|
|
15536
|
+
},
|
|
15537
|
+
{
|
|
15538
|
+
type: "uint32",
|
|
15539
|
+
name: "takerFeeRate",
|
|
15540
|
+
indexed: false
|
|
15541
|
+
},
|
|
15542
|
+
{
|
|
15543
|
+
type: "int32",
|
|
15544
|
+
name: "makerFeeRate",
|
|
15545
|
+
indexed: false
|
|
15546
|
+
},
|
|
15547
|
+
{
|
|
15548
|
+
type: "bool",
|
|
15549
|
+
name: "isEnabled",
|
|
15550
|
+
indexed: false
|
|
15551
|
+
}
|
|
15552
|
+
]
|
|
15553
|
+
},
|
|
15477
15554
|
{
|
|
15478
15555
|
type: "event",
|
|
15479
15556
|
anonymous: false,
|
|
@@ -15570,6 +15647,33 @@ var Emiter_default = [
|
|
|
15570
15647
|
}
|
|
15571
15648
|
]
|
|
15572
15649
|
},
|
|
15650
|
+
{
|
|
15651
|
+
type: "event",
|
|
15652
|
+
anonymous: false,
|
|
15653
|
+
name: "UserSpecialFeeTierUpdated",
|
|
15654
|
+
inputs: [
|
|
15655
|
+
{
|
|
15656
|
+
type: "address",
|
|
15657
|
+
name: "broker",
|
|
15658
|
+
indexed: false
|
|
15659
|
+
},
|
|
15660
|
+
{
|
|
15661
|
+
type: "address",
|
|
15662
|
+
name: "user",
|
|
15663
|
+
indexed: false
|
|
15664
|
+
},
|
|
15665
|
+
{
|
|
15666
|
+
type: "uint8",
|
|
15667
|
+
name: "oldTier",
|
|
15668
|
+
indexed: false
|
|
15669
|
+
},
|
|
15670
|
+
{
|
|
15671
|
+
type: "uint8",
|
|
15672
|
+
name: "newTier",
|
|
15673
|
+
indexed: false
|
|
15674
|
+
}
|
|
15675
|
+
]
|
|
15676
|
+
},
|
|
15573
15677
|
{
|
|
15574
15678
|
type: "function",
|
|
15575
15679
|
name: "UPGRADE_INTERFACE_VERSION",
|
|
@@ -15585,7 +15689,7 @@ var Emiter_default = [
|
|
|
15585
15689
|
},
|
|
15586
15690
|
{
|
|
15587
15691
|
type: "function",
|
|
15588
|
-
name: "
|
|
15692
|
+
name: "emitCollateralAccepted",
|
|
15589
15693
|
constant: false,
|
|
15590
15694
|
payable: false,
|
|
15591
15695
|
inputs: [
|
|
@@ -15594,20 +15698,28 @@ var Emiter_default = [
|
|
|
15594
15698
|
name: "params",
|
|
15595
15699
|
components: [
|
|
15596
15700
|
{
|
|
15597
|
-
type: "
|
|
15598
|
-
name: "
|
|
15701
|
+
type: "bytes32",
|
|
15702
|
+
name: "poolId"
|
|
15599
15703
|
},
|
|
15600
15704
|
{
|
|
15601
|
-
type: "
|
|
15602
|
-
name: "
|
|
15705
|
+
type: "uint256",
|
|
15706
|
+
name: "quoteDebt"
|
|
15603
15707
|
},
|
|
15604
15708
|
{
|
|
15605
|
-
type: "
|
|
15606
|
-
name: "
|
|
15709
|
+
type: "uint256",
|
|
15710
|
+
name: "baseCollateral"
|
|
15607
15711
|
},
|
|
15608
15712
|
{
|
|
15609
|
-
type: "
|
|
15610
|
-
name: "
|
|
15713
|
+
type: "uint256",
|
|
15714
|
+
name: "quoteCollateral"
|
|
15715
|
+
},
|
|
15716
|
+
{
|
|
15717
|
+
type: "uint256",
|
|
15718
|
+
name: "totalQuoteDebt"
|
|
15719
|
+
},
|
|
15720
|
+
{
|
|
15721
|
+
type: "uint256",
|
|
15722
|
+
name: "totalBaseCollateral"
|
|
15611
15723
|
}
|
|
15612
15724
|
]
|
|
15613
15725
|
}
|
|
@@ -15616,7 +15728,7 @@ var Emiter_default = [
|
|
|
15616
15728
|
},
|
|
15617
15729
|
{
|
|
15618
15730
|
type: "function",
|
|
15619
|
-
name: "
|
|
15731
|
+
name: "emitCollateralAdjusted",
|
|
15620
15732
|
constant: false,
|
|
15621
15733
|
payable: false,
|
|
15622
15734
|
inputs: [
|
|
@@ -15625,28 +15737,28 @@ var Emiter_default = [
|
|
|
15625
15737
|
name: "params",
|
|
15626
15738
|
components: [
|
|
15627
15739
|
{
|
|
15628
|
-
type: "
|
|
15629
|
-
name: "
|
|
15740
|
+
type: "address",
|
|
15741
|
+
name: "user"
|
|
15630
15742
|
},
|
|
15631
15743
|
{
|
|
15632
|
-
type: "
|
|
15633
|
-
name: "
|
|
15744
|
+
type: "bytes32",
|
|
15745
|
+
name: "poolId"
|
|
15634
15746
|
},
|
|
15635
15747
|
{
|
|
15636
|
-
type: "
|
|
15637
|
-
name: "
|
|
15748
|
+
type: "bytes32",
|
|
15749
|
+
name: "positionId"
|
|
15638
15750
|
},
|
|
15639
15751
|
{
|
|
15640
|
-
type: "
|
|
15641
|
-
name: "
|
|
15752
|
+
type: "uint8",
|
|
15753
|
+
name: "direction"
|
|
15642
15754
|
},
|
|
15643
15755
|
{
|
|
15644
15756
|
type: "uint256",
|
|
15645
|
-
name: "
|
|
15757
|
+
name: "beforeCollateralAmount"
|
|
15646
15758
|
},
|
|
15647
15759
|
{
|
|
15648
15760
|
type: "uint256",
|
|
15649
|
-
name: "
|
|
15761
|
+
name: "afterCollateralAmount"
|
|
15650
15762
|
}
|
|
15651
15763
|
]
|
|
15652
15764
|
}
|
|
@@ -15826,6 +15938,10 @@ var Emiter_default = [
|
|
|
15826
15938
|
{
|
|
15827
15939
|
type: "bytes32",
|
|
15828
15940
|
name: "poolId"
|
|
15941
|
+
},
|
|
15942
|
+
{
|
|
15943
|
+
type: "string",
|
|
15944
|
+
name: "reason"
|
|
15829
15945
|
}
|
|
15830
15946
|
]
|
|
15831
15947
|
}
|
|
@@ -15893,6 +16009,10 @@ var Emiter_default = [
|
|
|
15893
16009
|
type: "uint256",
|
|
15894
16010
|
name: "orderId"
|
|
15895
16011
|
},
|
|
16012
|
+
{
|
|
16013
|
+
type: "bytes32",
|
|
16014
|
+
name: "poolId"
|
|
16015
|
+
},
|
|
15896
16016
|
{
|
|
15897
16017
|
type: "address",
|
|
15898
16018
|
name: "executor"
|
|
@@ -15995,7 +16115,7 @@ var Emiter_default = [
|
|
|
15995
16115
|
name: "poolId"
|
|
15996
16116
|
},
|
|
15997
16117
|
{
|
|
15998
|
-
type: "
|
|
16118
|
+
type: "bytes32",
|
|
15999
16119
|
name: "positionId"
|
|
16000
16120
|
},
|
|
16001
16121
|
{
|
|
@@ -16037,6 +16157,18 @@ var Emiter_default = [
|
|
|
16037
16157
|
{
|
|
16038
16158
|
type: "int256",
|
|
16039
16159
|
name: "fundingFee"
|
|
16160
|
+
},
|
|
16161
|
+
{
|
|
16162
|
+
type: "address",
|
|
16163
|
+
name: "executionFeeToken"
|
|
16164
|
+
},
|
|
16165
|
+
{
|
|
16166
|
+
type: "uint256",
|
|
16167
|
+
name: "executionFeeAmount"
|
|
16168
|
+
},
|
|
16169
|
+
{
|
|
16170
|
+
type: "address",
|
|
16171
|
+
name: "keeper"
|
|
16040
16172
|
}
|
|
16041
16173
|
]
|
|
16042
16174
|
}
|
|
@@ -16105,7 +16237,7 @@ var Emiter_default = [
|
|
|
16105
16237
|
name: "poolId"
|
|
16106
16238
|
},
|
|
16107
16239
|
{
|
|
16108
|
-
type: "
|
|
16240
|
+
type: "bytes32",
|
|
16109
16241
|
name: "positionId"
|
|
16110
16242
|
},
|
|
16111
16243
|
{
|
|
@@ -16754,7 +16886,7 @@ var Emiter_default = [
|
|
|
16754
16886
|
name: "poolId"
|
|
16755
16887
|
},
|
|
16756
16888
|
{
|
|
16757
|
-
type: "
|
|
16889
|
+
type: "bytes32",
|
|
16758
16890
|
name: "positionId"
|
|
16759
16891
|
},
|
|
16760
16892
|
{
|
|
@@ -16801,7 +16933,7 @@ var Emiter_default = [
|
|
|
16801
16933
|
name: "poolId"
|
|
16802
16934
|
},
|
|
16803
16935
|
{
|
|
16804
|
-
type: "
|
|
16936
|
+
type: "bytes32",
|
|
16805
16937
|
name: "positionId"
|
|
16806
16938
|
},
|
|
16807
16939
|
{
|
|
@@ -16848,7 +16980,7 @@ var Emiter_default = [
|
|
|
16848
16980
|
name: "poolId"
|
|
16849
16981
|
},
|
|
16850
16982
|
{
|
|
16851
|
-
type: "
|
|
16983
|
+
type: "bytes32",
|
|
16852
16984
|
name: "positionId"
|
|
16853
16985
|
},
|
|
16854
16986
|
{
|
|
@@ -16874,7 +17006,7 @@ var Emiter_default = [
|
|
|
16874
17006
|
},
|
|
16875
17007
|
{
|
|
16876
17008
|
type: "function",
|
|
16877
|
-
name: "
|
|
17009
|
+
name: "emitPositionNFTMinted",
|
|
16878
17010
|
constant: false,
|
|
16879
17011
|
payable: false,
|
|
16880
17012
|
inputs: [
|
|
@@ -16883,21 +17015,60 @@ var Emiter_default = [
|
|
|
16883
17015
|
name: "params",
|
|
16884
17016
|
components: [
|
|
16885
17017
|
{
|
|
16886
|
-
type: "
|
|
16887
|
-
name: "
|
|
17018
|
+
type: "bytes32",
|
|
17019
|
+
name: "poolId"
|
|
16888
17020
|
},
|
|
16889
17021
|
{
|
|
16890
|
-
type: "
|
|
16891
|
-
name: "
|
|
17022
|
+
type: "bytes32",
|
|
17023
|
+
name: "oldPositionId"
|
|
17024
|
+
},
|
|
17025
|
+
{
|
|
17026
|
+
type: "bytes32",
|
|
17027
|
+
name: "newPositionId"
|
|
16892
17028
|
},
|
|
16893
17029
|
{
|
|
16894
17030
|
type: "uint256",
|
|
16895
|
-
name: "
|
|
16896
|
-
}
|
|
16897
|
-
|
|
16898
|
-
|
|
16899
|
-
|
|
16900
|
-
|
|
17031
|
+
name: "tokenId"
|
|
17032
|
+
},
|
|
17033
|
+
{
|
|
17034
|
+
type: "address",
|
|
17035
|
+
name: "owner"
|
|
17036
|
+
},
|
|
17037
|
+
{
|
|
17038
|
+
type: "address",
|
|
17039
|
+
name: "recipient"
|
|
17040
|
+
}
|
|
17041
|
+
]
|
|
17042
|
+
}
|
|
17043
|
+
],
|
|
17044
|
+
outputs: []
|
|
17045
|
+
},
|
|
17046
|
+
{
|
|
17047
|
+
type: "function",
|
|
17048
|
+
name: "emitPositionTransfer",
|
|
17049
|
+
constant: false,
|
|
17050
|
+
payable: false,
|
|
17051
|
+
inputs: [
|
|
17052
|
+
{
|
|
17053
|
+
type: "tuple",
|
|
17054
|
+
name: "params",
|
|
17055
|
+
components: [
|
|
17056
|
+
{
|
|
17057
|
+
type: "address",
|
|
17058
|
+
name: "from"
|
|
17059
|
+
},
|
|
17060
|
+
{
|
|
17061
|
+
type: "address",
|
|
17062
|
+
name: "to"
|
|
17063
|
+
},
|
|
17064
|
+
{
|
|
17065
|
+
type: "bytes32",
|
|
17066
|
+
name: "positionId"
|
|
17067
|
+
}
|
|
17068
|
+
]
|
|
17069
|
+
}
|
|
17070
|
+
],
|
|
17071
|
+
outputs: []
|
|
16901
17072
|
},
|
|
16902
17073
|
{
|
|
16903
17074
|
type: "function",
|
|
@@ -16918,7 +17089,7 @@ var Emiter_default = [
|
|
|
16918
17089
|
name: "owner"
|
|
16919
17090
|
},
|
|
16920
17091
|
{
|
|
16921
|
-
type: "
|
|
17092
|
+
type: "bytes32",
|
|
16922
17093
|
name: "positionId"
|
|
16923
17094
|
},
|
|
16924
17095
|
{
|
|
@@ -17107,6 +17278,45 @@ var Emiter_default = [
|
|
|
17107
17278
|
],
|
|
17108
17279
|
outputs: []
|
|
17109
17280
|
},
|
|
17281
|
+
{
|
|
17282
|
+
type: "function",
|
|
17283
|
+
name: "emitTradingFeeTierUpdated",
|
|
17284
|
+
constant: false,
|
|
17285
|
+
payable: false,
|
|
17286
|
+
inputs: [
|
|
17287
|
+
{
|
|
17288
|
+
type: "tuple",
|
|
17289
|
+
name: "params",
|
|
17290
|
+
components: [
|
|
17291
|
+
{
|
|
17292
|
+
type: "address",
|
|
17293
|
+
name: "broker"
|
|
17294
|
+
},
|
|
17295
|
+
{
|
|
17296
|
+
type: "uint8",
|
|
17297
|
+
name: "feeType"
|
|
17298
|
+
},
|
|
17299
|
+
{
|
|
17300
|
+
type: "uint8",
|
|
17301
|
+
name: "tier"
|
|
17302
|
+
},
|
|
17303
|
+
{
|
|
17304
|
+
type: "uint32",
|
|
17305
|
+
name: "takerFeeRate"
|
|
17306
|
+
},
|
|
17307
|
+
{
|
|
17308
|
+
type: "int32",
|
|
17309
|
+
name: "makerFeeRate"
|
|
17310
|
+
},
|
|
17311
|
+
{
|
|
17312
|
+
type: "bool",
|
|
17313
|
+
name: "isEnabled"
|
|
17314
|
+
}
|
|
17315
|
+
]
|
|
17316
|
+
}
|
|
17317
|
+
],
|
|
17318
|
+
outputs: []
|
|
17319
|
+
},
|
|
17110
17320
|
{
|
|
17111
17321
|
type: "function",
|
|
17112
17322
|
name: "emitUserFeeDataUpdated",
|
|
@@ -17189,7 +17399,7 @@ var Emiter_default = [
|
|
|
17189
17399
|
name: "fundingFee"
|
|
17190
17400
|
},
|
|
17191
17401
|
{
|
|
17192
|
-
type: "
|
|
17402
|
+
type: "int32",
|
|
17193
17403
|
name: "tradingFeeRate"
|
|
17194
17404
|
},
|
|
17195
17405
|
{
|
|
@@ -17231,29 +17441,42 @@ var Emiter_default = [
|
|
|
17231
17441
|
},
|
|
17232
17442
|
{
|
|
17233
17443
|
type: "function",
|
|
17234
|
-
name: "
|
|
17235
|
-
constant:
|
|
17236
|
-
stateMutability: "view",
|
|
17444
|
+
name: "emitUserSpecialFeeTierUpdated",
|
|
17445
|
+
constant: false,
|
|
17237
17446
|
payable: false,
|
|
17238
|
-
inputs: [
|
|
17239
|
-
outputs: [
|
|
17447
|
+
inputs: [
|
|
17240
17448
|
{
|
|
17241
|
-
type: "
|
|
17449
|
+
type: "tuple",
|
|
17450
|
+
name: "params",
|
|
17451
|
+
components: [
|
|
17452
|
+
{
|
|
17453
|
+
type: "address",
|
|
17454
|
+
name: "broker"
|
|
17455
|
+
},
|
|
17456
|
+
{
|
|
17457
|
+
type: "address",
|
|
17458
|
+
name: "user"
|
|
17459
|
+
},
|
|
17460
|
+
{
|
|
17461
|
+
type: "uint8",
|
|
17462
|
+
name: "oldTier"
|
|
17463
|
+
},
|
|
17464
|
+
{
|
|
17465
|
+
type: "uint8",
|
|
17466
|
+
name: "newTier"
|
|
17467
|
+
}
|
|
17468
|
+
]
|
|
17242
17469
|
}
|
|
17243
|
-
]
|
|
17470
|
+
],
|
|
17471
|
+
outputs: []
|
|
17244
17472
|
},
|
|
17245
17473
|
{
|
|
17246
17474
|
type: "function",
|
|
17247
|
-
name: "
|
|
17475
|
+
name: "getAddressManager",
|
|
17248
17476
|
constant: true,
|
|
17249
17477
|
stateMutability: "view",
|
|
17250
17478
|
payable: false,
|
|
17251
|
-
inputs: [
|
|
17252
|
-
{
|
|
17253
|
-
type: "bytes32",
|
|
17254
|
-
name: "identifier"
|
|
17255
|
-
}
|
|
17256
|
-
],
|
|
17479
|
+
inputs: [],
|
|
17257
17480
|
outputs: [
|
|
17258
17481
|
{
|
|
17259
17482
|
type: "address"
|
|
@@ -17262,19 +17485,19 @@ var Emiter_default = [
|
|
|
17262
17485
|
},
|
|
17263
17486
|
{
|
|
17264
17487
|
type: "function",
|
|
17265
|
-
name: "
|
|
17488
|
+
name: "getDependencyAddress",
|
|
17266
17489
|
constant: true,
|
|
17267
17490
|
stateMutability: "view",
|
|
17268
17491
|
payable: false,
|
|
17269
17492
|
inputs: [
|
|
17270
17493
|
{
|
|
17271
|
-
type: "
|
|
17272
|
-
name: "
|
|
17494
|
+
type: "bytes32",
|
|
17495
|
+
name: "identifier"
|
|
17273
17496
|
}
|
|
17274
17497
|
],
|
|
17275
17498
|
outputs: [
|
|
17276
17499
|
{
|
|
17277
|
-
type: "
|
|
17500
|
+
type: "address"
|
|
17278
17501
|
}
|
|
17279
17502
|
]
|
|
17280
17503
|
},
|
|
@@ -17348,19 +17571,6 @@ var Emiter_default = [
|
|
|
17348
17571
|
],
|
|
17349
17572
|
outputs: []
|
|
17350
17573
|
},
|
|
17351
|
-
{
|
|
17352
|
-
type: "function",
|
|
17353
|
-
name: "registerDependencies",
|
|
17354
|
-
constant: false,
|
|
17355
|
-
payable: false,
|
|
17356
|
-
inputs: [
|
|
17357
|
-
{
|
|
17358
|
-
type: "bytes32[]",
|
|
17359
|
-
name: "identifiers"
|
|
17360
|
-
}
|
|
17361
|
-
],
|
|
17362
|
-
outputs: []
|
|
17363
|
-
},
|
|
17364
17574
|
{
|
|
17365
17575
|
type: "function",
|
|
17366
17576
|
name: "sequencer",
|
|
@@ -17374,36 +17584,6 @@ var Emiter_default = [
|
|
|
17374
17584
|
}
|
|
17375
17585
|
]
|
|
17376
17586
|
},
|
|
17377
|
-
{
|
|
17378
|
-
type: "function",
|
|
17379
|
-
name: "unregisterDependencies",
|
|
17380
|
-
constant: false,
|
|
17381
|
-
payable: false,
|
|
17382
|
-
inputs: [
|
|
17383
|
-
{
|
|
17384
|
-
type: "bytes32[]",
|
|
17385
|
-
name: "identifiers"
|
|
17386
|
-
}
|
|
17387
|
-
],
|
|
17388
|
-
outputs: []
|
|
17389
|
-
},
|
|
17390
|
-
{
|
|
17391
|
-
type: "function",
|
|
17392
|
-
name: "update",
|
|
17393
|
-
constant: false,
|
|
17394
|
-
payable: false,
|
|
17395
|
-
inputs: [
|
|
17396
|
-
{
|
|
17397
|
-
type: "bytes32",
|
|
17398
|
-
name: "identifier"
|
|
17399
|
-
},
|
|
17400
|
-
{
|
|
17401
|
-
type: "address",
|
|
17402
|
-
name: "newAddress"
|
|
17403
|
-
}
|
|
17404
|
-
],
|
|
17405
|
-
outputs: []
|
|
17406
|
-
},
|
|
17407
17587
|
{
|
|
17408
17588
|
type: "function",
|
|
17409
17589
|
name: "upgradeTo",
|
|
@@ -17747,6 +17927,11 @@ var Account_default = [
|
|
|
17747
17927
|
name: "InvalidInitialization",
|
|
17748
17928
|
inputs: []
|
|
17749
17929
|
},
|
|
17930
|
+
{
|
|
17931
|
+
type: "error",
|
|
17932
|
+
name: "NotAddressManager",
|
|
17933
|
+
inputs: []
|
|
17934
|
+
},
|
|
17750
17935
|
{
|
|
17751
17936
|
type: "error",
|
|
17752
17937
|
name: "NotDependencyManager",
|
|
@@ -17956,6 +18141,19 @@ var Account_default = [
|
|
|
17956
18141
|
}
|
|
17957
18142
|
]
|
|
17958
18143
|
},
|
|
18144
|
+
{
|
|
18145
|
+
type: "function",
|
|
18146
|
+
name: "__ERC2771ContextUpgradeable_init",
|
|
18147
|
+
constant: false,
|
|
18148
|
+
payable: false,
|
|
18149
|
+
inputs: [
|
|
18150
|
+
{
|
|
18151
|
+
type: "address",
|
|
18152
|
+
name: "trustedForwarder_"
|
|
18153
|
+
}
|
|
18154
|
+
],
|
|
18155
|
+
outputs: []
|
|
18156
|
+
},
|
|
17959
18157
|
{
|
|
17960
18158
|
type: "function",
|
|
17961
18159
|
name: "deposit",
|
|
@@ -18008,24 +18206,6 @@ var Account_default = [
|
|
|
18008
18206
|
}
|
|
18009
18207
|
]
|
|
18010
18208
|
},
|
|
18011
|
-
{
|
|
18012
|
-
type: "function",
|
|
18013
|
-
name: "getDependencyIdentifier",
|
|
18014
|
-
constant: true,
|
|
18015
|
-
stateMutability: "view",
|
|
18016
|
-
payable: false,
|
|
18017
|
-
inputs: [
|
|
18018
|
-
{
|
|
18019
|
-
type: "address",
|
|
18020
|
-
name: "contractAddress"
|
|
18021
|
-
}
|
|
18022
|
-
],
|
|
18023
|
-
outputs: [
|
|
18024
|
-
{
|
|
18025
|
-
type: "bytes32"
|
|
18026
|
-
}
|
|
18027
|
-
]
|
|
18028
|
-
},
|
|
18029
18209
|
{
|
|
18030
18210
|
type: "function",
|
|
18031
18211
|
name: "getImplementation",
|
|
@@ -18067,6 +18247,28 @@ var Account_default = [
|
|
|
18067
18247
|
}
|
|
18068
18248
|
]
|
|
18069
18249
|
},
|
|
18250
|
+
{
|
|
18251
|
+
type: "function",
|
|
18252
|
+
name: "getUserAsset",
|
|
18253
|
+
constant: true,
|
|
18254
|
+
stateMutability: "view",
|
|
18255
|
+
payable: false,
|
|
18256
|
+
inputs: [
|
|
18257
|
+
{
|
|
18258
|
+
type: "address",
|
|
18259
|
+
name: "account"
|
|
18260
|
+
},
|
|
18261
|
+
{
|
|
18262
|
+
type: "bytes32",
|
|
18263
|
+
name: "marketId"
|
|
18264
|
+
}
|
|
18265
|
+
],
|
|
18266
|
+
outputs: [
|
|
18267
|
+
{
|
|
18268
|
+
type: "uint256"
|
|
18269
|
+
}
|
|
18270
|
+
]
|
|
18271
|
+
},
|
|
18070
18272
|
{
|
|
18071
18273
|
type: "function",
|
|
18072
18274
|
name: "getUserAssets",
|
|
@@ -18108,6 +18310,24 @@ var Account_default = [
|
|
|
18108
18310
|
],
|
|
18109
18311
|
outputs: []
|
|
18110
18312
|
},
|
|
18313
|
+
{
|
|
18314
|
+
type: "function",
|
|
18315
|
+
name: "isTrustedForwarder",
|
|
18316
|
+
constant: true,
|
|
18317
|
+
stateMutability: "view",
|
|
18318
|
+
payable: false,
|
|
18319
|
+
inputs: [
|
|
18320
|
+
{
|
|
18321
|
+
type: "address",
|
|
18322
|
+
name: "forwarder"
|
|
18323
|
+
}
|
|
18324
|
+
],
|
|
18325
|
+
outputs: [
|
|
18326
|
+
{
|
|
18327
|
+
type: "bool"
|
|
18328
|
+
}
|
|
18329
|
+
]
|
|
18330
|
+
},
|
|
18111
18331
|
{
|
|
18112
18332
|
type: "function",
|
|
18113
18333
|
name: "payWithPrincipal",
|
|
@@ -18172,19 +18392,6 @@ var Account_default = [
|
|
|
18172
18392
|
}
|
|
18173
18393
|
]
|
|
18174
18394
|
},
|
|
18175
|
-
{
|
|
18176
|
-
type: "function",
|
|
18177
|
-
name: "registerDependencies",
|
|
18178
|
-
constant: false,
|
|
18179
|
-
payable: false,
|
|
18180
|
-
inputs: [
|
|
18181
|
-
{
|
|
18182
|
-
type: "bytes32[]",
|
|
18183
|
-
name: "identifiers"
|
|
18184
|
-
}
|
|
18185
|
-
],
|
|
18186
|
-
outputs: []
|
|
18187
|
-
},
|
|
18188
18395
|
{
|
|
18189
18396
|
type: "function",
|
|
18190
18397
|
name: "releaseFromProfitUnlock",
|
|
@@ -18221,8 +18428,66 @@ var Account_default = [
|
|
|
18221
18428
|
name: "user"
|
|
18222
18429
|
},
|
|
18223
18430
|
{
|
|
18224
|
-
type: "
|
|
18225
|
-
name: "
|
|
18431
|
+
type: "tuple",
|
|
18432
|
+
name: "pool",
|
|
18433
|
+
components: [
|
|
18434
|
+
{
|
|
18435
|
+
type: "bytes32",
|
|
18436
|
+
name: "marketId"
|
|
18437
|
+
},
|
|
18438
|
+
{
|
|
18439
|
+
type: "bytes32",
|
|
18440
|
+
name: "poolId"
|
|
18441
|
+
},
|
|
18442
|
+
{
|
|
18443
|
+
type: "address",
|
|
18444
|
+
name: "baseToken"
|
|
18445
|
+
},
|
|
18446
|
+
{
|
|
18447
|
+
type: "address",
|
|
18448
|
+
name: "quoteToken"
|
|
18449
|
+
},
|
|
18450
|
+
{
|
|
18451
|
+
type: "uint8",
|
|
18452
|
+
name: "riskTier"
|
|
18453
|
+
},
|
|
18454
|
+
{
|
|
18455
|
+
type: "uint8",
|
|
18456
|
+
name: "state"
|
|
18457
|
+
},
|
|
18458
|
+
{
|
|
18459
|
+
type: "address",
|
|
18460
|
+
name: "basePoolToken"
|
|
18461
|
+
},
|
|
18462
|
+
{
|
|
18463
|
+
type: "address",
|
|
18464
|
+
name: "quotePoolToken"
|
|
18465
|
+
},
|
|
18466
|
+
{
|
|
18467
|
+
type: "uint16",
|
|
18468
|
+
name: "maxPriceDeviation"
|
|
18469
|
+
},
|
|
18470
|
+
{
|
|
18471
|
+
type: "bool",
|
|
18472
|
+
name: "compoundEnabled"
|
|
18473
|
+
},
|
|
18474
|
+
{
|
|
18475
|
+
type: "uint64",
|
|
18476
|
+
name: "windowCapUsd"
|
|
18477
|
+
},
|
|
18478
|
+
{
|
|
18479
|
+
type: "address",
|
|
18480
|
+
name: "poolVault"
|
|
18481
|
+
},
|
|
18482
|
+
{
|
|
18483
|
+
type: "address",
|
|
18484
|
+
name: "settler"
|
|
18485
|
+
},
|
|
18486
|
+
{
|
|
18487
|
+
type: "address",
|
|
18488
|
+
name: "tradingVault"
|
|
18489
|
+
}
|
|
18490
|
+
]
|
|
18226
18491
|
},
|
|
18227
18492
|
{
|
|
18228
18493
|
type: "uint256",
|
|
@@ -18245,16 +18510,16 @@ var Account_default = [
|
|
|
18245
18510
|
},
|
|
18246
18511
|
{
|
|
18247
18512
|
type: "function",
|
|
18248
|
-
name: "
|
|
18249
|
-
constant:
|
|
18513
|
+
name: "trustedForwarder",
|
|
18514
|
+
constant: true,
|
|
18515
|
+
stateMutability: "view",
|
|
18250
18516
|
payable: false,
|
|
18251
|
-
inputs: [
|
|
18517
|
+
inputs: [],
|
|
18518
|
+
outputs: [
|
|
18252
18519
|
{
|
|
18253
|
-
type: "
|
|
18254
|
-
name: "identifiers"
|
|
18520
|
+
type: "address"
|
|
18255
18521
|
}
|
|
18256
|
-
]
|
|
18257
|
-
outputs: []
|
|
18522
|
+
]
|
|
18258
18523
|
},
|
|
18259
18524
|
{
|
|
18260
18525
|
type: "function",
|
|
@@ -18306,6 +18571,10 @@ var Account_default = [
|
|
|
18306
18571
|
type: "address",
|
|
18307
18572
|
name: "receiver"
|
|
18308
18573
|
},
|
|
18574
|
+
{
|
|
18575
|
+
type: "bool",
|
|
18576
|
+
name: "isQuoteToken"
|
|
18577
|
+
},
|
|
18309
18578
|
{
|
|
18310
18579
|
type: "uint256",
|
|
18311
18580
|
name: "amount"
|
|
@@ -18926,7 +19195,7 @@ var Account = class {
|
|
|
18926
19195
|
try {
|
|
18927
19196
|
const account = await config.signer?.getAddress() ?? "";
|
|
18928
19197
|
console.log("withdraw", account, amount, poolId);
|
|
18929
|
-
const rs = await accountContract.withdraw(poolId, account, amount);
|
|
19198
|
+
const rs = await accountContract.withdraw(poolId, account, true, amount);
|
|
18930
19199
|
const receipt = await rs?.wait(1);
|
|
18931
19200
|
return {
|
|
18932
19201
|
code: 0,
|