@myx-trade/sdk 0.1.42 → 0.1.43
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.js +178 -443
- package/dist/index.mjs +178 -443
- 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: "0x4eDe4E20162551F293B9D6f33E8567314fb5612f",
|
|
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.43",
|
|
1817
1817
|
private: false,
|
|
1818
1818
|
publishConfig: {
|
|
1819
1819
|
access: "public"
|
|
@@ -11128,7 +11128,7 @@ var withdraw2 = async (params) => {
|
|
|
11128
11128
|
const _gasLimit = await contract["withdrawQuote((bytes32,uint8,uint256,bytes,uint64)[],(bytes32,uint256,uint256,address))"].estimateGas(price, data, { value });
|
|
11129
11129
|
const gasLimit = bigintTradingGasToRatioCalculator(_gasLimit, chainInfo.gasLimitRatio);
|
|
11130
11130
|
const { gasPrice } = await bigintTradingGasPriceWithRatio(chainId);
|
|
11131
|
-
const request = await contract["withdrawQuote((bytes32,uint8,uint256,bytes,uint64)[],(bytes32,uint256,uint256,address))"](
|
|
11131
|
+
const request = await contract["withdrawQuote((bytes32,uint8,uint256,bytes,uint64)[],(bytes32,uint256,uint256,address))"](price, data, {
|
|
11132
11132
|
gasLimit,
|
|
11133
11133
|
gasPrice,
|
|
11134
11134
|
value
|
|
@@ -13136,10 +13136,9 @@ var Order = class {
|
|
|
13136
13136
|
slPrice: params.slPrice ? params.slPrice : 0,
|
|
13137
13137
|
useAccountBalance: false
|
|
13138
13138
|
};
|
|
13139
|
-
this.logger.info("positionId", params.positionId);
|
|
13140
13139
|
let transaction;
|
|
13141
13140
|
if (!params.positionId) {
|
|
13142
|
-
const positionId = 1;
|
|
13141
|
+
const positionId = await this.createPositionId(params.poolId, params.address, params.direction, BigInt(1));
|
|
13143
13142
|
this.logger.info("createIncreaseOrder salt position params--->", { ...data, positionId });
|
|
13144
13143
|
const gasLimit = await brokerContract.placeOrderWithSalt.estimateGas(positionId.toString(), {
|
|
13145
13144
|
user: params.address,
|
|
@@ -13326,7 +13325,7 @@ var Order = class {
|
|
|
13326
13325
|
};
|
|
13327
13326
|
let transaction;
|
|
13328
13327
|
if (!params.positionId) {
|
|
13329
|
-
const positionId = 1;
|
|
13328
|
+
const positionId = await this.createPositionId(params.poolId, params.address, params.direction, BigInt(1));
|
|
13330
13329
|
this.logger.info("createDecreaseOrder salt position params--->", { ...data, positionId });
|
|
13331
13330
|
const gasLimit = await brokerContract.placeOrderWithPosition.estimateGas(positionId.toString(), {
|
|
13332
13331
|
user: params.address,
|
|
@@ -13522,7 +13521,7 @@ var Order = class {
|
|
|
13522
13521
|
let transaction2;
|
|
13523
13522
|
if (!params.positionId) {
|
|
13524
13523
|
this.logger.info("createPositionTpSlOrder salt position data--->", data2);
|
|
13525
|
-
const positionId = 1;
|
|
13524
|
+
const positionId = await this.createPositionId(params.poolId, params.address, params.direction, BigInt(1));
|
|
13526
13525
|
const gasLimit = await brokerContract.placeOrdersWithSalt.estimateGas([positionId.toString(), positionId.toString()], data2);
|
|
13527
13526
|
transaction2 = await brokerContract.placeOrdersWithSalt([positionId.toString(), positionId.toString()], data2, {
|
|
13528
13527
|
gasLimit: gasLimit * 120n / 100n
|
|
@@ -13588,7 +13587,7 @@ var Order = class {
|
|
|
13588
13587
|
let transaction;
|
|
13589
13588
|
if (!params.positionId) {
|
|
13590
13589
|
this.logger.info("createPositionTpOrSlOrder salt position data--->", data);
|
|
13591
|
-
const positionId = 1;
|
|
13590
|
+
const positionId = await this.createPositionId(params.poolId, params.address, params.direction, BigInt(1));
|
|
13592
13591
|
const gasLimit = await brokerContract.placeOrderWithPosition.estimateGas(params.positionId.toString(), data);
|
|
13593
13592
|
transaction = await brokerContract.placeOrderWithPosition(positionId.toString(), data, {
|
|
13594
13593
|
gasLimit: gasLimit * 120n / 100n
|
|
@@ -13850,6 +13849,33 @@ var Emiter_default = [
|
|
|
13850
13849
|
}
|
|
13851
13850
|
]
|
|
13852
13851
|
},
|
|
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
|
+
},
|
|
13853
13879
|
{
|
|
13854
13880
|
type: "event",
|
|
13855
13881
|
anonymous: false,
|
|
@@ -13925,7 +13951,7 @@ var Emiter_default = [
|
|
|
13925
13951
|
indexed: false
|
|
13926
13952
|
},
|
|
13927
13953
|
{
|
|
13928
|
-
type: "
|
|
13954
|
+
type: "uint256",
|
|
13929
13955
|
name: "positionId",
|
|
13930
13956
|
indexed: false
|
|
13931
13957
|
},
|
|
@@ -14036,7 +14062,7 @@ var Emiter_default = [
|
|
|
14036
14062
|
indexed: false
|
|
14037
14063
|
},
|
|
14038
14064
|
{
|
|
14039
|
-
type: "
|
|
14065
|
+
type: "int16",
|
|
14040
14066
|
name: "tradingFeeRate",
|
|
14041
14067
|
indexed: false
|
|
14042
14068
|
},
|
|
@@ -14192,11 +14218,6 @@ var Emiter_default = [
|
|
|
14192
14218
|
type: "bytes32",
|
|
14193
14219
|
name: "poolId",
|
|
14194
14220
|
indexed: false
|
|
14195
|
-
},
|
|
14196
|
-
{
|
|
14197
|
-
type: "string",
|
|
14198
|
-
name: "reason",
|
|
14199
|
-
indexed: false
|
|
14200
14221
|
}
|
|
14201
14222
|
]
|
|
14202
14223
|
},
|
|
@@ -14257,11 +14278,6 @@ var Emiter_default = [
|
|
|
14257
14278
|
name: "orderId",
|
|
14258
14279
|
indexed: false
|
|
14259
14280
|
},
|
|
14260
|
-
{
|
|
14261
|
-
type: "bytes32",
|
|
14262
|
-
name: "poolId",
|
|
14263
|
-
indexed: false
|
|
14264
|
-
},
|
|
14265
14281
|
{
|
|
14266
14282
|
type: "address",
|
|
14267
14283
|
name: "executor",
|
|
@@ -14354,7 +14370,7 @@ var Emiter_default = [
|
|
|
14354
14370
|
indexed: false
|
|
14355
14371
|
},
|
|
14356
14372
|
{
|
|
14357
|
-
type: "
|
|
14373
|
+
type: "uint256",
|
|
14358
14374
|
name: "positionId",
|
|
14359
14375
|
indexed: false
|
|
14360
14376
|
},
|
|
@@ -14407,21 +14423,6 @@ var Emiter_default = [
|
|
|
14407
14423
|
type: "int256",
|
|
14408
14424
|
name: "fundingFee",
|
|
14409
14425
|
indexed: false
|
|
14410
|
-
},
|
|
14411
|
-
{
|
|
14412
|
-
type: "address",
|
|
14413
|
-
name: "executionFeeToken",
|
|
14414
|
-
indexed: false
|
|
14415
|
-
},
|
|
14416
|
-
{
|
|
14417
|
-
type: "uint256",
|
|
14418
|
-
name: "executionFeeAmount",
|
|
14419
|
-
indexed: false
|
|
14420
|
-
},
|
|
14421
|
-
{
|
|
14422
|
-
type: "address",
|
|
14423
|
-
name: "keeper",
|
|
14424
|
-
indexed: false
|
|
14425
14426
|
}
|
|
14426
14427
|
]
|
|
14427
14428
|
},
|
|
@@ -14483,7 +14484,7 @@ var Emiter_default = [
|
|
|
14483
14484
|
indexed: false
|
|
14484
14485
|
},
|
|
14485
14486
|
{
|
|
14486
|
-
type: "
|
|
14487
|
+
type: "uint256",
|
|
14487
14488
|
name: "positionId",
|
|
14488
14489
|
indexed: false
|
|
14489
14490
|
},
|
|
@@ -15108,7 +15109,7 @@ var Emiter_default = [
|
|
|
15108
15109
|
indexed: false
|
|
15109
15110
|
},
|
|
15110
15111
|
{
|
|
15111
|
-
type: "
|
|
15112
|
+
type: "uint256",
|
|
15112
15113
|
name: "positionId",
|
|
15113
15114
|
indexed: false
|
|
15114
15115
|
},
|
|
@@ -15155,7 +15156,7 @@ var Emiter_default = [
|
|
|
15155
15156
|
indexed: false
|
|
15156
15157
|
},
|
|
15157
15158
|
{
|
|
15158
|
-
type: "
|
|
15159
|
+
type: "uint256",
|
|
15159
15160
|
name: "positionId",
|
|
15160
15161
|
indexed: false
|
|
15161
15162
|
},
|
|
@@ -15212,7 +15213,7 @@ var Emiter_default = [
|
|
|
15212
15213
|
indexed: false
|
|
15213
15214
|
},
|
|
15214
15215
|
{
|
|
15215
|
-
type: "
|
|
15216
|
+
type: "uint256",
|
|
15216
15217
|
name: "positionId",
|
|
15217
15218
|
indexed: false
|
|
15218
15219
|
},
|
|
@@ -15238,43 +15239,6 @@ var Emiter_default = [
|
|
|
15238
15239
|
}
|
|
15239
15240
|
]
|
|
15240
15241
|
},
|
|
15241
|
-
{
|
|
15242
|
-
type: "event",
|
|
15243
|
-
anonymous: false,
|
|
15244
|
-
name: "PositionNFTMinted",
|
|
15245
|
-
inputs: [
|
|
15246
|
-
{
|
|
15247
|
-
type: "bytes32",
|
|
15248
|
-
name: "poolId",
|
|
15249
|
-
indexed: false
|
|
15250
|
-
},
|
|
15251
|
-
{
|
|
15252
|
-
type: "bytes32",
|
|
15253
|
-
name: "oldPositionId",
|
|
15254
|
-
indexed: false
|
|
15255
|
-
},
|
|
15256
|
-
{
|
|
15257
|
-
type: "bytes32",
|
|
15258
|
-
name: "newPositionId",
|
|
15259
|
-
indexed: false
|
|
15260
|
-
},
|
|
15261
|
-
{
|
|
15262
|
-
type: "uint256",
|
|
15263
|
-
name: "tokenId",
|
|
15264
|
-
indexed: false
|
|
15265
|
-
},
|
|
15266
|
-
{
|
|
15267
|
-
type: "address",
|
|
15268
|
-
name: "owner",
|
|
15269
|
-
indexed: false
|
|
15270
|
-
},
|
|
15271
|
-
{
|
|
15272
|
-
type: "address",
|
|
15273
|
-
name: "recipient",
|
|
15274
|
-
indexed: false
|
|
15275
|
-
}
|
|
15276
|
-
]
|
|
15277
|
-
},
|
|
15278
15242
|
{
|
|
15279
15243
|
type: "event",
|
|
15280
15244
|
anonymous: false,
|
|
@@ -15291,7 +15255,7 @@ var Emiter_default = [
|
|
|
15291
15255
|
indexed: false
|
|
15292
15256
|
},
|
|
15293
15257
|
{
|
|
15294
|
-
type: "
|
|
15258
|
+
type: "uint256",
|
|
15295
15259
|
name: "positionId",
|
|
15296
15260
|
indexed: false
|
|
15297
15261
|
}
|
|
@@ -15313,7 +15277,7 @@ var Emiter_default = [
|
|
|
15313
15277
|
indexed: false
|
|
15314
15278
|
},
|
|
15315
15279
|
{
|
|
15316
|
-
type: "
|
|
15280
|
+
type: "uint256",
|
|
15317
15281
|
name: "positionId",
|
|
15318
15282
|
indexed: false
|
|
15319
15283
|
},
|
|
@@ -15510,43 +15474,6 @@ var Emiter_default = [
|
|
|
15510
15474
|
}
|
|
15511
15475
|
]
|
|
15512
15476
|
},
|
|
15513
|
-
{
|
|
15514
|
-
type: "event",
|
|
15515
|
-
anonymous: false,
|
|
15516
|
-
name: "TradingFeeTierUpdated",
|
|
15517
|
-
inputs: [
|
|
15518
|
-
{
|
|
15519
|
-
type: "address",
|
|
15520
|
-
name: "broker",
|
|
15521
|
-
indexed: false
|
|
15522
|
-
},
|
|
15523
|
-
{
|
|
15524
|
-
type: "uint8",
|
|
15525
|
-
name: "feeType",
|
|
15526
|
-
indexed: false
|
|
15527
|
-
},
|
|
15528
|
-
{
|
|
15529
|
-
type: "uint8",
|
|
15530
|
-
name: "tier",
|
|
15531
|
-
indexed: false
|
|
15532
|
-
},
|
|
15533
|
-
{
|
|
15534
|
-
type: "uint32",
|
|
15535
|
-
name: "takerFeeRate",
|
|
15536
|
-
indexed: false
|
|
15537
|
-
},
|
|
15538
|
-
{
|
|
15539
|
-
type: "int32",
|
|
15540
|
-
name: "makerFeeRate",
|
|
15541
|
-
indexed: false
|
|
15542
|
-
},
|
|
15543
|
-
{
|
|
15544
|
-
type: "bool",
|
|
15545
|
-
name: "isEnabled",
|
|
15546
|
-
indexed: false
|
|
15547
|
-
}
|
|
15548
|
-
]
|
|
15549
|
-
},
|
|
15550
15477
|
{
|
|
15551
15478
|
type: "event",
|
|
15552
15479
|
anonymous: false,
|
|
@@ -15643,33 +15570,6 @@ var Emiter_default = [
|
|
|
15643
15570
|
}
|
|
15644
15571
|
]
|
|
15645
15572
|
},
|
|
15646
|
-
{
|
|
15647
|
-
type: "event",
|
|
15648
|
-
anonymous: false,
|
|
15649
|
-
name: "UserSpecialFeeTierUpdated",
|
|
15650
|
-
inputs: [
|
|
15651
|
-
{
|
|
15652
|
-
type: "address",
|
|
15653
|
-
name: "broker",
|
|
15654
|
-
indexed: false
|
|
15655
|
-
},
|
|
15656
|
-
{
|
|
15657
|
-
type: "address",
|
|
15658
|
-
name: "user",
|
|
15659
|
-
indexed: false
|
|
15660
|
-
},
|
|
15661
|
-
{
|
|
15662
|
-
type: "uint8",
|
|
15663
|
-
name: "oldTier",
|
|
15664
|
-
indexed: false
|
|
15665
|
-
},
|
|
15666
|
-
{
|
|
15667
|
-
type: "uint8",
|
|
15668
|
-
name: "newTier",
|
|
15669
|
-
indexed: false
|
|
15670
|
-
}
|
|
15671
|
-
]
|
|
15672
|
-
},
|
|
15673
15573
|
{
|
|
15674
15574
|
type: "function",
|
|
15675
15575
|
name: "UPGRADE_INTERFACE_VERSION",
|
|
@@ -15685,7 +15585,7 @@ var Emiter_default = [
|
|
|
15685
15585
|
},
|
|
15686
15586
|
{
|
|
15687
15587
|
type: "function",
|
|
15688
|
-
name: "
|
|
15588
|
+
name: "emitAddOnFeeTierUpdated",
|
|
15689
15589
|
constant: false,
|
|
15690
15590
|
payable: false,
|
|
15691
15591
|
inputs: [
|
|
@@ -15694,28 +15594,20 @@ var Emiter_default = [
|
|
|
15694
15594
|
name: "params",
|
|
15695
15595
|
components: [
|
|
15696
15596
|
{
|
|
15697
|
-
type: "
|
|
15698
|
-
name: "
|
|
15699
|
-
},
|
|
15700
|
-
{
|
|
15701
|
-
type: "uint256",
|
|
15702
|
-
name: "quoteDebt"
|
|
15703
|
-
},
|
|
15704
|
-
{
|
|
15705
|
-
type: "uint256",
|
|
15706
|
-
name: "baseCollateral"
|
|
15597
|
+
type: "address",
|
|
15598
|
+
name: "broker"
|
|
15707
15599
|
},
|
|
15708
15600
|
{
|
|
15709
|
-
type: "
|
|
15710
|
-
name: "
|
|
15601
|
+
type: "uint8",
|
|
15602
|
+
name: "tier"
|
|
15711
15603
|
},
|
|
15712
15604
|
{
|
|
15713
|
-
type: "
|
|
15714
|
-
name: "
|
|
15605
|
+
type: "uint32",
|
|
15606
|
+
name: "takerFeeRate"
|
|
15715
15607
|
},
|
|
15716
15608
|
{
|
|
15717
|
-
type: "
|
|
15718
|
-
name: "
|
|
15609
|
+
type: "uint32",
|
|
15610
|
+
name: "makerFeeRate"
|
|
15719
15611
|
}
|
|
15720
15612
|
]
|
|
15721
15613
|
}
|
|
@@ -15724,7 +15616,7 @@ var Emiter_default = [
|
|
|
15724
15616
|
},
|
|
15725
15617
|
{
|
|
15726
15618
|
type: "function",
|
|
15727
|
-
name: "
|
|
15619
|
+
name: "emitCollateralAccepted",
|
|
15728
15620
|
constant: false,
|
|
15729
15621
|
payable: false,
|
|
15730
15622
|
inputs: [
|
|
@@ -15732,29 +15624,29 @@ var Emiter_default = [
|
|
|
15732
15624
|
type: "tuple",
|
|
15733
15625
|
name: "params",
|
|
15734
15626
|
components: [
|
|
15735
|
-
{
|
|
15736
|
-
type: "address",
|
|
15737
|
-
name: "user"
|
|
15738
|
-
},
|
|
15739
15627
|
{
|
|
15740
15628
|
type: "bytes32",
|
|
15741
15629
|
name: "poolId"
|
|
15742
15630
|
},
|
|
15743
15631
|
{
|
|
15744
|
-
type: "
|
|
15745
|
-
name: "
|
|
15632
|
+
type: "uint256",
|
|
15633
|
+
name: "quoteDebt"
|
|
15746
15634
|
},
|
|
15747
15635
|
{
|
|
15748
|
-
type: "
|
|
15749
|
-
name: "
|
|
15636
|
+
type: "uint256",
|
|
15637
|
+
name: "baseCollateral"
|
|
15750
15638
|
},
|
|
15751
15639
|
{
|
|
15752
15640
|
type: "uint256",
|
|
15753
|
-
name: "
|
|
15641
|
+
name: "quoteCollateral"
|
|
15754
15642
|
},
|
|
15755
15643
|
{
|
|
15756
15644
|
type: "uint256",
|
|
15757
|
-
name: "
|
|
15645
|
+
name: "totalQuoteDebt"
|
|
15646
|
+
},
|
|
15647
|
+
{
|
|
15648
|
+
type: "uint256",
|
|
15649
|
+
name: "totalBaseCollateral"
|
|
15758
15650
|
}
|
|
15759
15651
|
]
|
|
15760
15652
|
}
|
|
@@ -15934,10 +15826,6 @@ var Emiter_default = [
|
|
|
15934
15826
|
{
|
|
15935
15827
|
type: "bytes32",
|
|
15936
15828
|
name: "poolId"
|
|
15937
|
-
},
|
|
15938
|
-
{
|
|
15939
|
-
type: "string",
|
|
15940
|
-
name: "reason"
|
|
15941
15829
|
}
|
|
15942
15830
|
]
|
|
15943
15831
|
}
|
|
@@ -16005,10 +15893,6 @@ var Emiter_default = [
|
|
|
16005
15893
|
type: "uint256",
|
|
16006
15894
|
name: "orderId"
|
|
16007
15895
|
},
|
|
16008
|
-
{
|
|
16009
|
-
type: "bytes32",
|
|
16010
|
-
name: "poolId"
|
|
16011
|
-
},
|
|
16012
15896
|
{
|
|
16013
15897
|
type: "address",
|
|
16014
15898
|
name: "executor"
|
|
@@ -16111,7 +15995,7 @@ var Emiter_default = [
|
|
|
16111
15995
|
name: "poolId"
|
|
16112
15996
|
},
|
|
16113
15997
|
{
|
|
16114
|
-
type: "
|
|
15998
|
+
type: "uint256",
|
|
16115
15999
|
name: "positionId"
|
|
16116
16000
|
},
|
|
16117
16001
|
{
|
|
@@ -16153,18 +16037,6 @@ var Emiter_default = [
|
|
|
16153
16037
|
{
|
|
16154
16038
|
type: "int256",
|
|
16155
16039
|
name: "fundingFee"
|
|
16156
|
-
},
|
|
16157
|
-
{
|
|
16158
|
-
type: "address",
|
|
16159
|
-
name: "executionFeeToken"
|
|
16160
|
-
},
|
|
16161
|
-
{
|
|
16162
|
-
type: "uint256",
|
|
16163
|
-
name: "executionFeeAmount"
|
|
16164
|
-
},
|
|
16165
|
-
{
|
|
16166
|
-
type: "address",
|
|
16167
|
-
name: "keeper"
|
|
16168
16040
|
}
|
|
16169
16041
|
]
|
|
16170
16042
|
}
|
|
@@ -16233,7 +16105,7 @@ var Emiter_default = [
|
|
|
16233
16105
|
name: "poolId"
|
|
16234
16106
|
},
|
|
16235
16107
|
{
|
|
16236
|
-
type: "
|
|
16108
|
+
type: "uint256",
|
|
16237
16109
|
name: "positionId"
|
|
16238
16110
|
},
|
|
16239
16111
|
{
|
|
@@ -16882,7 +16754,7 @@ var Emiter_default = [
|
|
|
16882
16754
|
name: "poolId"
|
|
16883
16755
|
},
|
|
16884
16756
|
{
|
|
16885
|
-
type: "
|
|
16757
|
+
type: "uint256",
|
|
16886
16758
|
name: "positionId"
|
|
16887
16759
|
},
|
|
16888
16760
|
{
|
|
@@ -16929,7 +16801,7 @@ var Emiter_default = [
|
|
|
16929
16801
|
name: "poolId"
|
|
16930
16802
|
},
|
|
16931
16803
|
{
|
|
16932
|
-
type: "
|
|
16804
|
+
type: "uint256",
|
|
16933
16805
|
name: "positionId"
|
|
16934
16806
|
},
|
|
16935
16807
|
{
|
|
@@ -16976,7 +16848,7 @@ var Emiter_default = [
|
|
|
16976
16848
|
name: "poolId"
|
|
16977
16849
|
},
|
|
16978
16850
|
{
|
|
16979
|
-
type: "
|
|
16851
|
+
type: "uint256",
|
|
16980
16852
|
name: "positionId"
|
|
16981
16853
|
},
|
|
16982
16854
|
{
|
|
@@ -17002,7 +16874,7 @@ var Emiter_default = [
|
|
|
17002
16874
|
},
|
|
17003
16875
|
{
|
|
17004
16876
|
type: "function",
|
|
17005
|
-
name: "
|
|
16877
|
+
name: "emitPositionTransfer",
|
|
17006
16878
|
constant: false,
|
|
17007
16879
|
payable: false,
|
|
17008
16880
|
inputs: [
|
|
@@ -17011,55 +16883,16 @@ var Emiter_default = [
|
|
|
17011
16883
|
name: "params",
|
|
17012
16884
|
components: [
|
|
17013
16885
|
{
|
|
17014
|
-
type: "
|
|
17015
|
-
name: "
|
|
17016
|
-
},
|
|
17017
|
-
{
|
|
17018
|
-
type: "bytes32",
|
|
17019
|
-
name: "oldPositionId"
|
|
17020
|
-
},
|
|
17021
|
-
{
|
|
17022
|
-
type: "bytes32",
|
|
17023
|
-
name: "newPositionId"
|
|
17024
|
-
},
|
|
17025
|
-
{
|
|
17026
|
-
type: "uint256",
|
|
17027
|
-
name: "tokenId"
|
|
16886
|
+
type: "address",
|
|
16887
|
+
name: "from"
|
|
17028
16888
|
},
|
|
17029
16889
|
{
|
|
17030
16890
|
type: "address",
|
|
17031
|
-
name: "
|
|
16891
|
+
name: "to"
|
|
17032
16892
|
},
|
|
17033
16893
|
{
|
|
17034
|
-
type: "
|
|
17035
|
-
name: "
|
|
17036
|
-
}
|
|
17037
|
-
]
|
|
17038
|
-
}
|
|
17039
|
-
],
|
|
17040
|
-
outputs: []
|
|
17041
|
-
},
|
|
17042
|
-
{
|
|
17043
|
-
type: "function",
|
|
17044
|
-
name: "emitPositionTransfer",
|
|
17045
|
-
constant: false,
|
|
17046
|
-
payable: false,
|
|
17047
|
-
inputs: [
|
|
17048
|
-
{
|
|
17049
|
-
type: "tuple",
|
|
17050
|
-
name: "params",
|
|
17051
|
-
components: [
|
|
17052
|
-
{
|
|
17053
|
-
type: "address",
|
|
17054
|
-
name: "from"
|
|
17055
|
-
},
|
|
17056
|
-
{
|
|
17057
|
-
type: "address",
|
|
17058
|
-
name: "to"
|
|
17059
|
-
},
|
|
17060
|
-
{
|
|
17061
|
-
type: "bytes32",
|
|
17062
|
-
name: "positionId"
|
|
16894
|
+
type: "uint256",
|
|
16895
|
+
name: "positionId"
|
|
17063
16896
|
}
|
|
17064
16897
|
]
|
|
17065
16898
|
}
|
|
@@ -17085,7 +16918,7 @@ var Emiter_default = [
|
|
|
17085
16918
|
name: "owner"
|
|
17086
16919
|
},
|
|
17087
16920
|
{
|
|
17088
|
-
type: "
|
|
16921
|
+
type: "uint256",
|
|
17089
16922
|
name: "positionId"
|
|
17090
16923
|
},
|
|
17091
16924
|
{
|
|
@@ -17274,45 +17107,6 @@ var Emiter_default = [
|
|
|
17274
17107
|
],
|
|
17275
17108
|
outputs: []
|
|
17276
17109
|
},
|
|
17277
|
-
{
|
|
17278
|
-
type: "function",
|
|
17279
|
-
name: "emitTradingFeeTierUpdated",
|
|
17280
|
-
constant: false,
|
|
17281
|
-
payable: false,
|
|
17282
|
-
inputs: [
|
|
17283
|
-
{
|
|
17284
|
-
type: "tuple",
|
|
17285
|
-
name: "params",
|
|
17286
|
-
components: [
|
|
17287
|
-
{
|
|
17288
|
-
type: "address",
|
|
17289
|
-
name: "broker"
|
|
17290
|
-
},
|
|
17291
|
-
{
|
|
17292
|
-
type: "uint8",
|
|
17293
|
-
name: "feeType"
|
|
17294
|
-
},
|
|
17295
|
-
{
|
|
17296
|
-
type: "uint8",
|
|
17297
|
-
name: "tier"
|
|
17298
|
-
},
|
|
17299
|
-
{
|
|
17300
|
-
type: "uint32",
|
|
17301
|
-
name: "takerFeeRate"
|
|
17302
|
-
},
|
|
17303
|
-
{
|
|
17304
|
-
type: "int32",
|
|
17305
|
-
name: "makerFeeRate"
|
|
17306
|
-
},
|
|
17307
|
-
{
|
|
17308
|
-
type: "bool",
|
|
17309
|
-
name: "isEnabled"
|
|
17310
|
-
}
|
|
17311
|
-
]
|
|
17312
|
-
}
|
|
17313
|
-
],
|
|
17314
|
-
outputs: []
|
|
17315
|
-
},
|
|
17316
17110
|
{
|
|
17317
17111
|
type: "function",
|
|
17318
17112
|
name: "emitUserFeeDataUpdated",
|
|
@@ -17395,7 +17189,7 @@ var Emiter_default = [
|
|
|
17395
17189
|
name: "fundingFee"
|
|
17396
17190
|
},
|
|
17397
17191
|
{
|
|
17398
|
-
type: "
|
|
17192
|
+
type: "int16",
|
|
17399
17193
|
name: "tradingFeeRate"
|
|
17400
17194
|
},
|
|
17401
17195
|
{
|
|
@@ -17435,37 +17229,6 @@ var Emiter_default = [
|
|
|
17435
17229
|
],
|
|
17436
17230
|
outputs: []
|
|
17437
17231
|
},
|
|
17438
|
-
{
|
|
17439
|
-
type: "function",
|
|
17440
|
-
name: "emitUserSpecialFeeTierUpdated",
|
|
17441
|
-
constant: false,
|
|
17442
|
-
payable: false,
|
|
17443
|
-
inputs: [
|
|
17444
|
-
{
|
|
17445
|
-
type: "tuple",
|
|
17446
|
-
name: "params",
|
|
17447
|
-
components: [
|
|
17448
|
-
{
|
|
17449
|
-
type: "address",
|
|
17450
|
-
name: "broker"
|
|
17451
|
-
},
|
|
17452
|
-
{
|
|
17453
|
-
type: "address",
|
|
17454
|
-
name: "user"
|
|
17455
|
-
},
|
|
17456
|
-
{
|
|
17457
|
-
type: "uint8",
|
|
17458
|
-
name: "oldTier"
|
|
17459
|
-
},
|
|
17460
|
-
{
|
|
17461
|
-
type: "uint8",
|
|
17462
|
-
name: "newTier"
|
|
17463
|
-
}
|
|
17464
|
-
]
|
|
17465
|
-
}
|
|
17466
|
-
],
|
|
17467
|
-
outputs: []
|
|
17468
|
-
},
|
|
17469
17232
|
{
|
|
17470
17233
|
type: "function",
|
|
17471
17234
|
name: "getAddressManager",
|
|
@@ -17497,6 +17260,24 @@ var Emiter_default = [
|
|
|
17497
17260
|
}
|
|
17498
17261
|
]
|
|
17499
17262
|
},
|
|
17263
|
+
{
|
|
17264
|
+
type: "function",
|
|
17265
|
+
name: "getDependencyIdentifier",
|
|
17266
|
+
constant: true,
|
|
17267
|
+
stateMutability: "view",
|
|
17268
|
+
payable: false,
|
|
17269
|
+
inputs: [
|
|
17270
|
+
{
|
|
17271
|
+
type: "address",
|
|
17272
|
+
name: "contractAddress"
|
|
17273
|
+
}
|
|
17274
|
+
],
|
|
17275
|
+
outputs: [
|
|
17276
|
+
{
|
|
17277
|
+
type: "bytes32"
|
|
17278
|
+
}
|
|
17279
|
+
]
|
|
17280
|
+
},
|
|
17500
17281
|
{
|
|
17501
17282
|
type: "function",
|
|
17502
17283
|
name: "getImplementation",
|
|
@@ -17567,6 +17348,19 @@ var Emiter_default = [
|
|
|
17567
17348
|
],
|
|
17568
17349
|
outputs: []
|
|
17569
17350
|
},
|
|
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
|
+
},
|
|
17570
17364
|
{
|
|
17571
17365
|
type: "function",
|
|
17572
17366
|
name: "sequencer",
|
|
@@ -17580,6 +17374,36 @@ var Emiter_default = [
|
|
|
17580
17374
|
}
|
|
17581
17375
|
]
|
|
17582
17376
|
},
|
|
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
|
+
},
|
|
17583
17407
|
{
|
|
17584
17408
|
type: "function",
|
|
17585
17409
|
name: "upgradeTo",
|
|
@@ -17923,11 +17747,6 @@ var Account_default = [
|
|
|
17923
17747
|
name: "InvalidInitialization",
|
|
17924
17748
|
inputs: []
|
|
17925
17749
|
},
|
|
17926
|
-
{
|
|
17927
|
-
type: "error",
|
|
17928
|
-
name: "NotAddressManager",
|
|
17929
|
-
inputs: []
|
|
17930
|
-
},
|
|
17931
17750
|
{
|
|
17932
17751
|
type: "error",
|
|
17933
17752
|
name: "NotDependencyManager",
|
|
@@ -18137,19 +17956,6 @@ var Account_default = [
|
|
|
18137
17956
|
}
|
|
18138
17957
|
]
|
|
18139
17958
|
},
|
|
18140
|
-
{
|
|
18141
|
-
type: "function",
|
|
18142
|
-
name: "__ERC2771ContextUpgradeable_init",
|
|
18143
|
-
constant: false,
|
|
18144
|
-
payable: false,
|
|
18145
|
-
inputs: [
|
|
18146
|
-
{
|
|
18147
|
-
type: "address",
|
|
18148
|
-
name: "trustedForwarder_"
|
|
18149
|
-
}
|
|
18150
|
-
],
|
|
18151
|
-
outputs: []
|
|
18152
|
-
},
|
|
18153
17959
|
{
|
|
18154
17960
|
type: "function",
|
|
18155
17961
|
name: "deposit",
|
|
@@ -18202,6 +18008,24 @@ var Account_default = [
|
|
|
18202
18008
|
}
|
|
18203
18009
|
]
|
|
18204
18010
|
},
|
|
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
|
+
},
|
|
18205
18029
|
{
|
|
18206
18030
|
type: "function",
|
|
18207
18031
|
name: "getImplementation",
|
|
@@ -18243,28 +18067,6 @@ var Account_default = [
|
|
|
18243
18067
|
}
|
|
18244
18068
|
]
|
|
18245
18069
|
},
|
|
18246
|
-
{
|
|
18247
|
-
type: "function",
|
|
18248
|
-
name: "getUserAsset",
|
|
18249
|
-
constant: true,
|
|
18250
|
-
stateMutability: "view",
|
|
18251
|
-
payable: false,
|
|
18252
|
-
inputs: [
|
|
18253
|
-
{
|
|
18254
|
-
type: "address",
|
|
18255
|
-
name: "account"
|
|
18256
|
-
},
|
|
18257
|
-
{
|
|
18258
|
-
type: "bytes32",
|
|
18259
|
-
name: "marketId"
|
|
18260
|
-
}
|
|
18261
|
-
],
|
|
18262
|
-
outputs: [
|
|
18263
|
-
{
|
|
18264
|
-
type: "uint256"
|
|
18265
|
-
}
|
|
18266
|
-
]
|
|
18267
|
-
},
|
|
18268
18070
|
{
|
|
18269
18071
|
type: "function",
|
|
18270
18072
|
name: "getUserAssets",
|
|
@@ -18306,24 +18108,6 @@ var Account_default = [
|
|
|
18306
18108
|
],
|
|
18307
18109
|
outputs: []
|
|
18308
18110
|
},
|
|
18309
|
-
{
|
|
18310
|
-
type: "function",
|
|
18311
|
-
name: "isTrustedForwarder",
|
|
18312
|
-
constant: true,
|
|
18313
|
-
stateMutability: "view",
|
|
18314
|
-
payable: false,
|
|
18315
|
-
inputs: [
|
|
18316
|
-
{
|
|
18317
|
-
type: "address",
|
|
18318
|
-
name: "forwarder"
|
|
18319
|
-
}
|
|
18320
|
-
],
|
|
18321
|
-
outputs: [
|
|
18322
|
-
{
|
|
18323
|
-
type: "bool"
|
|
18324
|
-
}
|
|
18325
|
-
]
|
|
18326
|
-
},
|
|
18327
18111
|
{
|
|
18328
18112
|
type: "function",
|
|
18329
18113
|
name: "payWithPrincipal",
|
|
@@ -18388,6 +18172,19 @@ var Account_default = [
|
|
|
18388
18172
|
}
|
|
18389
18173
|
]
|
|
18390
18174
|
},
|
|
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
|
+
},
|
|
18391
18188
|
{
|
|
18392
18189
|
type: "function",
|
|
18393
18190
|
name: "releaseFromProfitUnlock",
|
|
@@ -18424,66 +18221,8 @@ var Account_default = [
|
|
|
18424
18221
|
name: "user"
|
|
18425
18222
|
},
|
|
18426
18223
|
{
|
|
18427
|
-
type: "
|
|
18428
|
-
name: "
|
|
18429
|
-
components: [
|
|
18430
|
-
{
|
|
18431
|
-
type: "bytes32",
|
|
18432
|
-
name: "marketId"
|
|
18433
|
-
},
|
|
18434
|
-
{
|
|
18435
|
-
type: "bytes32",
|
|
18436
|
-
name: "poolId"
|
|
18437
|
-
},
|
|
18438
|
-
{
|
|
18439
|
-
type: "address",
|
|
18440
|
-
name: "baseToken"
|
|
18441
|
-
},
|
|
18442
|
-
{
|
|
18443
|
-
type: "address",
|
|
18444
|
-
name: "quoteToken"
|
|
18445
|
-
},
|
|
18446
|
-
{
|
|
18447
|
-
type: "uint8",
|
|
18448
|
-
name: "riskTier"
|
|
18449
|
-
},
|
|
18450
|
-
{
|
|
18451
|
-
type: "uint8",
|
|
18452
|
-
name: "state"
|
|
18453
|
-
},
|
|
18454
|
-
{
|
|
18455
|
-
type: "address",
|
|
18456
|
-
name: "basePoolToken"
|
|
18457
|
-
},
|
|
18458
|
-
{
|
|
18459
|
-
type: "address",
|
|
18460
|
-
name: "quotePoolToken"
|
|
18461
|
-
},
|
|
18462
|
-
{
|
|
18463
|
-
type: "uint16",
|
|
18464
|
-
name: "maxPriceDeviation"
|
|
18465
|
-
},
|
|
18466
|
-
{
|
|
18467
|
-
type: "bool",
|
|
18468
|
-
name: "compoundEnabled"
|
|
18469
|
-
},
|
|
18470
|
-
{
|
|
18471
|
-
type: "uint64",
|
|
18472
|
-
name: "windowCapUsd"
|
|
18473
|
-
},
|
|
18474
|
-
{
|
|
18475
|
-
type: "address",
|
|
18476
|
-
name: "poolVault"
|
|
18477
|
-
},
|
|
18478
|
-
{
|
|
18479
|
-
type: "address",
|
|
18480
|
-
name: "settler"
|
|
18481
|
-
},
|
|
18482
|
-
{
|
|
18483
|
-
type: "address",
|
|
18484
|
-
name: "tradingVault"
|
|
18485
|
-
}
|
|
18486
|
-
]
|
|
18224
|
+
type: "bytes32",
|
|
18225
|
+
name: "poolId"
|
|
18487
18226
|
},
|
|
18488
18227
|
{
|
|
18489
18228
|
type: "uint256",
|
|
@@ -18506,16 +18245,16 @@ var Account_default = [
|
|
|
18506
18245
|
},
|
|
18507
18246
|
{
|
|
18508
18247
|
type: "function",
|
|
18509
|
-
name: "
|
|
18510
|
-
constant:
|
|
18511
|
-
stateMutability: "view",
|
|
18248
|
+
name: "unregisterDependencies",
|
|
18249
|
+
constant: false,
|
|
18512
18250
|
payable: false,
|
|
18513
|
-
inputs: [
|
|
18514
|
-
outputs: [
|
|
18251
|
+
inputs: [
|
|
18515
18252
|
{
|
|
18516
|
-
type: "
|
|
18253
|
+
type: "bytes32[]",
|
|
18254
|
+
name: "identifiers"
|
|
18517
18255
|
}
|
|
18518
|
-
]
|
|
18256
|
+
],
|
|
18257
|
+
outputs: []
|
|
18519
18258
|
},
|
|
18520
18259
|
{
|
|
18521
18260
|
type: "function",
|
|
@@ -18567,10 +18306,6 @@ var Account_default = [
|
|
|
18567
18306
|
type: "address",
|
|
18568
18307
|
name: "receiver"
|
|
18569
18308
|
},
|
|
18570
|
-
{
|
|
18571
|
-
type: "bool",
|
|
18572
|
-
name: "isQuoteToken"
|
|
18573
|
-
},
|
|
18574
18309
|
{
|
|
18575
18310
|
type: "uint256",
|
|
18576
18311
|
name: "amount"
|
|
@@ -19191,7 +18926,7 @@ var Account = class {
|
|
|
19191
18926
|
try {
|
|
19192
18927
|
const account = await config.signer?.getAddress() ?? "";
|
|
19193
18928
|
console.log("withdraw", account, amount, poolId);
|
|
19194
|
-
const rs = await accountContract.withdraw(poolId, account,
|
|
18929
|
+
const rs = await accountContract.withdraw(poolId, account, amount);
|
|
19195
18930
|
const receipt = await rs?.wait(1);
|
|
19196
18931
|
return {
|
|
19197
18932
|
code: 0,
|