@xchainjs/xchain-aggregator 2.0.16 → 2.0.17

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.
Files changed (3) hide show
  1. package/lib/index.esm.js +10 -10
  2. package/lib/index.js +10 -10
  3. package/package.json +16 -16
package/lib/index.esm.js CHANGED
@@ -294,8 +294,8 @@ class MayachainProtocol {
294
294
  * @returns {TxSubmitted} Transaction hash and URL of the swap
295
295
  */
296
296
  approveRouterToSpend(params) {
297
- var _a;
298
297
  return __awaiter(this, void 0, void 0, function* () {
298
+ var _a;
299
299
  const { asset, amount } = params;
300
300
  const txSubmitted = yield this.mayachainAmm.approveRouterToSpend({ asset, amount });
301
301
  yield ((_a = this.wallet) === null || _a === void 0 ? void 0 : _a.awaitTxConfirmed(asset.chain, txSubmitted.hash));
@@ -346,8 +346,8 @@ class MayachainProtocol {
346
346
  * @returns {QuoteSwap} Quote swap result. If swap cannot be done, it returns an empty QuoteSwap with reasons.
347
347
  */
348
348
  estimateSwap(params) {
349
- var _a, _b;
350
349
  return __awaiter(this, void 0, void 0, function* () {
350
+ var _a, _b;
351
351
  const estimatedSwap = yield this.mayachainAmm.estimateSwap(Object.assign(Object.assign({}, params), { fromAsset: params.fromAsset, destinationAsset: params.destinationAsset, amount: params.amount, affiliateBps: (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.affiliateBps, affiliateAddress: (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.affiliateAddress }));
352
352
  return {
353
353
  protocol: this.name,
@@ -371,8 +371,8 @@ class MayachainProtocol {
371
371
  * @returns {TxSubmitted} Transaction hash and URL of the swap
372
372
  */
373
373
  doSwap(params) {
374
- var _a, _b;
375
374
  return __awaiter(this, void 0, void 0, function* () {
375
+ var _a, _b;
376
376
  return this.mayachainAmm.doSwap(Object.assign(Object.assign({}, params), { fromAsset: params.fromAsset, destinationAsset: params.destinationAsset, amount: params.amount, affiliateBps: (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.affiliateBps, affiliateAddress: (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.affiliateAddress }));
377
377
  });
378
378
  }
@@ -381,8 +381,8 @@ class MayachainProtocol {
381
381
  * @param {Address[]} addresses Addresses of which return their swap history
382
382
  * @returns the swap history
383
383
  */
384
- getSwapHistory({ chainAddresses }) {
385
- return __awaiter(this, void 0, void 0, function* () {
384
+ getSwapHistory(_a) {
385
+ return __awaiter(this, arguments, void 0, function* ({ chainAddresses }) {
386
386
  const swapHistory = yield this.mayachainQuery.getSwapHistory({
387
387
  addresses: Array.from(new Set(chainAddresses.map((chainAddresses) => chainAddresses.address))),
388
388
  });
@@ -410,8 +410,8 @@ class ThorchainProtocol {
410
410
  * @returns {TxSubmitted} Transaction hash and URL of the swap
411
411
  */
412
412
  approveRouterToSpend(params) {
413
- var _a;
414
413
  return __awaiter(this, void 0, void 0, function* () {
414
+ var _a;
415
415
  const { asset, amount } = params;
416
416
  const txSubmitted = yield this.thorchainAmm.approveRouterToSpend({ asset, amount });
417
417
  yield ((_a = this.wallet) === null || _a === void 0 ? void 0 : _a.awaitTxConfirmed(asset.chain, txSubmitted.hash));
@@ -460,8 +460,8 @@ class ThorchainProtocol {
460
460
  * @returns {QuoteSwap} Quote swap result. If swap cannot be done, it returns an empty QuoteSwap with reasons.
461
461
  */
462
462
  estimateSwap(params) {
463
- var _a, _b;
464
463
  return __awaiter(this, void 0, void 0, function* () {
464
+ var _a, _b;
465
465
  const estimatedSwap = yield this.thorchainAmm.estimateSwap(Object.assign(Object.assign({}, params), { affiliateBps: (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.affiliateBps, affiliateAddress: (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.affiliateAddress }));
466
466
  return {
467
467
  protocol: this.name,
@@ -485,8 +485,8 @@ class ThorchainProtocol {
485
485
  * @returns {TxSubmitted} Transaction hash and URL of the swap
486
486
  */
487
487
  doSwap(params) {
488
- var _a, _b;
489
488
  return __awaiter(this, void 0, void 0, function* () {
489
+ var _a, _b;
490
490
  return this.thorchainAmm.doSwap(Object.assign(Object.assign({}, params), { affiliateBps: (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.affiliateBps, affiliateAddress: (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.affiliateAddress }));
491
491
  });
492
492
  }
@@ -495,8 +495,8 @@ class ThorchainProtocol {
495
495
  * @param {Address[]} addresses Addresses of which return their swap history
496
496
  * @returns the swap history
497
497
  */
498
- getSwapHistory({ chainAddresses }) {
499
- return __awaiter(this, void 0, void 0, function* () {
498
+ getSwapHistory(_a) {
499
+ return __awaiter(this, arguments, void 0, function* ({ chainAddresses }) {
500
500
  const swapHistory = yield this.thorchainQuery.getSwapHistory({
501
501
  addresses: Array.from(new Set(chainAddresses.map((chainAddresses) => chainAddresses.address))),
502
502
  });
package/lib/index.js CHANGED
@@ -296,8 +296,8 @@ class MayachainProtocol {
296
296
  * @returns {TxSubmitted} Transaction hash and URL of the swap
297
297
  */
298
298
  approveRouterToSpend(params) {
299
- var _a;
300
299
  return __awaiter(this, void 0, void 0, function* () {
300
+ var _a;
301
301
  const { asset, amount } = params;
302
302
  const txSubmitted = yield this.mayachainAmm.approveRouterToSpend({ asset, amount });
303
303
  yield ((_a = this.wallet) === null || _a === void 0 ? void 0 : _a.awaitTxConfirmed(asset.chain, txSubmitted.hash));
@@ -348,8 +348,8 @@ class MayachainProtocol {
348
348
  * @returns {QuoteSwap} Quote swap result. If swap cannot be done, it returns an empty QuoteSwap with reasons.
349
349
  */
350
350
  estimateSwap(params) {
351
- var _a, _b;
352
351
  return __awaiter(this, void 0, void 0, function* () {
352
+ var _a, _b;
353
353
  const estimatedSwap = yield this.mayachainAmm.estimateSwap(Object.assign(Object.assign({}, params), { fromAsset: params.fromAsset, destinationAsset: params.destinationAsset, amount: params.amount, affiliateBps: (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.affiliateBps, affiliateAddress: (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.affiliateAddress }));
354
354
  return {
355
355
  protocol: this.name,
@@ -373,8 +373,8 @@ class MayachainProtocol {
373
373
  * @returns {TxSubmitted} Transaction hash and URL of the swap
374
374
  */
375
375
  doSwap(params) {
376
- var _a, _b;
377
376
  return __awaiter(this, void 0, void 0, function* () {
377
+ var _a, _b;
378
378
  return this.mayachainAmm.doSwap(Object.assign(Object.assign({}, params), { fromAsset: params.fromAsset, destinationAsset: params.destinationAsset, amount: params.amount, affiliateBps: (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.affiliateBps, affiliateAddress: (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.affiliateAddress }));
379
379
  });
380
380
  }
@@ -383,8 +383,8 @@ class MayachainProtocol {
383
383
  * @param {Address[]} addresses Addresses of which return their swap history
384
384
  * @returns the swap history
385
385
  */
386
- getSwapHistory({ chainAddresses }) {
387
- return __awaiter(this, void 0, void 0, function* () {
386
+ getSwapHistory(_a) {
387
+ return __awaiter(this, arguments, void 0, function* ({ chainAddresses }) {
388
388
  const swapHistory = yield this.mayachainQuery.getSwapHistory({
389
389
  addresses: Array.from(new Set(chainAddresses.map((chainAddresses) => chainAddresses.address))),
390
390
  });
@@ -412,8 +412,8 @@ class ThorchainProtocol {
412
412
  * @returns {TxSubmitted} Transaction hash and URL of the swap
413
413
  */
414
414
  approveRouterToSpend(params) {
415
- var _a;
416
415
  return __awaiter(this, void 0, void 0, function* () {
416
+ var _a;
417
417
  const { asset, amount } = params;
418
418
  const txSubmitted = yield this.thorchainAmm.approveRouterToSpend({ asset, amount });
419
419
  yield ((_a = this.wallet) === null || _a === void 0 ? void 0 : _a.awaitTxConfirmed(asset.chain, txSubmitted.hash));
@@ -462,8 +462,8 @@ class ThorchainProtocol {
462
462
  * @returns {QuoteSwap} Quote swap result. If swap cannot be done, it returns an empty QuoteSwap with reasons.
463
463
  */
464
464
  estimateSwap(params) {
465
- var _a, _b;
466
465
  return __awaiter(this, void 0, void 0, function* () {
466
+ var _a, _b;
467
467
  const estimatedSwap = yield this.thorchainAmm.estimateSwap(Object.assign(Object.assign({}, params), { affiliateBps: (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.affiliateBps, affiliateAddress: (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.affiliateAddress }));
468
468
  return {
469
469
  protocol: this.name,
@@ -487,8 +487,8 @@ class ThorchainProtocol {
487
487
  * @returns {TxSubmitted} Transaction hash and URL of the swap
488
488
  */
489
489
  doSwap(params) {
490
- var _a, _b;
491
490
  return __awaiter(this, void 0, void 0, function* () {
491
+ var _a, _b;
492
492
  return this.thorchainAmm.doSwap(Object.assign(Object.assign({}, params), { affiliateBps: (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.affiliateBps, affiliateAddress: (_b = this.configuration) === null || _b === void 0 ? void 0 : _b.affiliateAddress }));
493
493
  });
494
494
  }
@@ -497,8 +497,8 @@ class ThorchainProtocol {
497
497
  * @param {Address[]} addresses Addresses of which return their swap history
498
498
  * @returns the swap history
499
499
  */
500
- getSwapHistory({ chainAddresses }) {
501
- return __awaiter(this, void 0, void 0, function* () {
500
+ getSwapHistory(_a) {
501
+ return __awaiter(this, arguments, void 0, function* ({ chainAddresses }) {
502
502
  const swapHistory = yield this.thorchainQuery.getSwapHistory({
503
503
  addresses: Array.from(new Set(chainAddresses.map((chainAddresses) => chainAddresses.address))),
504
504
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xchainjs/xchain-aggregator",
3
3
  "description": "Protocol aggregator to make actions in different protocols",
4
- "version": "2.0.16",
4
+ "version": "2.0.17",
5
5
  "license": "MIT",
6
6
  "main": "lib/index.js",
7
7
  "module": "lib/index.esm.js",
@@ -31,23 +31,23 @@
31
31
  "dependencies": {
32
32
  "@chainflip/sdk": "^1.9.2",
33
33
  "@trpc/server": "^10.45.2",
34
- "@xchainjs/xchain-client": "2.0.5",
35
- "@xchainjs/xchain-mayachain": "3.0.5",
36
- "@xchainjs/xchain-mayachain-amm": "4.0.14",
37
- "@xchainjs/xchain-mayachain-query": "2.0.7",
38
- "@xchainjs/xchain-thorchain": "3.0.9",
39
- "@xchainjs/xchain-thorchain-amm": "3.0.14",
40
- "@xchainjs/xchain-thorchain-query": "2.0.7",
41
- "@xchainjs/xchain-util": "2.0.3",
42
- "@xchainjs/xchain-wallet": "2.0.12"
34
+ "@xchainjs/xchain-client": "2.0.6",
35
+ "@xchainjs/xchain-mayachain": "3.0.6",
36
+ "@xchainjs/xchain-mayachain-amm": "4.0.15",
37
+ "@xchainjs/xchain-mayachain-query": "2.0.8",
38
+ "@xchainjs/xchain-thorchain": "3.0.10",
39
+ "@xchainjs/xchain-thorchain-amm": "3.0.15",
40
+ "@xchainjs/xchain-thorchain-query": "2.0.8",
41
+ "@xchainjs/xchain-util": "2.0.4",
42
+ "@xchainjs/xchain-wallet": "2.0.13"
43
43
  },
44
44
  "devDependencies": {
45
- "@xchainjs/xchain-avax": "2.0.8",
46
- "@xchainjs/xchain-base": "1.0.8",
47
- "@xchainjs/xchain-bitcoin": "2.0.5",
48
- "@xchainjs/xchain-bsc": "2.0.9",
49
- "@xchainjs/xchain-ethereum": "2.0.9",
50
- "@xchainjs/xchain-kujira": "2.0.5",
45
+ "@xchainjs/xchain-avax": "2.0.9",
46
+ "@xchainjs/xchain-base": "1.0.9",
47
+ "@xchainjs/xchain-bitcoin": "2.0.6",
48
+ "@xchainjs/xchain-bsc": "2.0.10",
49
+ "@xchainjs/xchain-ethereum": "2.0.10",
50
+ "@xchainjs/xchain-kujira": "2.0.6",
51
51
  "axios": "^1.8.4",
52
52
  "axios-mock-adapter": "^2.1.0"
53
53
  }