@myx-trade/sdk 0.1.49 → 0.1.51
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 +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +8 -106
- package/dist/index.mjs +8 -106
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -890,7 +890,8 @@ declare namespace index$1 {
|
|
|
890
890
|
export { index$1_claimQuotePoolRebate as claimQuotePoolRebate, index$1_claimQuotePoolRebates as claimQuotePoolRebates, index$1_deposit as deposit, index$1_getLpPrice as getLpPrice, index$1_getRewards as getRewards, index$1_transfer as transfer, index$1_withdraw as withdraw };
|
|
891
891
|
}
|
|
892
892
|
|
|
893
|
-
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<([string, bigint, bigint, bigint, bigint, bigint] & {
|
|
893
|
+
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<([string, string, bigint, bigint, bigint, bigint, bigint] & {
|
|
894
|
+
marketId: string;
|
|
894
895
|
quoteToken: string;
|
|
895
896
|
baseReserveRatio: bigint;
|
|
896
897
|
quoteReserveRatio: bigint;
|
package/dist/index.d.ts
CHANGED
|
@@ -890,7 +890,8 @@ declare namespace index$1 {
|
|
|
890
890
|
export { index$1_claimQuotePoolRebate as claimQuotePoolRebate, index$1_claimQuotePoolRebates as claimQuotePoolRebates, index$1_deposit as deposit, index$1_getLpPrice as getLpPrice, index$1_getRewards as getRewards, index$1_transfer as transfer, index$1_withdraw as withdraw };
|
|
891
891
|
}
|
|
892
892
|
|
|
893
|
-
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<([string, bigint, bigint, bigint, bigint, bigint] & {
|
|
893
|
+
declare const getMarket: (chainId: ChainId, marketId: string) => Promise<([string, string, bigint, bigint, bigint, bigint, bigint] & {
|
|
894
|
+
marketId: string;
|
|
894
895
|
quoteToken: string;
|
|
895
896
|
baseReserveRatio: bigint;
|
|
896
897
|
quoteReserveRatio: bigint;
|
package/dist/index.js
CHANGED
|
@@ -1836,7 +1836,7 @@ var RotationProvider = class extends import_providers.BaseProvider {
|
|
|
1836
1836
|
// package.json
|
|
1837
1837
|
var package_default = {
|
|
1838
1838
|
name: "@myx-trade/sdk",
|
|
1839
|
-
version: "0.1.
|
|
1839
|
+
version: "0.1.51",
|
|
1840
1840
|
private: false,
|
|
1841
1841
|
publishConfig: {
|
|
1842
1842
|
access: "public"
|
|
@@ -13233,24 +13233,6 @@ var Order = class {
|
|
|
13233
13233
|
params.executionFeeToken
|
|
13234
13234
|
);
|
|
13235
13235
|
const collateralWithNetworkFee = BigInt(params.collateralAmount) + BigInt(networkFee);
|
|
13236
|
-
console.log("createDecreaseOrder", params);
|
|
13237
|
-
console.log("createDecreaseOrder params--->", {
|
|
13238
|
-
user: params.address,
|
|
13239
|
-
poolId: params.poolId,
|
|
13240
|
-
positionId: params.positionId,
|
|
13241
|
-
orderType: params.orderType,
|
|
13242
|
-
triggerType: params.triggerType,
|
|
13243
|
-
operation: OperationType.DECREASE,
|
|
13244
|
-
direction: params.direction,
|
|
13245
|
-
collateralAmount: collateralWithNetworkFee,
|
|
13246
|
-
size: params.size,
|
|
13247
|
-
price: params.price,
|
|
13248
|
-
timeInForce: TIME_IN_FORCE,
|
|
13249
|
-
postOnly: params.postOnly,
|
|
13250
|
-
slippagePct: params.slippagePct,
|
|
13251
|
-
executionFeeToken: params.executionFeeToken,
|
|
13252
|
-
leverage: params.leverage
|
|
13253
|
-
});
|
|
13254
13236
|
const data = {
|
|
13255
13237
|
user: params.address,
|
|
13256
13238
|
poolId: params.poolId,
|
|
@@ -13275,101 +13257,21 @@ var Order = class {
|
|
|
13275
13257
|
let transaction;
|
|
13276
13258
|
if (!params.positionId) {
|
|
13277
13259
|
const positionId = 1;
|
|
13278
|
-
this.logger.info("createDecreaseOrder salt position params--->", {
|
|
13279
|
-
const gasLimit = await brokerContract.placeOrderWithSalt.estimateGas(positionId.toString(),
|
|
13280
|
-
user: params.address,
|
|
13281
|
-
poolId: params.poolId,
|
|
13282
|
-
orderType: params.orderType,
|
|
13283
|
-
triggerType: params.triggerType,
|
|
13284
|
-
operation: OperationType.DECREASE,
|
|
13285
|
-
direction: params.direction,
|
|
13286
|
-
collateralAmount: collateralWithNetworkFee,
|
|
13287
|
-
size: params.size,
|
|
13288
|
-
price: params.price,
|
|
13289
|
-
timeInForce: TIME_IN_FORCE,
|
|
13290
|
-
postOnly: params.postOnly,
|
|
13291
|
-
slippagePct: params.slippagePct,
|
|
13292
|
-
executionFeeToken: params.executionFeeToken,
|
|
13293
|
-
leverage: params.leverage,
|
|
13294
|
-
tpSize: 0,
|
|
13295
|
-
tpPrice: 0,
|
|
13296
|
-
slSize: 0,
|
|
13297
|
-
slPrice: 0,
|
|
13298
|
-
useAccountBalance: false
|
|
13299
|
-
});
|
|
13260
|
+
this.logger.info("createDecreaseOrder salt position params--->", [positionId, { data }]);
|
|
13261
|
+
const gasLimit = await brokerContract.placeOrderWithSalt.estimateGas(positionId.toString(), data);
|
|
13300
13262
|
transaction = await brokerContract.placeOrderWithSalt(
|
|
13301
|
-
|
|
13302
|
-
|
|
13303
|
-
user: params.address,
|
|
13304
|
-
poolId: params.poolId,
|
|
13305
|
-
orderType: params.orderType,
|
|
13306
|
-
triggerType: params.triggerType,
|
|
13307
|
-
operation: OperationType.DECREASE,
|
|
13308
|
-
direction: params.direction,
|
|
13309
|
-
collateralAmount: collateralWithNetworkFee,
|
|
13310
|
-
size: params.size,
|
|
13311
|
-
price: params.price,
|
|
13312
|
-
timeInForce: TIME_IN_FORCE,
|
|
13313
|
-
postOnly: false,
|
|
13314
|
-
slippagePct: params.slippagePct,
|
|
13315
|
-
executionFeeToken: params.executionFeeToken,
|
|
13316
|
-
leverage: params.leverage,
|
|
13317
|
-
tpSize: 0,
|
|
13318
|
-
tpPrice: 0,
|
|
13319
|
-
slSize: 0,
|
|
13320
|
-
slPrice: 0,
|
|
13321
|
-
useAccountBalance: false
|
|
13322
|
-
},
|
|
13263
|
+
positionId.toString(),
|
|
13264
|
+
data,
|
|
13323
13265
|
{
|
|
13324
13266
|
gasLimit: gasLimit * 130n / 100n
|
|
13325
13267
|
}
|
|
13326
13268
|
);
|
|
13327
13269
|
} else {
|
|
13328
|
-
this.logger.info("createDecreaseOrder nft position params--->", {
|
|
13329
|
-
const gasLimit = await brokerContract.placeOrderWithPosition.estimateGas(params.positionId.toString(),
|
|
13330
|
-
user: params.address,
|
|
13331
|
-
poolId: params.poolId,
|
|
13332
|
-
orderType: params.orderType,
|
|
13333
|
-
triggerType: params.triggerType,
|
|
13334
|
-
operation: OperationType.DECREASE,
|
|
13335
|
-
direction: params.direction,
|
|
13336
|
-
collateralAmount: collateralWithNetworkFee,
|
|
13337
|
-
size: params.size,
|
|
13338
|
-
price: params.price,
|
|
13339
|
-
timeInForce: TIME_IN_FORCE,
|
|
13340
|
-
postOnly: params.postOnly,
|
|
13341
|
-
slippagePct: params.slippagePct,
|
|
13342
|
-
executionFeeToken: params.executionFeeToken,
|
|
13343
|
-
leverage: params.leverage,
|
|
13344
|
-
tpSize: 0,
|
|
13345
|
-
tpPrice: 0,
|
|
13346
|
-
slSize: 0,
|
|
13347
|
-
slPrice: 0,
|
|
13348
|
-
useAccountBalance: false
|
|
13349
|
-
});
|
|
13270
|
+
this.logger.info("createDecreaseOrder nft position params--->", [params.positionId, { data }]);
|
|
13271
|
+
const gasLimit = await brokerContract.placeOrderWithPosition.estimateGas(params.positionId.toString(), data);
|
|
13350
13272
|
transaction = await brokerContract.placeOrderWithPosition(
|
|
13351
13273
|
params.positionId.toString(),
|
|
13352
|
-
|
|
13353
|
-
user: params.address,
|
|
13354
|
-
poolId: params.poolId,
|
|
13355
|
-
orderType: params.orderType,
|
|
13356
|
-
triggerType: params.triggerType,
|
|
13357
|
-
operation: OperationType.DECREASE,
|
|
13358
|
-
direction: params.direction,
|
|
13359
|
-
collateralAmount: collateralWithNetworkFee,
|
|
13360
|
-
size: params.size,
|
|
13361
|
-
price: params.price,
|
|
13362
|
-
timeInForce: TIME_IN_FORCE,
|
|
13363
|
-
postOnly: false,
|
|
13364
|
-
slippagePct: params.slippagePct,
|
|
13365
|
-
executionFeeToken: params.executionFeeToken,
|
|
13366
|
-
leverage: params.leverage,
|
|
13367
|
-
tpSize: 0,
|
|
13368
|
-
tpPrice: 0,
|
|
13369
|
-
slSize: 0,
|
|
13370
|
-
slPrice: 0,
|
|
13371
|
-
useAccountBalance: false
|
|
13372
|
-
},
|
|
13274
|
+
data,
|
|
13373
13275
|
{
|
|
13374
13276
|
gasLimit: gasLimit * 130n / 100n
|
|
13375
13277
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1751,7 +1751,7 @@ var RotationProvider = class extends BaseProvider {
|
|
|
1751
1751
|
// package.json
|
|
1752
1752
|
var package_default = {
|
|
1753
1753
|
name: "@myx-trade/sdk",
|
|
1754
|
-
version: "0.1.
|
|
1754
|
+
version: "0.1.51",
|
|
1755
1755
|
private: false,
|
|
1756
1756
|
publishConfig: {
|
|
1757
1757
|
access: "public"
|
|
@@ -13148,24 +13148,6 @@ var Order = class {
|
|
|
13148
13148
|
params.executionFeeToken
|
|
13149
13149
|
);
|
|
13150
13150
|
const collateralWithNetworkFee = BigInt(params.collateralAmount) + BigInt(networkFee);
|
|
13151
|
-
console.log("createDecreaseOrder", params);
|
|
13152
|
-
console.log("createDecreaseOrder params--->", {
|
|
13153
|
-
user: params.address,
|
|
13154
|
-
poolId: params.poolId,
|
|
13155
|
-
positionId: params.positionId,
|
|
13156
|
-
orderType: params.orderType,
|
|
13157
|
-
triggerType: params.triggerType,
|
|
13158
|
-
operation: OperationType.DECREASE,
|
|
13159
|
-
direction: params.direction,
|
|
13160
|
-
collateralAmount: collateralWithNetworkFee,
|
|
13161
|
-
size: params.size,
|
|
13162
|
-
price: params.price,
|
|
13163
|
-
timeInForce: TIME_IN_FORCE,
|
|
13164
|
-
postOnly: params.postOnly,
|
|
13165
|
-
slippagePct: params.slippagePct,
|
|
13166
|
-
executionFeeToken: params.executionFeeToken,
|
|
13167
|
-
leverage: params.leverage
|
|
13168
|
-
});
|
|
13169
13151
|
const data = {
|
|
13170
13152
|
user: params.address,
|
|
13171
13153
|
poolId: params.poolId,
|
|
@@ -13190,101 +13172,21 @@ var Order = class {
|
|
|
13190
13172
|
let transaction;
|
|
13191
13173
|
if (!params.positionId) {
|
|
13192
13174
|
const positionId = 1;
|
|
13193
|
-
this.logger.info("createDecreaseOrder salt position params--->", {
|
|
13194
|
-
const gasLimit = await brokerContract.placeOrderWithSalt.estimateGas(positionId.toString(),
|
|
13195
|
-
user: params.address,
|
|
13196
|
-
poolId: params.poolId,
|
|
13197
|
-
orderType: params.orderType,
|
|
13198
|
-
triggerType: params.triggerType,
|
|
13199
|
-
operation: OperationType.DECREASE,
|
|
13200
|
-
direction: params.direction,
|
|
13201
|
-
collateralAmount: collateralWithNetworkFee,
|
|
13202
|
-
size: params.size,
|
|
13203
|
-
price: params.price,
|
|
13204
|
-
timeInForce: TIME_IN_FORCE,
|
|
13205
|
-
postOnly: params.postOnly,
|
|
13206
|
-
slippagePct: params.slippagePct,
|
|
13207
|
-
executionFeeToken: params.executionFeeToken,
|
|
13208
|
-
leverage: params.leverage,
|
|
13209
|
-
tpSize: 0,
|
|
13210
|
-
tpPrice: 0,
|
|
13211
|
-
slSize: 0,
|
|
13212
|
-
slPrice: 0,
|
|
13213
|
-
useAccountBalance: false
|
|
13214
|
-
});
|
|
13175
|
+
this.logger.info("createDecreaseOrder salt position params--->", [positionId, { data }]);
|
|
13176
|
+
const gasLimit = await brokerContract.placeOrderWithSalt.estimateGas(positionId.toString(), data);
|
|
13215
13177
|
transaction = await brokerContract.placeOrderWithSalt(
|
|
13216
|
-
|
|
13217
|
-
|
|
13218
|
-
user: params.address,
|
|
13219
|
-
poolId: params.poolId,
|
|
13220
|
-
orderType: params.orderType,
|
|
13221
|
-
triggerType: params.triggerType,
|
|
13222
|
-
operation: OperationType.DECREASE,
|
|
13223
|
-
direction: params.direction,
|
|
13224
|
-
collateralAmount: collateralWithNetworkFee,
|
|
13225
|
-
size: params.size,
|
|
13226
|
-
price: params.price,
|
|
13227
|
-
timeInForce: TIME_IN_FORCE,
|
|
13228
|
-
postOnly: false,
|
|
13229
|
-
slippagePct: params.slippagePct,
|
|
13230
|
-
executionFeeToken: params.executionFeeToken,
|
|
13231
|
-
leverage: params.leverage,
|
|
13232
|
-
tpSize: 0,
|
|
13233
|
-
tpPrice: 0,
|
|
13234
|
-
slSize: 0,
|
|
13235
|
-
slPrice: 0,
|
|
13236
|
-
useAccountBalance: false
|
|
13237
|
-
},
|
|
13178
|
+
positionId.toString(),
|
|
13179
|
+
data,
|
|
13238
13180
|
{
|
|
13239
13181
|
gasLimit: gasLimit * 130n / 100n
|
|
13240
13182
|
}
|
|
13241
13183
|
);
|
|
13242
13184
|
} else {
|
|
13243
|
-
this.logger.info("createDecreaseOrder nft position params--->", {
|
|
13244
|
-
const gasLimit = await brokerContract.placeOrderWithPosition.estimateGas(params.positionId.toString(),
|
|
13245
|
-
user: params.address,
|
|
13246
|
-
poolId: params.poolId,
|
|
13247
|
-
orderType: params.orderType,
|
|
13248
|
-
triggerType: params.triggerType,
|
|
13249
|
-
operation: OperationType.DECREASE,
|
|
13250
|
-
direction: params.direction,
|
|
13251
|
-
collateralAmount: collateralWithNetworkFee,
|
|
13252
|
-
size: params.size,
|
|
13253
|
-
price: params.price,
|
|
13254
|
-
timeInForce: TIME_IN_FORCE,
|
|
13255
|
-
postOnly: params.postOnly,
|
|
13256
|
-
slippagePct: params.slippagePct,
|
|
13257
|
-
executionFeeToken: params.executionFeeToken,
|
|
13258
|
-
leverage: params.leverage,
|
|
13259
|
-
tpSize: 0,
|
|
13260
|
-
tpPrice: 0,
|
|
13261
|
-
slSize: 0,
|
|
13262
|
-
slPrice: 0,
|
|
13263
|
-
useAccountBalance: false
|
|
13264
|
-
});
|
|
13185
|
+
this.logger.info("createDecreaseOrder nft position params--->", [params.positionId, { data }]);
|
|
13186
|
+
const gasLimit = await brokerContract.placeOrderWithPosition.estimateGas(params.positionId.toString(), data);
|
|
13265
13187
|
transaction = await brokerContract.placeOrderWithPosition(
|
|
13266
13188
|
params.positionId.toString(),
|
|
13267
|
-
|
|
13268
|
-
user: params.address,
|
|
13269
|
-
poolId: params.poolId,
|
|
13270
|
-
orderType: params.orderType,
|
|
13271
|
-
triggerType: params.triggerType,
|
|
13272
|
-
operation: OperationType.DECREASE,
|
|
13273
|
-
direction: params.direction,
|
|
13274
|
-
collateralAmount: collateralWithNetworkFee,
|
|
13275
|
-
size: params.size,
|
|
13276
|
-
price: params.price,
|
|
13277
|
-
timeInForce: TIME_IN_FORCE,
|
|
13278
|
-
postOnly: false,
|
|
13279
|
-
slippagePct: params.slippagePct,
|
|
13280
|
-
executionFeeToken: params.executionFeeToken,
|
|
13281
|
-
leverage: params.leverage,
|
|
13282
|
-
tpSize: 0,
|
|
13283
|
-
tpPrice: 0,
|
|
13284
|
-
slSize: 0,
|
|
13285
|
-
slPrice: 0,
|
|
13286
|
-
useAccountBalance: false
|
|
13287
|
-
},
|
|
13189
|
+
data,
|
|
13288
13190
|
{
|
|
13289
13191
|
gasLimit: gasLimit * 130n / 100n
|
|
13290
13192
|
}
|