@thesingularitynetwork/darkswap-sdk 0.1.34 → 0.1.35
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/darkswap-sdk.cjs.development.js +37 -9
- package/dist/darkswap-sdk.cjs.development.js.map +1 -1
- package/dist/darkswap-sdk.cjs.production.min.js +1 -1
- package/dist/darkswap-sdk.cjs.production.min.js.map +1 -1
- package/dist/darkswap-sdk.esm.js +37 -9
- package/dist/darkswap-sdk.esm.js.map +1 -1
- package/package.json +1 -1
|
@@ -5388,7 +5388,7 @@ var WithdrawService = /*#__PURE__*/function (_BaseContractService) {
|
|
|
5388
5388
|
}();
|
|
5389
5389
|
_proto.execute = /*#__PURE__*/function () {
|
|
5390
5390
|
var _execute = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(context) {
|
|
5391
|
-
var contract, tx;
|
|
5391
|
+
var contract, tx, txReceipt;
|
|
5392
5392
|
return _regenerator().w(function (_context3) {
|
|
5393
5393
|
while (1) switch (_context3.n) {
|
|
5394
5394
|
case 0:
|
|
@@ -5407,8 +5407,15 @@ var WithdrawService = /*#__PURE__*/function (_BaseContractService) {
|
|
|
5407
5407
|
case 3:
|
|
5408
5408
|
tx = _context3.v;
|
|
5409
5409
|
_context3.n = 4;
|
|
5410
|
-
return tx.
|
|
5410
|
+
return this._darkSwap.provider.waitForTransaction(tx.hash, 1);
|
|
5411
5411
|
case 4:
|
|
5412
|
+
txReceipt = _context3.v;
|
|
5413
|
+
if (!(!txReceipt || txReceipt.status !== 1)) {
|
|
5414
|
+
_context3.n = 5;
|
|
5415
|
+
break;
|
|
5416
|
+
}
|
|
5417
|
+
throw new DarkSwapError('Failed to withdraw');
|
|
5418
|
+
case 5:
|
|
5412
5419
|
return _context3.a(2, tx.hash);
|
|
5413
5420
|
}
|
|
5414
5421
|
}, _callee3, this);
|
|
@@ -9236,7 +9243,7 @@ var RetailCancelOrderService = /*#__PURE__*/function (_BaseContractService) {
|
|
|
9236
9243
|
}();
|
|
9237
9244
|
_proto.execute = /*#__PURE__*/function () {
|
|
9238
9245
|
var _execute = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3(context) {
|
|
9239
|
-
var contract, tx;
|
|
9246
|
+
var contract, tx, txReceipt;
|
|
9240
9247
|
return _regenerator().w(function (_context3) {
|
|
9241
9248
|
while (1) switch (_context3.n) {
|
|
9242
9249
|
case 0:
|
|
@@ -9255,8 +9262,15 @@ var RetailCancelOrderService = /*#__PURE__*/function (_BaseContractService) {
|
|
|
9255
9262
|
case 3:
|
|
9256
9263
|
tx = _context3.v;
|
|
9257
9264
|
_context3.n = 4;
|
|
9258
|
-
return tx.
|
|
9265
|
+
return this._darkSwap.provider.waitForTransaction(tx.hash, 1);
|
|
9259
9266
|
case 4:
|
|
9267
|
+
txReceipt = _context3.v;
|
|
9268
|
+
if (!(!txReceipt || txReceipt.status !== 1)) {
|
|
9269
|
+
_context3.n = 5;
|
|
9270
|
+
break;
|
|
9271
|
+
}
|
|
9272
|
+
throw new DarkSwapError('Failed to cancel order');
|
|
9273
|
+
case 5:
|
|
9260
9274
|
return _context3.a(2, tx.hash);
|
|
9261
9275
|
}
|
|
9262
9276
|
}, _callee3, this);
|
|
@@ -9435,7 +9449,7 @@ var RetailCreateOrderService = /*#__PURE__*/function (_BaseContractService) {
|
|
|
9435
9449
|
}();
|
|
9436
9450
|
_proto.allowance = /*#__PURE__*/function () {
|
|
9437
9451
|
var _allowance = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee4(context) {
|
|
9438
|
-
var signer, asset, amount, allowanceContract, allowance, isLegacy, contract, tx;
|
|
9452
|
+
var signer, asset, amount, allowanceContract, allowance, isLegacy, contract, tx, txReceipt;
|
|
9439
9453
|
return _regenerator().w(function (_context4) {
|
|
9440
9454
|
while (1) switch (_context4.n) {
|
|
9441
9455
|
case 0:
|
|
@@ -9454,7 +9468,7 @@ var RetailCreateOrderService = /*#__PURE__*/function (_BaseContractService) {
|
|
|
9454
9468
|
case 2:
|
|
9455
9469
|
allowance = _context4.v;
|
|
9456
9470
|
if (!(BigInt(allowance) < amount)) {
|
|
9457
|
-
_context4.n =
|
|
9471
|
+
_context4.n = 5;
|
|
9458
9472
|
break;
|
|
9459
9473
|
}
|
|
9460
9474
|
isLegacy = legacyTokenConfig.hasOwnProperty(this._darkSwap.chainId) && legacyTokenConfig[this._darkSwap.chainId].includes(asset.toLowerCase());
|
|
@@ -9464,8 +9478,15 @@ var RetailCreateOrderService = /*#__PURE__*/function (_BaseContractService) {
|
|
|
9464
9478
|
case 3:
|
|
9465
9479
|
tx = _context4.v;
|
|
9466
9480
|
_context4.n = 4;
|
|
9467
|
-
return tx.
|
|
9481
|
+
return this._darkSwap.provider.waitForTransaction(tx.hash, 1);
|
|
9468
9482
|
case 4:
|
|
9483
|
+
txReceipt = _context4.v;
|
|
9484
|
+
if (!(!txReceipt || txReceipt.status !== 1)) {
|
|
9485
|
+
_context4.n = 5;
|
|
9486
|
+
break;
|
|
9487
|
+
}
|
|
9488
|
+
throw new DarkSwapError('Failed to approve token');
|
|
9489
|
+
case 5:
|
|
9469
9490
|
return _context4.a(2);
|
|
9470
9491
|
}
|
|
9471
9492
|
}, _callee4, this);
|
|
@@ -9477,7 +9498,7 @@ var RetailCreateOrderService = /*#__PURE__*/function (_BaseContractService) {
|
|
|
9477
9498
|
}();
|
|
9478
9499
|
_proto.execute = /*#__PURE__*/function () {
|
|
9479
9500
|
var _execute = /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee5(context) {
|
|
9480
|
-
var contract, ethAmount, tx;
|
|
9501
|
+
var contract, ethAmount, tx, txReceipt;
|
|
9481
9502
|
return _regenerator().w(function (_context5) {
|
|
9482
9503
|
while (1) switch (_context5.n) {
|
|
9483
9504
|
case 0:
|
|
@@ -9510,8 +9531,15 @@ var RetailCreateOrderService = /*#__PURE__*/function (_BaseContractService) {
|
|
|
9510
9531
|
case 5:
|
|
9511
9532
|
tx = _context5.v;
|
|
9512
9533
|
_context5.n = 6;
|
|
9513
|
-
return tx.
|
|
9534
|
+
return this._darkSwap.provider.waitForTransaction(tx.hash, 1);
|
|
9514
9535
|
case 6:
|
|
9536
|
+
txReceipt = _context5.v;
|
|
9537
|
+
if (!(!txReceipt || txReceipt.status !== 1)) {
|
|
9538
|
+
_context5.n = 7;
|
|
9539
|
+
break;
|
|
9540
|
+
}
|
|
9541
|
+
throw new DarkSwapError('Failed to create order');
|
|
9542
|
+
case 7:
|
|
9515
9543
|
return _context5.a(2, tx.hash);
|
|
9516
9544
|
}
|
|
9517
9545
|
}, _callee5, this);
|