@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.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: "0x4eDe4E20162551F293B9D6f33E8567314fb5612f",
|
|
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.43",
|
|
1732
1732
|
private: false,
|
|
1733
1733
|
publishConfig: {
|
|
1734
1734
|
access: "public"
|
|
@@ -11043,7 +11043,7 @@ var withdraw2 = async (params) => {
|
|
|
11043
11043
|
const _gasLimit = await contract["withdrawQuote((bytes32,uint8,uint256,bytes,uint64)[],(bytes32,uint256,uint256,address))"].estimateGas(price, data, { value });
|
|
11044
11044
|
const gasLimit = bigintTradingGasToRatioCalculator(_gasLimit, chainInfo.gasLimitRatio);
|
|
11045
11045
|
const { gasPrice } = await bigintTradingGasPriceWithRatio(chainId);
|
|
11046
|
-
const request = await contract["withdrawQuote((bytes32,uint8,uint256,bytes,uint64)[],(bytes32,uint256,uint256,address))"](
|
|
11046
|
+
const request = await contract["withdrawQuote((bytes32,uint8,uint256,bytes,uint64)[],(bytes32,uint256,uint256,address))"](price, data, {
|
|
11047
11047
|
gasLimit,
|
|
11048
11048
|
gasPrice,
|
|
11049
11049
|
value
|
|
@@ -13051,10 +13051,9 @@ var Order = class {
|
|
|
13051
13051
|
slPrice: params.slPrice ? params.slPrice : 0,
|
|
13052
13052
|
useAccountBalance: false
|
|
13053
13053
|
};
|
|
13054
|
-
this.logger.info("positionId", params.positionId);
|
|
13055
13054
|
let transaction;
|
|
13056
13055
|
if (!params.positionId) {
|
|
13057
|
-
const positionId = 1;
|
|
13056
|
+
const positionId = await this.createPositionId(params.poolId, params.address, params.direction, BigInt(1));
|
|
13058
13057
|
this.logger.info("createIncreaseOrder salt position params--->", { ...data, positionId });
|
|
13059
13058
|
const gasLimit = await brokerContract.placeOrderWithSalt.estimateGas(positionId.toString(), {
|
|
13060
13059
|
user: params.address,
|
|
@@ -13241,7 +13240,7 @@ var Order = class {
|
|
|
13241
13240
|
};
|
|
13242
13241
|
let transaction;
|
|
13243
13242
|
if (!params.positionId) {
|
|
13244
|
-
const positionId = 1;
|
|
13243
|
+
const positionId = await this.createPositionId(params.poolId, params.address, params.direction, BigInt(1));
|
|
13245
13244
|
this.logger.info("createDecreaseOrder salt position params--->", { ...data, positionId });
|
|
13246
13245
|
const gasLimit = await brokerContract.placeOrderWithPosition.estimateGas(positionId.toString(), {
|
|
13247
13246
|
user: params.address,
|
|
@@ -13437,7 +13436,7 @@ var Order = class {
|
|
|
13437
13436
|
let transaction2;
|
|
13438
13437
|
if (!params.positionId) {
|
|
13439
13438
|
this.logger.info("createPositionTpSlOrder salt position data--->", data2);
|
|
13440
|
-
const positionId = 1;
|
|
13439
|
+
const positionId = await this.createPositionId(params.poolId, params.address, params.direction, BigInt(1));
|
|
13441
13440
|
const gasLimit = await brokerContract.placeOrdersWithSalt.estimateGas([positionId.toString(), positionId.toString()], data2);
|
|
13442
13441
|
transaction2 = await brokerContract.placeOrdersWithSalt([positionId.toString(), positionId.toString()], data2, {
|
|
13443
13442
|
gasLimit: gasLimit * 120n / 100n
|
|
@@ -13503,7 +13502,7 @@ var Order = class {
|
|
|
13503
13502
|
let transaction;
|
|
13504
13503
|
if (!params.positionId) {
|
|
13505
13504
|
this.logger.info("createPositionTpOrSlOrder salt position data--->", data);
|
|
13506
|
-
const positionId = 1;
|
|
13505
|
+
const positionId = await this.createPositionId(params.poolId, params.address, params.direction, BigInt(1));
|
|
13507
13506
|
const gasLimit = await brokerContract.placeOrderWithPosition.estimateGas(params.positionId.toString(), data);
|
|
13508
13507
|
transaction = await brokerContract.placeOrderWithPosition(positionId.toString(), data, {
|
|
13509
13508
|
gasLimit: gasLimit * 120n / 100n
|
|
@@ -13765,6 +13764,33 @@ var Emiter_default = [
|
|
|
13765
13764
|
}
|
|
13766
13765
|
]
|
|
13767
13766
|
},
|
|
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
|
+
},
|
|
13768
13794
|
{
|
|
13769
13795
|
type: "event",
|
|
13770
13796
|
anonymous: false,
|
|
@@ -13840,7 +13866,7 @@ var Emiter_default = [
|
|
|
13840
13866
|
indexed: false
|
|
13841
13867
|
},
|
|
13842
13868
|
{
|
|
13843
|
-
type: "
|
|
13869
|
+
type: "uint256",
|
|
13844
13870
|
name: "positionId",
|
|
13845
13871
|
indexed: false
|
|
13846
13872
|
},
|
|
@@ -13951,7 +13977,7 @@ var Emiter_default = [
|
|
|
13951
13977
|
indexed: false
|
|
13952
13978
|
},
|
|
13953
13979
|
{
|
|
13954
|
-
type: "
|
|
13980
|
+
type: "int16",
|
|
13955
13981
|
name: "tradingFeeRate",
|
|
13956
13982
|
indexed: false
|
|
13957
13983
|
},
|
|
@@ -14107,11 +14133,6 @@ var Emiter_default = [
|
|
|
14107
14133
|
type: "bytes32",
|
|
14108
14134
|
name: "poolId",
|
|
14109
14135
|
indexed: false
|
|
14110
|
-
},
|
|
14111
|
-
{
|
|
14112
|
-
type: "string",
|
|
14113
|
-
name: "reason",
|
|
14114
|
-
indexed: false
|
|
14115
14136
|
}
|
|
14116
14137
|
]
|
|
14117
14138
|
},
|
|
@@ -14172,11 +14193,6 @@ var Emiter_default = [
|
|
|
14172
14193
|
name: "orderId",
|
|
14173
14194
|
indexed: false
|
|
14174
14195
|
},
|
|
14175
|
-
{
|
|
14176
|
-
type: "bytes32",
|
|
14177
|
-
name: "poolId",
|
|
14178
|
-
indexed: false
|
|
14179
|
-
},
|
|
14180
14196
|
{
|
|
14181
14197
|
type: "address",
|
|
14182
14198
|
name: "executor",
|
|
@@ -14269,7 +14285,7 @@ var Emiter_default = [
|
|
|
14269
14285
|
indexed: false
|
|
14270
14286
|
},
|
|
14271
14287
|
{
|
|
14272
|
-
type: "
|
|
14288
|
+
type: "uint256",
|
|
14273
14289
|
name: "positionId",
|
|
14274
14290
|
indexed: false
|
|
14275
14291
|
},
|
|
@@ -14322,21 +14338,6 @@ var Emiter_default = [
|
|
|
14322
14338
|
type: "int256",
|
|
14323
14339
|
name: "fundingFee",
|
|
14324
14340
|
indexed: false
|
|
14325
|
-
},
|
|
14326
|
-
{
|
|
14327
|
-
type: "address",
|
|
14328
|
-
name: "executionFeeToken",
|
|
14329
|
-
indexed: false
|
|
14330
|
-
},
|
|
14331
|
-
{
|
|
14332
|
-
type: "uint256",
|
|
14333
|
-
name: "executionFeeAmount",
|
|
14334
|
-
indexed: false
|
|
14335
|
-
},
|
|
14336
|
-
{
|
|
14337
|
-
type: "address",
|
|
14338
|
-
name: "keeper",
|
|
14339
|
-
indexed: false
|
|
14340
14341
|
}
|
|
14341
14342
|
]
|
|
14342
14343
|
},
|
|
@@ -14398,7 +14399,7 @@ var Emiter_default = [
|
|
|
14398
14399
|
indexed: false
|
|
14399
14400
|
},
|
|
14400
14401
|
{
|
|
14401
|
-
type: "
|
|
14402
|
+
type: "uint256",
|
|
14402
14403
|
name: "positionId",
|
|
14403
14404
|
indexed: false
|
|
14404
14405
|
},
|
|
@@ -15023,7 +15024,7 @@ var Emiter_default = [
|
|
|
15023
15024
|
indexed: false
|
|
15024
15025
|
},
|
|
15025
15026
|
{
|
|
15026
|
-
type: "
|
|
15027
|
+
type: "uint256",
|
|
15027
15028
|
name: "positionId",
|
|
15028
15029
|
indexed: false
|
|
15029
15030
|
},
|
|
@@ -15070,7 +15071,7 @@ var Emiter_default = [
|
|
|
15070
15071
|
indexed: false
|
|
15071
15072
|
},
|
|
15072
15073
|
{
|
|
15073
|
-
type: "
|
|
15074
|
+
type: "uint256",
|
|
15074
15075
|
name: "positionId",
|
|
15075
15076
|
indexed: false
|
|
15076
15077
|
},
|
|
@@ -15127,7 +15128,7 @@ var Emiter_default = [
|
|
|
15127
15128
|
indexed: false
|
|
15128
15129
|
},
|
|
15129
15130
|
{
|
|
15130
|
-
type: "
|
|
15131
|
+
type: "uint256",
|
|
15131
15132
|
name: "positionId",
|
|
15132
15133
|
indexed: false
|
|
15133
15134
|
},
|
|
@@ -15153,43 +15154,6 @@ var Emiter_default = [
|
|
|
15153
15154
|
}
|
|
15154
15155
|
]
|
|
15155
15156
|
},
|
|
15156
|
-
{
|
|
15157
|
-
type: "event",
|
|
15158
|
-
anonymous: false,
|
|
15159
|
-
name: "PositionNFTMinted",
|
|
15160
|
-
inputs: [
|
|
15161
|
-
{
|
|
15162
|
-
type: "bytes32",
|
|
15163
|
-
name: "poolId",
|
|
15164
|
-
indexed: false
|
|
15165
|
-
},
|
|
15166
|
-
{
|
|
15167
|
-
type: "bytes32",
|
|
15168
|
-
name: "oldPositionId",
|
|
15169
|
-
indexed: false
|
|
15170
|
-
},
|
|
15171
|
-
{
|
|
15172
|
-
type: "bytes32",
|
|
15173
|
-
name: "newPositionId",
|
|
15174
|
-
indexed: false
|
|
15175
|
-
},
|
|
15176
|
-
{
|
|
15177
|
-
type: "uint256",
|
|
15178
|
-
name: "tokenId",
|
|
15179
|
-
indexed: false
|
|
15180
|
-
},
|
|
15181
|
-
{
|
|
15182
|
-
type: "address",
|
|
15183
|
-
name: "owner",
|
|
15184
|
-
indexed: false
|
|
15185
|
-
},
|
|
15186
|
-
{
|
|
15187
|
-
type: "address",
|
|
15188
|
-
name: "recipient",
|
|
15189
|
-
indexed: false
|
|
15190
|
-
}
|
|
15191
|
-
]
|
|
15192
|
-
},
|
|
15193
15157
|
{
|
|
15194
15158
|
type: "event",
|
|
15195
15159
|
anonymous: false,
|
|
@@ -15206,7 +15170,7 @@ var Emiter_default = [
|
|
|
15206
15170
|
indexed: false
|
|
15207
15171
|
},
|
|
15208
15172
|
{
|
|
15209
|
-
type: "
|
|
15173
|
+
type: "uint256",
|
|
15210
15174
|
name: "positionId",
|
|
15211
15175
|
indexed: false
|
|
15212
15176
|
}
|
|
@@ -15228,7 +15192,7 @@ var Emiter_default = [
|
|
|
15228
15192
|
indexed: false
|
|
15229
15193
|
},
|
|
15230
15194
|
{
|
|
15231
|
-
type: "
|
|
15195
|
+
type: "uint256",
|
|
15232
15196
|
name: "positionId",
|
|
15233
15197
|
indexed: false
|
|
15234
15198
|
},
|
|
@@ -15425,43 +15389,6 @@ var Emiter_default = [
|
|
|
15425
15389
|
}
|
|
15426
15390
|
]
|
|
15427
15391
|
},
|
|
15428
|
-
{
|
|
15429
|
-
type: "event",
|
|
15430
|
-
anonymous: false,
|
|
15431
|
-
name: "TradingFeeTierUpdated",
|
|
15432
|
-
inputs: [
|
|
15433
|
-
{
|
|
15434
|
-
type: "address",
|
|
15435
|
-
name: "broker",
|
|
15436
|
-
indexed: false
|
|
15437
|
-
},
|
|
15438
|
-
{
|
|
15439
|
-
type: "uint8",
|
|
15440
|
-
name: "feeType",
|
|
15441
|
-
indexed: false
|
|
15442
|
-
},
|
|
15443
|
-
{
|
|
15444
|
-
type: "uint8",
|
|
15445
|
-
name: "tier",
|
|
15446
|
-
indexed: false
|
|
15447
|
-
},
|
|
15448
|
-
{
|
|
15449
|
-
type: "uint32",
|
|
15450
|
-
name: "takerFeeRate",
|
|
15451
|
-
indexed: false
|
|
15452
|
-
},
|
|
15453
|
-
{
|
|
15454
|
-
type: "int32",
|
|
15455
|
-
name: "makerFeeRate",
|
|
15456
|
-
indexed: false
|
|
15457
|
-
},
|
|
15458
|
-
{
|
|
15459
|
-
type: "bool",
|
|
15460
|
-
name: "isEnabled",
|
|
15461
|
-
indexed: false
|
|
15462
|
-
}
|
|
15463
|
-
]
|
|
15464
|
-
},
|
|
15465
15392
|
{
|
|
15466
15393
|
type: "event",
|
|
15467
15394
|
anonymous: false,
|
|
@@ -15558,33 +15485,6 @@ var Emiter_default = [
|
|
|
15558
15485
|
}
|
|
15559
15486
|
]
|
|
15560
15487
|
},
|
|
15561
|
-
{
|
|
15562
|
-
type: "event",
|
|
15563
|
-
anonymous: false,
|
|
15564
|
-
name: "UserSpecialFeeTierUpdated",
|
|
15565
|
-
inputs: [
|
|
15566
|
-
{
|
|
15567
|
-
type: "address",
|
|
15568
|
-
name: "broker",
|
|
15569
|
-
indexed: false
|
|
15570
|
-
},
|
|
15571
|
-
{
|
|
15572
|
-
type: "address",
|
|
15573
|
-
name: "user",
|
|
15574
|
-
indexed: false
|
|
15575
|
-
},
|
|
15576
|
-
{
|
|
15577
|
-
type: "uint8",
|
|
15578
|
-
name: "oldTier",
|
|
15579
|
-
indexed: false
|
|
15580
|
-
},
|
|
15581
|
-
{
|
|
15582
|
-
type: "uint8",
|
|
15583
|
-
name: "newTier",
|
|
15584
|
-
indexed: false
|
|
15585
|
-
}
|
|
15586
|
-
]
|
|
15587
|
-
},
|
|
15588
15488
|
{
|
|
15589
15489
|
type: "function",
|
|
15590
15490
|
name: "UPGRADE_INTERFACE_VERSION",
|
|
@@ -15600,7 +15500,7 @@ var Emiter_default = [
|
|
|
15600
15500
|
},
|
|
15601
15501
|
{
|
|
15602
15502
|
type: "function",
|
|
15603
|
-
name: "
|
|
15503
|
+
name: "emitAddOnFeeTierUpdated",
|
|
15604
15504
|
constant: false,
|
|
15605
15505
|
payable: false,
|
|
15606
15506
|
inputs: [
|
|
@@ -15609,28 +15509,20 @@ var Emiter_default = [
|
|
|
15609
15509
|
name: "params",
|
|
15610
15510
|
components: [
|
|
15611
15511
|
{
|
|
15612
|
-
type: "
|
|
15613
|
-
name: "
|
|
15614
|
-
},
|
|
15615
|
-
{
|
|
15616
|
-
type: "uint256",
|
|
15617
|
-
name: "quoteDebt"
|
|
15618
|
-
},
|
|
15619
|
-
{
|
|
15620
|
-
type: "uint256",
|
|
15621
|
-
name: "baseCollateral"
|
|
15512
|
+
type: "address",
|
|
15513
|
+
name: "broker"
|
|
15622
15514
|
},
|
|
15623
15515
|
{
|
|
15624
|
-
type: "
|
|
15625
|
-
name: "
|
|
15516
|
+
type: "uint8",
|
|
15517
|
+
name: "tier"
|
|
15626
15518
|
},
|
|
15627
15519
|
{
|
|
15628
|
-
type: "
|
|
15629
|
-
name: "
|
|
15520
|
+
type: "uint32",
|
|
15521
|
+
name: "takerFeeRate"
|
|
15630
15522
|
},
|
|
15631
15523
|
{
|
|
15632
|
-
type: "
|
|
15633
|
-
name: "
|
|
15524
|
+
type: "uint32",
|
|
15525
|
+
name: "makerFeeRate"
|
|
15634
15526
|
}
|
|
15635
15527
|
]
|
|
15636
15528
|
}
|
|
@@ -15639,7 +15531,7 @@ var Emiter_default = [
|
|
|
15639
15531
|
},
|
|
15640
15532
|
{
|
|
15641
15533
|
type: "function",
|
|
15642
|
-
name: "
|
|
15534
|
+
name: "emitCollateralAccepted",
|
|
15643
15535
|
constant: false,
|
|
15644
15536
|
payable: false,
|
|
15645
15537
|
inputs: [
|
|
@@ -15647,29 +15539,29 @@ var Emiter_default = [
|
|
|
15647
15539
|
type: "tuple",
|
|
15648
15540
|
name: "params",
|
|
15649
15541
|
components: [
|
|
15650
|
-
{
|
|
15651
|
-
type: "address",
|
|
15652
|
-
name: "user"
|
|
15653
|
-
},
|
|
15654
15542
|
{
|
|
15655
15543
|
type: "bytes32",
|
|
15656
15544
|
name: "poolId"
|
|
15657
15545
|
},
|
|
15658
15546
|
{
|
|
15659
|
-
type: "
|
|
15660
|
-
name: "
|
|
15547
|
+
type: "uint256",
|
|
15548
|
+
name: "quoteDebt"
|
|
15661
15549
|
},
|
|
15662
15550
|
{
|
|
15663
|
-
type: "
|
|
15664
|
-
name: "
|
|
15551
|
+
type: "uint256",
|
|
15552
|
+
name: "baseCollateral"
|
|
15665
15553
|
},
|
|
15666
15554
|
{
|
|
15667
15555
|
type: "uint256",
|
|
15668
|
-
name: "
|
|
15556
|
+
name: "quoteCollateral"
|
|
15669
15557
|
},
|
|
15670
15558
|
{
|
|
15671
15559
|
type: "uint256",
|
|
15672
|
-
name: "
|
|
15560
|
+
name: "totalQuoteDebt"
|
|
15561
|
+
},
|
|
15562
|
+
{
|
|
15563
|
+
type: "uint256",
|
|
15564
|
+
name: "totalBaseCollateral"
|
|
15673
15565
|
}
|
|
15674
15566
|
]
|
|
15675
15567
|
}
|
|
@@ -15849,10 +15741,6 @@ var Emiter_default = [
|
|
|
15849
15741
|
{
|
|
15850
15742
|
type: "bytes32",
|
|
15851
15743
|
name: "poolId"
|
|
15852
|
-
},
|
|
15853
|
-
{
|
|
15854
|
-
type: "string",
|
|
15855
|
-
name: "reason"
|
|
15856
15744
|
}
|
|
15857
15745
|
]
|
|
15858
15746
|
}
|
|
@@ -15920,10 +15808,6 @@ var Emiter_default = [
|
|
|
15920
15808
|
type: "uint256",
|
|
15921
15809
|
name: "orderId"
|
|
15922
15810
|
},
|
|
15923
|
-
{
|
|
15924
|
-
type: "bytes32",
|
|
15925
|
-
name: "poolId"
|
|
15926
|
-
},
|
|
15927
15811
|
{
|
|
15928
15812
|
type: "address",
|
|
15929
15813
|
name: "executor"
|
|
@@ -16026,7 +15910,7 @@ var Emiter_default = [
|
|
|
16026
15910
|
name: "poolId"
|
|
16027
15911
|
},
|
|
16028
15912
|
{
|
|
16029
|
-
type: "
|
|
15913
|
+
type: "uint256",
|
|
16030
15914
|
name: "positionId"
|
|
16031
15915
|
},
|
|
16032
15916
|
{
|
|
@@ -16068,18 +15952,6 @@ var Emiter_default = [
|
|
|
16068
15952
|
{
|
|
16069
15953
|
type: "int256",
|
|
16070
15954
|
name: "fundingFee"
|
|
16071
|
-
},
|
|
16072
|
-
{
|
|
16073
|
-
type: "address",
|
|
16074
|
-
name: "executionFeeToken"
|
|
16075
|
-
},
|
|
16076
|
-
{
|
|
16077
|
-
type: "uint256",
|
|
16078
|
-
name: "executionFeeAmount"
|
|
16079
|
-
},
|
|
16080
|
-
{
|
|
16081
|
-
type: "address",
|
|
16082
|
-
name: "keeper"
|
|
16083
15955
|
}
|
|
16084
15956
|
]
|
|
16085
15957
|
}
|
|
@@ -16148,7 +16020,7 @@ var Emiter_default = [
|
|
|
16148
16020
|
name: "poolId"
|
|
16149
16021
|
},
|
|
16150
16022
|
{
|
|
16151
|
-
type: "
|
|
16023
|
+
type: "uint256",
|
|
16152
16024
|
name: "positionId"
|
|
16153
16025
|
},
|
|
16154
16026
|
{
|
|
@@ -16797,7 +16669,7 @@ var Emiter_default = [
|
|
|
16797
16669
|
name: "poolId"
|
|
16798
16670
|
},
|
|
16799
16671
|
{
|
|
16800
|
-
type: "
|
|
16672
|
+
type: "uint256",
|
|
16801
16673
|
name: "positionId"
|
|
16802
16674
|
},
|
|
16803
16675
|
{
|
|
@@ -16844,7 +16716,7 @@ var Emiter_default = [
|
|
|
16844
16716
|
name: "poolId"
|
|
16845
16717
|
},
|
|
16846
16718
|
{
|
|
16847
|
-
type: "
|
|
16719
|
+
type: "uint256",
|
|
16848
16720
|
name: "positionId"
|
|
16849
16721
|
},
|
|
16850
16722
|
{
|
|
@@ -16891,7 +16763,7 @@ var Emiter_default = [
|
|
|
16891
16763
|
name: "poolId"
|
|
16892
16764
|
},
|
|
16893
16765
|
{
|
|
16894
|
-
type: "
|
|
16766
|
+
type: "uint256",
|
|
16895
16767
|
name: "positionId"
|
|
16896
16768
|
},
|
|
16897
16769
|
{
|
|
@@ -16917,7 +16789,7 @@ var Emiter_default = [
|
|
|
16917
16789
|
},
|
|
16918
16790
|
{
|
|
16919
16791
|
type: "function",
|
|
16920
|
-
name: "
|
|
16792
|
+
name: "emitPositionTransfer",
|
|
16921
16793
|
constant: false,
|
|
16922
16794
|
payable: false,
|
|
16923
16795
|
inputs: [
|
|
@@ -16926,55 +16798,16 @@ var Emiter_default = [
|
|
|
16926
16798
|
name: "params",
|
|
16927
16799
|
components: [
|
|
16928
16800
|
{
|
|
16929
|
-
type: "
|
|
16930
|
-
name: "
|
|
16931
|
-
},
|
|
16932
|
-
{
|
|
16933
|
-
type: "bytes32",
|
|
16934
|
-
name: "oldPositionId"
|
|
16935
|
-
},
|
|
16936
|
-
{
|
|
16937
|
-
type: "bytes32",
|
|
16938
|
-
name: "newPositionId"
|
|
16939
|
-
},
|
|
16940
|
-
{
|
|
16941
|
-
type: "uint256",
|
|
16942
|
-
name: "tokenId"
|
|
16801
|
+
type: "address",
|
|
16802
|
+
name: "from"
|
|
16943
16803
|
},
|
|
16944
16804
|
{
|
|
16945
16805
|
type: "address",
|
|
16946
|
-
name: "
|
|
16806
|
+
name: "to"
|
|
16947
16807
|
},
|
|
16948
16808
|
{
|
|
16949
|
-
type: "
|
|
16950
|
-
name: "
|
|
16951
|
-
}
|
|
16952
|
-
]
|
|
16953
|
-
}
|
|
16954
|
-
],
|
|
16955
|
-
outputs: []
|
|
16956
|
-
},
|
|
16957
|
-
{
|
|
16958
|
-
type: "function",
|
|
16959
|
-
name: "emitPositionTransfer",
|
|
16960
|
-
constant: false,
|
|
16961
|
-
payable: false,
|
|
16962
|
-
inputs: [
|
|
16963
|
-
{
|
|
16964
|
-
type: "tuple",
|
|
16965
|
-
name: "params",
|
|
16966
|
-
components: [
|
|
16967
|
-
{
|
|
16968
|
-
type: "address",
|
|
16969
|
-
name: "from"
|
|
16970
|
-
},
|
|
16971
|
-
{
|
|
16972
|
-
type: "address",
|
|
16973
|
-
name: "to"
|
|
16974
|
-
},
|
|
16975
|
-
{
|
|
16976
|
-
type: "bytes32",
|
|
16977
|
-
name: "positionId"
|
|
16809
|
+
type: "uint256",
|
|
16810
|
+
name: "positionId"
|
|
16978
16811
|
}
|
|
16979
16812
|
]
|
|
16980
16813
|
}
|
|
@@ -17000,7 +16833,7 @@ var Emiter_default = [
|
|
|
17000
16833
|
name: "owner"
|
|
17001
16834
|
},
|
|
17002
16835
|
{
|
|
17003
|
-
type: "
|
|
16836
|
+
type: "uint256",
|
|
17004
16837
|
name: "positionId"
|
|
17005
16838
|
},
|
|
17006
16839
|
{
|
|
@@ -17189,45 +17022,6 @@ var Emiter_default = [
|
|
|
17189
17022
|
],
|
|
17190
17023
|
outputs: []
|
|
17191
17024
|
},
|
|
17192
|
-
{
|
|
17193
|
-
type: "function",
|
|
17194
|
-
name: "emitTradingFeeTierUpdated",
|
|
17195
|
-
constant: false,
|
|
17196
|
-
payable: false,
|
|
17197
|
-
inputs: [
|
|
17198
|
-
{
|
|
17199
|
-
type: "tuple",
|
|
17200
|
-
name: "params",
|
|
17201
|
-
components: [
|
|
17202
|
-
{
|
|
17203
|
-
type: "address",
|
|
17204
|
-
name: "broker"
|
|
17205
|
-
},
|
|
17206
|
-
{
|
|
17207
|
-
type: "uint8",
|
|
17208
|
-
name: "feeType"
|
|
17209
|
-
},
|
|
17210
|
-
{
|
|
17211
|
-
type: "uint8",
|
|
17212
|
-
name: "tier"
|
|
17213
|
-
},
|
|
17214
|
-
{
|
|
17215
|
-
type: "uint32",
|
|
17216
|
-
name: "takerFeeRate"
|
|
17217
|
-
},
|
|
17218
|
-
{
|
|
17219
|
-
type: "int32",
|
|
17220
|
-
name: "makerFeeRate"
|
|
17221
|
-
},
|
|
17222
|
-
{
|
|
17223
|
-
type: "bool",
|
|
17224
|
-
name: "isEnabled"
|
|
17225
|
-
}
|
|
17226
|
-
]
|
|
17227
|
-
}
|
|
17228
|
-
],
|
|
17229
|
-
outputs: []
|
|
17230
|
-
},
|
|
17231
17025
|
{
|
|
17232
17026
|
type: "function",
|
|
17233
17027
|
name: "emitUserFeeDataUpdated",
|
|
@@ -17310,7 +17104,7 @@ var Emiter_default = [
|
|
|
17310
17104
|
name: "fundingFee"
|
|
17311
17105
|
},
|
|
17312
17106
|
{
|
|
17313
|
-
type: "
|
|
17107
|
+
type: "int16",
|
|
17314
17108
|
name: "tradingFeeRate"
|
|
17315
17109
|
},
|
|
17316
17110
|
{
|
|
@@ -17350,37 +17144,6 @@ var Emiter_default = [
|
|
|
17350
17144
|
],
|
|
17351
17145
|
outputs: []
|
|
17352
17146
|
},
|
|
17353
|
-
{
|
|
17354
|
-
type: "function",
|
|
17355
|
-
name: "emitUserSpecialFeeTierUpdated",
|
|
17356
|
-
constant: false,
|
|
17357
|
-
payable: false,
|
|
17358
|
-
inputs: [
|
|
17359
|
-
{
|
|
17360
|
-
type: "tuple",
|
|
17361
|
-
name: "params",
|
|
17362
|
-
components: [
|
|
17363
|
-
{
|
|
17364
|
-
type: "address",
|
|
17365
|
-
name: "broker"
|
|
17366
|
-
},
|
|
17367
|
-
{
|
|
17368
|
-
type: "address",
|
|
17369
|
-
name: "user"
|
|
17370
|
-
},
|
|
17371
|
-
{
|
|
17372
|
-
type: "uint8",
|
|
17373
|
-
name: "oldTier"
|
|
17374
|
-
},
|
|
17375
|
-
{
|
|
17376
|
-
type: "uint8",
|
|
17377
|
-
name: "newTier"
|
|
17378
|
-
}
|
|
17379
|
-
]
|
|
17380
|
-
}
|
|
17381
|
-
],
|
|
17382
|
-
outputs: []
|
|
17383
|
-
},
|
|
17384
17147
|
{
|
|
17385
17148
|
type: "function",
|
|
17386
17149
|
name: "getAddressManager",
|
|
@@ -17412,6 +17175,24 @@ var Emiter_default = [
|
|
|
17412
17175
|
}
|
|
17413
17176
|
]
|
|
17414
17177
|
},
|
|
17178
|
+
{
|
|
17179
|
+
type: "function",
|
|
17180
|
+
name: "getDependencyIdentifier",
|
|
17181
|
+
constant: true,
|
|
17182
|
+
stateMutability: "view",
|
|
17183
|
+
payable: false,
|
|
17184
|
+
inputs: [
|
|
17185
|
+
{
|
|
17186
|
+
type: "address",
|
|
17187
|
+
name: "contractAddress"
|
|
17188
|
+
}
|
|
17189
|
+
],
|
|
17190
|
+
outputs: [
|
|
17191
|
+
{
|
|
17192
|
+
type: "bytes32"
|
|
17193
|
+
}
|
|
17194
|
+
]
|
|
17195
|
+
},
|
|
17415
17196
|
{
|
|
17416
17197
|
type: "function",
|
|
17417
17198
|
name: "getImplementation",
|
|
@@ -17482,6 +17263,19 @@ var Emiter_default = [
|
|
|
17482
17263
|
],
|
|
17483
17264
|
outputs: []
|
|
17484
17265
|
},
|
|
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
|
+
},
|
|
17485
17279
|
{
|
|
17486
17280
|
type: "function",
|
|
17487
17281
|
name: "sequencer",
|
|
@@ -17495,6 +17289,36 @@ var Emiter_default = [
|
|
|
17495
17289
|
}
|
|
17496
17290
|
]
|
|
17497
17291
|
},
|
|
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
|
+
},
|
|
17498
17322
|
{
|
|
17499
17323
|
type: "function",
|
|
17500
17324
|
name: "upgradeTo",
|
|
@@ -17838,11 +17662,6 @@ var Account_default = [
|
|
|
17838
17662
|
name: "InvalidInitialization",
|
|
17839
17663
|
inputs: []
|
|
17840
17664
|
},
|
|
17841
|
-
{
|
|
17842
|
-
type: "error",
|
|
17843
|
-
name: "NotAddressManager",
|
|
17844
|
-
inputs: []
|
|
17845
|
-
},
|
|
17846
17665
|
{
|
|
17847
17666
|
type: "error",
|
|
17848
17667
|
name: "NotDependencyManager",
|
|
@@ -18052,19 +17871,6 @@ var Account_default = [
|
|
|
18052
17871
|
}
|
|
18053
17872
|
]
|
|
18054
17873
|
},
|
|
18055
|
-
{
|
|
18056
|
-
type: "function",
|
|
18057
|
-
name: "__ERC2771ContextUpgradeable_init",
|
|
18058
|
-
constant: false,
|
|
18059
|
-
payable: false,
|
|
18060
|
-
inputs: [
|
|
18061
|
-
{
|
|
18062
|
-
type: "address",
|
|
18063
|
-
name: "trustedForwarder_"
|
|
18064
|
-
}
|
|
18065
|
-
],
|
|
18066
|
-
outputs: []
|
|
18067
|
-
},
|
|
18068
17874
|
{
|
|
18069
17875
|
type: "function",
|
|
18070
17876
|
name: "deposit",
|
|
@@ -18117,6 +17923,24 @@ var Account_default = [
|
|
|
18117
17923
|
}
|
|
18118
17924
|
]
|
|
18119
17925
|
},
|
|
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
|
+
},
|
|
18120
17944
|
{
|
|
18121
17945
|
type: "function",
|
|
18122
17946
|
name: "getImplementation",
|
|
@@ -18158,28 +17982,6 @@ var Account_default = [
|
|
|
18158
17982
|
}
|
|
18159
17983
|
]
|
|
18160
17984
|
},
|
|
18161
|
-
{
|
|
18162
|
-
type: "function",
|
|
18163
|
-
name: "getUserAsset",
|
|
18164
|
-
constant: true,
|
|
18165
|
-
stateMutability: "view",
|
|
18166
|
-
payable: false,
|
|
18167
|
-
inputs: [
|
|
18168
|
-
{
|
|
18169
|
-
type: "address",
|
|
18170
|
-
name: "account"
|
|
18171
|
-
},
|
|
18172
|
-
{
|
|
18173
|
-
type: "bytes32",
|
|
18174
|
-
name: "marketId"
|
|
18175
|
-
}
|
|
18176
|
-
],
|
|
18177
|
-
outputs: [
|
|
18178
|
-
{
|
|
18179
|
-
type: "uint256"
|
|
18180
|
-
}
|
|
18181
|
-
]
|
|
18182
|
-
},
|
|
18183
17985
|
{
|
|
18184
17986
|
type: "function",
|
|
18185
17987
|
name: "getUserAssets",
|
|
@@ -18221,24 +18023,6 @@ var Account_default = [
|
|
|
18221
18023
|
],
|
|
18222
18024
|
outputs: []
|
|
18223
18025
|
},
|
|
18224
|
-
{
|
|
18225
|
-
type: "function",
|
|
18226
|
-
name: "isTrustedForwarder",
|
|
18227
|
-
constant: true,
|
|
18228
|
-
stateMutability: "view",
|
|
18229
|
-
payable: false,
|
|
18230
|
-
inputs: [
|
|
18231
|
-
{
|
|
18232
|
-
type: "address",
|
|
18233
|
-
name: "forwarder"
|
|
18234
|
-
}
|
|
18235
|
-
],
|
|
18236
|
-
outputs: [
|
|
18237
|
-
{
|
|
18238
|
-
type: "bool"
|
|
18239
|
-
}
|
|
18240
|
-
]
|
|
18241
|
-
},
|
|
18242
18026
|
{
|
|
18243
18027
|
type: "function",
|
|
18244
18028
|
name: "payWithPrincipal",
|
|
@@ -18303,6 +18087,19 @@ var Account_default = [
|
|
|
18303
18087
|
}
|
|
18304
18088
|
]
|
|
18305
18089
|
},
|
|
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
|
+
},
|
|
18306
18103
|
{
|
|
18307
18104
|
type: "function",
|
|
18308
18105
|
name: "releaseFromProfitUnlock",
|
|
@@ -18339,66 +18136,8 @@ var Account_default = [
|
|
|
18339
18136
|
name: "user"
|
|
18340
18137
|
},
|
|
18341
18138
|
{
|
|
18342
|
-
type: "
|
|
18343
|
-
name: "
|
|
18344
|
-
components: [
|
|
18345
|
-
{
|
|
18346
|
-
type: "bytes32",
|
|
18347
|
-
name: "marketId"
|
|
18348
|
-
},
|
|
18349
|
-
{
|
|
18350
|
-
type: "bytes32",
|
|
18351
|
-
name: "poolId"
|
|
18352
|
-
},
|
|
18353
|
-
{
|
|
18354
|
-
type: "address",
|
|
18355
|
-
name: "baseToken"
|
|
18356
|
-
},
|
|
18357
|
-
{
|
|
18358
|
-
type: "address",
|
|
18359
|
-
name: "quoteToken"
|
|
18360
|
-
},
|
|
18361
|
-
{
|
|
18362
|
-
type: "uint8",
|
|
18363
|
-
name: "riskTier"
|
|
18364
|
-
},
|
|
18365
|
-
{
|
|
18366
|
-
type: "uint8",
|
|
18367
|
-
name: "state"
|
|
18368
|
-
},
|
|
18369
|
-
{
|
|
18370
|
-
type: "address",
|
|
18371
|
-
name: "basePoolToken"
|
|
18372
|
-
},
|
|
18373
|
-
{
|
|
18374
|
-
type: "address",
|
|
18375
|
-
name: "quotePoolToken"
|
|
18376
|
-
},
|
|
18377
|
-
{
|
|
18378
|
-
type: "uint16",
|
|
18379
|
-
name: "maxPriceDeviation"
|
|
18380
|
-
},
|
|
18381
|
-
{
|
|
18382
|
-
type: "bool",
|
|
18383
|
-
name: "compoundEnabled"
|
|
18384
|
-
},
|
|
18385
|
-
{
|
|
18386
|
-
type: "uint64",
|
|
18387
|
-
name: "windowCapUsd"
|
|
18388
|
-
},
|
|
18389
|
-
{
|
|
18390
|
-
type: "address",
|
|
18391
|
-
name: "poolVault"
|
|
18392
|
-
},
|
|
18393
|
-
{
|
|
18394
|
-
type: "address",
|
|
18395
|
-
name: "settler"
|
|
18396
|
-
},
|
|
18397
|
-
{
|
|
18398
|
-
type: "address",
|
|
18399
|
-
name: "tradingVault"
|
|
18400
|
-
}
|
|
18401
|
-
]
|
|
18139
|
+
type: "bytes32",
|
|
18140
|
+
name: "poolId"
|
|
18402
18141
|
},
|
|
18403
18142
|
{
|
|
18404
18143
|
type: "uint256",
|
|
@@ -18421,16 +18160,16 @@ var Account_default = [
|
|
|
18421
18160
|
},
|
|
18422
18161
|
{
|
|
18423
18162
|
type: "function",
|
|
18424
|
-
name: "
|
|
18425
|
-
constant:
|
|
18426
|
-
stateMutability: "view",
|
|
18163
|
+
name: "unregisterDependencies",
|
|
18164
|
+
constant: false,
|
|
18427
18165
|
payable: false,
|
|
18428
|
-
inputs: [
|
|
18429
|
-
outputs: [
|
|
18166
|
+
inputs: [
|
|
18430
18167
|
{
|
|
18431
|
-
type: "
|
|
18168
|
+
type: "bytes32[]",
|
|
18169
|
+
name: "identifiers"
|
|
18432
18170
|
}
|
|
18433
|
-
]
|
|
18171
|
+
],
|
|
18172
|
+
outputs: []
|
|
18434
18173
|
},
|
|
18435
18174
|
{
|
|
18436
18175
|
type: "function",
|
|
@@ -18482,10 +18221,6 @@ var Account_default = [
|
|
|
18482
18221
|
type: "address",
|
|
18483
18222
|
name: "receiver"
|
|
18484
18223
|
},
|
|
18485
|
-
{
|
|
18486
|
-
type: "bool",
|
|
18487
|
-
name: "isQuoteToken"
|
|
18488
|
-
},
|
|
18489
18224
|
{
|
|
18490
18225
|
type: "uint256",
|
|
18491
18226
|
name: "amount"
|
|
@@ -19106,7 +18841,7 @@ var Account = class {
|
|
|
19106
18841
|
try {
|
|
19107
18842
|
const account = await config.signer?.getAddress() ?? "";
|
|
19108
18843
|
console.log("withdraw", account, amount, poolId);
|
|
19109
|
-
const rs = await accountContract.withdraw(poolId, account,
|
|
18844
|
+
const rs = await accountContract.withdraw(poolId, account, amount);
|
|
19110
18845
|
const receipt = await rs?.wait(1);
|
|
19111
18846
|
return {
|
|
19112
18847
|
code: 0,
|