@dhedge/v2-sdk 2.1.6 → 2.1.7
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/entities/pool.d.ts +11 -0
- package/dist/services/hyperliquid/index.d.ts +1 -1
- package/dist/v2-sdk.cjs.development.js +146 -93
- package/dist/v2-sdk.cjs.development.js.map +1 -1
- package/dist/v2-sdk.cjs.production.min.js +1 -1
- package/dist/v2-sdk.cjs.production.min.js.map +1 -1
- package/dist/v2-sdk.esm.js +146 -93
- package/dist/v2-sdk.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/entities/pool.ts +37 -3
- package/src/services/hyperliquid/index.ts +8 -6
package/dist/v2-sdk.esm.js
CHANGED
|
@@ -30267,12 +30267,13 @@ var getWithdrawSpotHyperliquidTxData = function getWithdrawSpotHyperliquidTxData
|
|
|
30267
30267
|
var rawTXData = ethers.utils.solidityPack(["uint8", "uint24", "bytes"], [HYPERLIQUID_VERSION, SPOT_SEND_ACTION, innerEncoded]);
|
|
30268
30268
|
return coreWriter.encodeFunctionData("sendRawAction", [rawTXData]);
|
|
30269
30269
|
};
|
|
30270
|
-
var
|
|
30271
|
-
|
|
30272
|
-
//
|
|
30270
|
+
var getSendAssetHyperliquidTxData = function getSendAssetHyperliquidTxData(sourceDex, destinationDex, receiver, amount) {
|
|
30271
|
+
// Convert 6-decimal EVM USDC to 8-decimal HyperCore USDC (spot, main perp, and xyz)
|
|
30272
|
+
// Transfer USDC between dexes (perp, spot, xyz)
|
|
30273
|
+
var coreAmount = ethers.BigNumber.from(amount).mul(100); //From Perp to Spot
|
|
30273
30274
|
|
|
30274
30275
|
var innerEncoded = ethers.utils.defaultAbiCoder.encode( //destination, subAccount, sourceDex, destinationDex, token, amount
|
|
30275
|
-
["address", "address", "uint32", "uint32", "uint64", "uint64"], [receiver, ethers.constants.AddressZero,
|
|
30276
|
+
["address", "address", "uint32", "uint32", "uint64", "uint64"], [receiver, ethers.constants.AddressZero, sourceDex, destinationDex, USDC_TOKEN_ID, coreAmount]);
|
|
30276
30277
|
var rawTXData = ethers.utils.solidityPack(["uint8", "uint24", "bytes"], [HYPERLIQUID_VERSION, SEND_ASSET_ACTION, innerEncoded]);
|
|
30277
30278
|
return coreWriter.encodeFunctionData("sendRawAction", [rawTXData]);
|
|
30278
30279
|
};
|
|
@@ -34065,7 +34066,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
34065
34066
|
}
|
|
34066
34067
|
|
|
34067
34068
|
_context60.next = 4;
|
|
34068
|
-
return getPoolTxOrGasEstimate(this, [CORE_WRITER_ADDRESS,
|
|
34069
|
+
return getPoolTxOrGasEstimate(this, [CORE_WRITER_ADDRESS, getSendAssetHyperliquidTxData(dexId, SPOT_DEX_ID, this.address, amount), options], sdkOptions);
|
|
34069
34070
|
|
|
34070
34071
|
case 4:
|
|
34071
34072
|
tx = _context60.sent;
|
|
@@ -34085,20 +34086,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
34085
34086
|
|
|
34086
34087
|
return perpToSpotHyperliquid;
|
|
34087
34088
|
}()
|
|
34088
|
-
/**
|
|
34089
|
-
* USDC must be in the Spot wallet first — use perpToSpotHyperliquid() to move it from a trading dex.
|
|
34089
|
+
/** Move USDC from HyperCore spot wallet to a trading dex.
|
|
34090
34090
|
*
|
|
34091
|
-
* @param {
|
|
34091
|
+
* @param {number} dexId Destination dex ID where USDC will be moved to
|
|
34092
|
+
* - 0: Core Perp dex (standard perps like BTC, ETH)
|
|
34093
|
+
* - 1: xyz HIP-3 dex (builder perps like TSLA, GOLD)
|
|
34094
|
+
* @param {BigNumber | string} amount USDC amount to transfer (6 decimals, e.g. "1000000" = 1 USDC)
|
|
34092
34095
|
* @param {any} options Transaction options
|
|
34093
34096
|
* @param {SDKOptions} sdkOptions SDK options including estimateGas
|
|
34094
34097
|
* @returns {Promise<any>} Transaction
|
|
34095
34098
|
*/
|
|
34096
34099
|
;
|
|
34097
34100
|
|
|
34098
|
-
_proto.
|
|
34101
|
+
_proto.spotToPerpHyperliquid =
|
|
34099
34102
|
/*#__PURE__*/
|
|
34100
34103
|
function () {
|
|
34101
|
-
var
|
|
34104
|
+
var _spotToPerpHyperliquid = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee61(dexId, amount, options, sdkOptions) {
|
|
34102
34105
|
var tx;
|
|
34103
34106
|
return runtime_1.wrap(function _callee61$(_context61) {
|
|
34104
34107
|
while (1) {
|
|
@@ -34115,7 +34118,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
34115
34118
|
}
|
|
34116
34119
|
|
|
34117
34120
|
_context61.next = 4;
|
|
34118
|
-
return getPoolTxOrGasEstimate(this, [CORE_WRITER_ADDRESS,
|
|
34121
|
+
return getPoolTxOrGasEstimate(this, [CORE_WRITER_ADDRESS, getSendAssetHyperliquidTxData(SPOT_DEX_ID, dexId, this.address, amount), options], sdkOptions);
|
|
34119
34122
|
|
|
34120
34123
|
case 4:
|
|
34121
34124
|
tx = _context61.sent;
|
|
@@ -34129,7 +34132,57 @@ var Pool = /*#__PURE__*/function () {
|
|
|
34129
34132
|
}, _callee61, this);
|
|
34130
34133
|
}));
|
|
34131
34134
|
|
|
34132
|
-
function
|
|
34135
|
+
function spotToPerpHyperliquid(_x287, _x288, _x289, _x290) {
|
|
34136
|
+
return _spotToPerpHyperliquid.apply(this, arguments);
|
|
34137
|
+
}
|
|
34138
|
+
|
|
34139
|
+
return spotToPerpHyperliquid;
|
|
34140
|
+
}()
|
|
34141
|
+
/** Withdraw USDC from Hyperliquid Spot wallet back to EVM.
|
|
34142
|
+
* USDC must be in the Spot wallet first — use perpToSpotHyperliquid() to move it from a trading dex.
|
|
34143
|
+
*
|
|
34144
|
+
* @param {BigNumber | string} amount USDC amount to withdraw (6 decimals, e.g. "1000000" = 1 USDC)
|
|
34145
|
+
* @param {any} options Transaction options
|
|
34146
|
+
* @param {SDKOptions} sdkOptions SDK options including estimateGas
|
|
34147
|
+
* @returns {Promise<any>} Transaction
|
|
34148
|
+
*/
|
|
34149
|
+
;
|
|
34150
|
+
|
|
34151
|
+
_proto.withdrawHyperliquid =
|
|
34152
|
+
/*#__PURE__*/
|
|
34153
|
+
function () {
|
|
34154
|
+
var _withdrawHyperliquid = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee62(amount, options, sdkOptions) {
|
|
34155
|
+
var tx;
|
|
34156
|
+
return runtime_1.wrap(function _callee62$(_context62) {
|
|
34157
|
+
while (1) {
|
|
34158
|
+
switch (_context62.prev = _context62.next) {
|
|
34159
|
+
case 0:
|
|
34160
|
+
if (options === void 0) {
|
|
34161
|
+
options = null;
|
|
34162
|
+
}
|
|
34163
|
+
|
|
34164
|
+
if (sdkOptions === void 0) {
|
|
34165
|
+
sdkOptions = {
|
|
34166
|
+
estimateGas: false
|
|
34167
|
+
};
|
|
34168
|
+
}
|
|
34169
|
+
|
|
34170
|
+
_context62.next = 4;
|
|
34171
|
+
return getPoolTxOrGasEstimate(this, [CORE_WRITER_ADDRESS, getWithdrawSpotHyperliquidTxData(amount), options], sdkOptions);
|
|
34172
|
+
|
|
34173
|
+
case 4:
|
|
34174
|
+
tx = _context62.sent;
|
|
34175
|
+
return _context62.abrupt("return", tx);
|
|
34176
|
+
|
|
34177
|
+
case 6:
|
|
34178
|
+
case "end":
|
|
34179
|
+
return _context62.stop();
|
|
34180
|
+
}
|
|
34181
|
+
}
|
|
34182
|
+
}, _callee62, this);
|
|
34183
|
+
}));
|
|
34184
|
+
|
|
34185
|
+
function withdrawHyperliquid(_x291, _x292, _x293) {
|
|
34133
34186
|
return _withdrawHyperliquid.apply(this, arguments);
|
|
34134
34187
|
}
|
|
34135
34188
|
|
|
@@ -34150,11 +34203,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
34150
34203
|
_proto.openMarketOrderHyperliquid =
|
|
34151
34204
|
/*#__PURE__*/
|
|
34152
34205
|
function () {
|
|
34153
|
-
var _openMarketOrderHyperliquid = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
34206
|
+
var _openMarketOrderHyperliquid = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee63(assetId, isLong, value, slippage, options, sdkOptions) {
|
|
34154
34207
|
var tx;
|
|
34155
|
-
return runtime_1.wrap(function
|
|
34208
|
+
return runtime_1.wrap(function _callee63$(_context63) {
|
|
34156
34209
|
while (1) {
|
|
34157
|
-
switch (
|
|
34210
|
+
switch (_context63.prev = _context63.next) {
|
|
34158
34211
|
case 0:
|
|
34159
34212
|
if (slippage === void 0) {
|
|
34160
34213
|
slippage = 0.5;
|
|
@@ -34170,33 +34223,33 @@ var Pool = /*#__PURE__*/function () {
|
|
|
34170
34223
|
};
|
|
34171
34224
|
}
|
|
34172
34225
|
|
|
34173
|
-
|
|
34174
|
-
|
|
34175
|
-
|
|
34176
|
-
|
|
34226
|
+
_context63.t0 = getPoolTxOrGasEstimate;
|
|
34227
|
+
_context63.t1 = this;
|
|
34228
|
+
_context63.t2 = CORE_WRITER_ADDRESS;
|
|
34229
|
+
_context63.next = 8;
|
|
34177
34230
|
return getLimitOrderHyperliquidTxData(assetId, isLong, value, slippage);
|
|
34178
34231
|
|
|
34179
34232
|
case 8:
|
|
34180
|
-
|
|
34181
|
-
|
|
34182
|
-
|
|
34183
|
-
|
|
34184
|
-
|
|
34185
|
-
return (0,
|
|
34233
|
+
_context63.t3 = _context63.sent;
|
|
34234
|
+
_context63.t4 = options;
|
|
34235
|
+
_context63.t5 = [_context63.t2, _context63.t3, _context63.t4];
|
|
34236
|
+
_context63.t6 = sdkOptions;
|
|
34237
|
+
_context63.next = 14;
|
|
34238
|
+
return (0, _context63.t0)(_context63.t1, _context63.t5, _context63.t6);
|
|
34186
34239
|
|
|
34187
34240
|
case 14:
|
|
34188
|
-
tx =
|
|
34189
|
-
return
|
|
34241
|
+
tx = _context63.sent;
|
|
34242
|
+
return _context63.abrupt("return", tx);
|
|
34190
34243
|
|
|
34191
34244
|
case 16:
|
|
34192
34245
|
case "end":
|
|
34193
|
-
return
|
|
34246
|
+
return _context63.stop();
|
|
34194
34247
|
}
|
|
34195
34248
|
}
|
|
34196
|
-
},
|
|
34249
|
+
}, _callee63, this);
|
|
34197
34250
|
}));
|
|
34198
34251
|
|
|
34199
|
-
function openMarketOrderHyperliquid(
|
|
34252
|
+
function openMarketOrderHyperliquid(_x294, _x295, _x296, _x297, _x298, _x299) {
|
|
34200
34253
|
return _openMarketOrderHyperliquid.apply(this, arguments);
|
|
34201
34254
|
}
|
|
34202
34255
|
|
|
@@ -34215,11 +34268,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
34215
34268
|
_proto.closePositionHyperliquid =
|
|
34216
34269
|
/*#__PURE__*/
|
|
34217
34270
|
function () {
|
|
34218
|
-
var _closePositionHyperliquid = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
34271
|
+
var _closePositionHyperliquid = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee64(assetId, percentageToClose, slippage, options, sdkOptions) {
|
|
34219
34272
|
var tx;
|
|
34220
|
-
return runtime_1.wrap(function
|
|
34273
|
+
return runtime_1.wrap(function _callee64$(_context64) {
|
|
34221
34274
|
while (1) {
|
|
34222
|
-
switch (
|
|
34275
|
+
switch (_context64.prev = _context64.next) {
|
|
34223
34276
|
case 0:
|
|
34224
34277
|
if (percentageToClose === void 0) {
|
|
34225
34278
|
percentageToClose = 100;
|
|
@@ -34239,33 +34292,33 @@ var Pool = /*#__PURE__*/function () {
|
|
|
34239
34292
|
};
|
|
34240
34293
|
}
|
|
34241
34294
|
|
|
34242
|
-
|
|
34243
|
-
|
|
34244
|
-
|
|
34245
|
-
|
|
34295
|
+
_context64.t0 = getPoolTxOrGasEstimate;
|
|
34296
|
+
_context64.t1 = this;
|
|
34297
|
+
_context64.t2 = CORE_WRITER_ADDRESS;
|
|
34298
|
+
_context64.next = 9;
|
|
34246
34299
|
return getClosePositionHyperliquidTxData(assetId, percentageToClose, slippage, this.address);
|
|
34247
34300
|
|
|
34248
34301
|
case 9:
|
|
34249
|
-
|
|
34250
|
-
|
|
34251
|
-
|
|
34252
|
-
|
|
34253
|
-
|
|
34254
|
-
return (0,
|
|
34302
|
+
_context64.t3 = _context64.sent;
|
|
34303
|
+
_context64.t4 = options;
|
|
34304
|
+
_context64.t5 = [_context64.t2, _context64.t3, _context64.t4];
|
|
34305
|
+
_context64.t6 = sdkOptions;
|
|
34306
|
+
_context64.next = 15;
|
|
34307
|
+
return (0, _context64.t0)(_context64.t1, _context64.t5, _context64.t6);
|
|
34255
34308
|
|
|
34256
34309
|
case 15:
|
|
34257
|
-
tx =
|
|
34258
|
-
return
|
|
34310
|
+
tx = _context64.sent;
|
|
34311
|
+
return _context64.abrupt("return", tx);
|
|
34259
34312
|
|
|
34260
34313
|
case 17:
|
|
34261
34314
|
case "end":
|
|
34262
|
-
return
|
|
34315
|
+
return _context64.stop();
|
|
34263
34316
|
}
|
|
34264
34317
|
}
|
|
34265
|
-
},
|
|
34318
|
+
}, _callee64, this);
|
|
34266
34319
|
}));
|
|
34267
34320
|
|
|
34268
|
-
function closePositionHyperliquid(
|
|
34321
|
+
function closePositionHyperliquid(_x300, _x301, _x302, _x303, _x304) {
|
|
34269
34322
|
return _closePositionHyperliquid.apply(this, arguments);
|
|
34270
34323
|
}
|
|
34271
34324
|
|
|
@@ -34285,11 +34338,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
34285
34338
|
_proto.approveTorosLimitOrder =
|
|
34286
34339
|
/*#__PURE__*/
|
|
34287
34340
|
function () {
|
|
34288
|
-
var _approveTorosLimitOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
34341
|
+
var _approveTorosLimitOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee65(vaultAddress, amount, options, sdkOptions) {
|
|
34289
34342
|
var managerAddress, iERC20, approveTxData;
|
|
34290
|
-
return runtime_1.wrap(function
|
|
34343
|
+
return runtime_1.wrap(function _callee65$(_context65) {
|
|
34291
34344
|
while (1) {
|
|
34292
|
-
switch (
|
|
34345
|
+
switch (_context65.prev = _context65.next) {
|
|
34293
34346
|
case 0:
|
|
34294
34347
|
if (options === void 0) {
|
|
34295
34348
|
options = null;
|
|
@@ -34304,17 +34357,17 @@ var Pool = /*#__PURE__*/function () {
|
|
|
34304
34357
|
managerAddress = limitOrderAddress[this.network];
|
|
34305
34358
|
iERC20 = new ethers.utils.Interface(IERC20.abi);
|
|
34306
34359
|
approveTxData = iERC20.encodeFunctionData("approve", [managerAddress, amount]);
|
|
34307
|
-
return
|
|
34360
|
+
return _context65.abrupt("return", getPoolTxOrGasEstimate(this, [vaultAddress, approveTxData, options], sdkOptions));
|
|
34308
34361
|
|
|
34309
34362
|
case 6:
|
|
34310
34363
|
case "end":
|
|
34311
|
-
return
|
|
34364
|
+
return _context65.stop();
|
|
34312
34365
|
}
|
|
34313
34366
|
}
|
|
34314
|
-
},
|
|
34367
|
+
}, _callee65, this);
|
|
34315
34368
|
}));
|
|
34316
34369
|
|
|
34317
|
-
function approveTorosLimitOrder(
|
|
34370
|
+
function approveTorosLimitOrder(_x305, _x306, _x307, _x308) {
|
|
34318
34371
|
return _approveTorosLimitOrder.apply(this, arguments);
|
|
34319
34372
|
}
|
|
34320
34373
|
|
|
@@ -34336,11 +34389,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
34336
34389
|
_proto.createTorosLimitOrder =
|
|
34337
34390
|
/*#__PURE__*/
|
|
34338
34391
|
function () {
|
|
34339
|
-
var _createTorosLimitOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
34392
|
+
var _createTorosLimitOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee66(vaultAddress, amount, stopLossPriceD18, takeProfitPriceD18, pricingAsset, options, sdkOptions) {
|
|
34340
34393
|
var managerAddress, resolvedStopLoss, resolvedTakeProfit, info, txData;
|
|
34341
|
-
return runtime_1.wrap(function
|
|
34394
|
+
return runtime_1.wrap(function _callee66$(_context66) {
|
|
34342
34395
|
while (1) {
|
|
34343
|
-
switch (
|
|
34396
|
+
switch (_context66.prev = _context66.next) {
|
|
34344
34397
|
case 0:
|
|
34345
34398
|
if (options === void 0) {
|
|
34346
34399
|
options = null;
|
|
@@ -34355,7 +34408,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
34355
34408
|
managerAddress = limitOrderAddress[this.network];
|
|
34356
34409
|
|
|
34357
34410
|
if (managerAddress) {
|
|
34358
|
-
|
|
34411
|
+
_context66.next = 5;
|
|
34359
34412
|
break;
|
|
34360
34413
|
}
|
|
34361
34414
|
|
|
@@ -34373,17 +34426,17 @@ var Pool = /*#__PURE__*/function () {
|
|
|
34373
34426
|
pricingAsset: pricingAsset
|
|
34374
34427
|
};
|
|
34375
34428
|
txData = getCreateLimitOrderTxData(info);
|
|
34376
|
-
return
|
|
34429
|
+
return _context66.abrupt("return", getPoolTxOrGasEstimate(this, [managerAddress, txData, options], sdkOptions));
|
|
34377
34430
|
|
|
34378
34431
|
case 10:
|
|
34379
34432
|
case "end":
|
|
34380
|
-
return
|
|
34433
|
+
return _context66.stop();
|
|
34381
34434
|
}
|
|
34382
34435
|
}
|
|
34383
|
-
},
|
|
34436
|
+
}, _callee66, this);
|
|
34384
34437
|
}));
|
|
34385
34438
|
|
|
34386
|
-
function createTorosLimitOrder(
|
|
34439
|
+
function createTorosLimitOrder(_x309, _x310, _x311, _x312, _x313, _x314, _x315) {
|
|
34387
34440
|
return _createTorosLimitOrder.apply(this, arguments);
|
|
34388
34441
|
}
|
|
34389
34442
|
|
|
@@ -34405,11 +34458,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
34405
34458
|
_proto.modifyTorosLimitOrder =
|
|
34406
34459
|
/*#__PURE__*/
|
|
34407
34460
|
function () {
|
|
34408
|
-
var _modifyTorosLimitOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
34461
|
+
var _modifyTorosLimitOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee67(vaultAddress, amount, stopLossPriceD18, takeProfitPriceD18, pricingAsset, options, sdkOptions) {
|
|
34409
34462
|
var managerAddress, resolvedStopLoss, resolvedTakeProfit, info, txData;
|
|
34410
|
-
return runtime_1.wrap(function
|
|
34463
|
+
return runtime_1.wrap(function _callee67$(_context67) {
|
|
34411
34464
|
while (1) {
|
|
34412
|
-
switch (
|
|
34465
|
+
switch (_context67.prev = _context67.next) {
|
|
34413
34466
|
case 0:
|
|
34414
34467
|
if (options === void 0) {
|
|
34415
34468
|
options = null;
|
|
@@ -34424,7 +34477,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
34424
34477
|
managerAddress = limitOrderAddress[this.network];
|
|
34425
34478
|
|
|
34426
34479
|
if (managerAddress) {
|
|
34427
|
-
|
|
34480
|
+
_context67.next = 5;
|
|
34428
34481
|
break;
|
|
34429
34482
|
}
|
|
34430
34483
|
|
|
@@ -34442,17 +34495,17 @@ var Pool = /*#__PURE__*/function () {
|
|
|
34442
34495
|
pricingAsset: pricingAsset
|
|
34443
34496
|
};
|
|
34444
34497
|
txData = getModifyLimitOrderTxData(info);
|
|
34445
|
-
return
|
|
34498
|
+
return _context67.abrupt("return", getPoolTxOrGasEstimate(this, [managerAddress, txData, options], sdkOptions));
|
|
34446
34499
|
|
|
34447
34500
|
case 10:
|
|
34448
34501
|
case "end":
|
|
34449
|
-
return
|
|
34502
|
+
return _context67.stop();
|
|
34450
34503
|
}
|
|
34451
34504
|
}
|
|
34452
|
-
},
|
|
34505
|
+
}, _callee67, this);
|
|
34453
34506
|
}));
|
|
34454
34507
|
|
|
34455
|
-
function modifyTorosLimitOrder(
|
|
34508
|
+
function modifyTorosLimitOrder(_x316, _x317, _x318, _x319, _x320, _x321, _x322) {
|
|
34456
34509
|
return _modifyTorosLimitOrder.apply(this, arguments);
|
|
34457
34510
|
}
|
|
34458
34511
|
|
|
@@ -34470,11 +34523,11 @@ var Pool = /*#__PURE__*/function () {
|
|
|
34470
34523
|
_proto.deleteTorosLimitOrder =
|
|
34471
34524
|
/*#__PURE__*/
|
|
34472
34525
|
function () {
|
|
34473
|
-
var _deleteTorosLimitOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
34526
|
+
var _deleteTorosLimitOrder = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee68(vaultAddress, options, sdkOptions) {
|
|
34474
34527
|
var managerAddress, txData;
|
|
34475
|
-
return runtime_1.wrap(function
|
|
34528
|
+
return runtime_1.wrap(function _callee68$(_context68) {
|
|
34476
34529
|
while (1) {
|
|
34477
|
-
switch (
|
|
34530
|
+
switch (_context68.prev = _context68.next) {
|
|
34478
34531
|
case 0:
|
|
34479
34532
|
if (options === void 0) {
|
|
34480
34533
|
options = null;
|
|
@@ -34489,7 +34542,7 @@ var Pool = /*#__PURE__*/function () {
|
|
|
34489
34542
|
managerAddress = limitOrderAddress[this.network];
|
|
34490
34543
|
|
|
34491
34544
|
if (managerAddress) {
|
|
34492
|
-
|
|
34545
|
+
_context68.next = 5;
|
|
34493
34546
|
break;
|
|
34494
34547
|
}
|
|
34495
34548
|
|
|
@@ -34497,17 +34550,17 @@ var Pool = /*#__PURE__*/function () {
|
|
|
34497
34550
|
|
|
34498
34551
|
case 5:
|
|
34499
34552
|
txData = getDeleteLimitOrderTxData(vaultAddress);
|
|
34500
|
-
return
|
|
34553
|
+
return _context68.abrupt("return", getPoolTxOrGasEstimate(this, [managerAddress, txData, options], sdkOptions));
|
|
34501
34554
|
|
|
34502
34555
|
case 7:
|
|
34503
34556
|
case "end":
|
|
34504
|
-
return
|
|
34557
|
+
return _context68.stop();
|
|
34505
34558
|
}
|
|
34506
34559
|
}
|
|
34507
|
-
},
|
|
34560
|
+
}, _callee68, this);
|
|
34508
34561
|
}));
|
|
34509
34562
|
|
|
34510
|
-
function deleteTorosLimitOrder(
|
|
34563
|
+
function deleteTorosLimitOrder(_x323, _x324, _x325) {
|
|
34511
34564
|
return _deleteTorosLimitOrder.apply(this, arguments);
|
|
34512
34565
|
}
|
|
34513
34566
|
|
|
@@ -34524,22 +34577,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
34524
34577
|
_proto.getTorosLimitOrder =
|
|
34525
34578
|
/*#__PURE__*/
|
|
34526
34579
|
function () {
|
|
34527
|
-
var _getTorosLimitOrder2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
34528
|
-
return runtime_1.wrap(function
|
|
34580
|
+
var _getTorosLimitOrder2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee69(userAddress, vaultAddress) {
|
|
34581
|
+
return runtime_1.wrap(function _callee69$(_context69) {
|
|
34529
34582
|
while (1) {
|
|
34530
|
-
switch (
|
|
34583
|
+
switch (_context69.prev = _context69.next) {
|
|
34531
34584
|
case 0:
|
|
34532
|
-
return
|
|
34585
|
+
return _context69.abrupt("return", getTorosLimitOrder(this, userAddress, vaultAddress));
|
|
34533
34586
|
|
|
34534
34587
|
case 1:
|
|
34535
34588
|
case "end":
|
|
34536
|
-
return
|
|
34589
|
+
return _context69.stop();
|
|
34537
34590
|
}
|
|
34538
34591
|
}
|
|
34539
|
-
},
|
|
34592
|
+
}, _callee69, this);
|
|
34540
34593
|
}));
|
|
34541
34594
|
|
|
34542
|
-
function getTorosLimitOrder$1(
|
|
34595
|
+
function getTorosLimitOrder$1(_x326, _x327) {
|
|
34543
34596
|
return _getTorosLimitOrder2.apply(this, arguments);
|
|
34544
34597
|
}
|
|
34545
34598
|
|
|
@@ -34556,22 +34609,22 @@ var Pool = /*#__PURE__*/function () {
|
|
|
34556
34609
|
_proto.hasActiveTorosLimitOrder =
|
|
34557
34610
|
/*#__PURE__*/
|
|
34558
34611
|
function () {
|
|
34559
|
-
var _hasActiveTorosLimitOrder2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function
|
|
34560
|
-
return runtime_1.wrap(function
|
|
34612
|
+
var _hasActiveTorosLimitOrder2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/runtime_1.mark(function _callee70(userAddress, vaultAddress) {
|
|
34613
|
+
return runtime_1.wrap(function _callee70$(_context70) {
|
|
34561
34614
|
while (1) {
|
|
34562
|
-
switch (
|
|
34615
|
+
switch (_context70.prev = _context70.next) {
|
|
34563
34616
|
case 0:
|
|
34564
|
-
return
|
|
34617
|
+
return _context70.abrupt("return", hasActiveTorosLimitOrder(this, userAddress, vaultAddress));
|
|
34565
34618
|
|
|
34566
34619
|
case 1:
|
|
34567
34620
|
case "end":
|
|
34568
|
-
return
|
|
34621
|
+
return _context70.stop();
|
|
34569
34622
|
}
|
|
34570
34623
|
}
|
|
34571
|
-
},
|
|
34624
|
+
}, _callee70, this);
|
|
34572
34625
|
}));
|
|
34573
34626
|
|
|
34574
|
-
function hasActiveTorosLimitOrder$1(
|
|
34627
|
+
function hasActiveTorosLimitOrder$1(_x328, _x329) {
|
|
34575
34628
|
return _hasActiveTorosLimitOrder2.apply(this, arguments);
|
|
34576
34629
|
}
|
|
34577
34630
|
|