@shapeshiftoss/swapper 15.2.2 → 15.3.0

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.
@@ -1,5 +1,6 @@
1
1
  export * from './zrx/ZrxSwapper';
2
2
  export * from './thorchain/ThorchainSwapper';
3
+ export { getInboundAddressDataForChain } from './thorchain/utils/getInboundAddressDataForChain';
3
4
  export * from './test/TestSwapper';
4
5
  export * from './osmosis/OsmosisSwapper';
5
6
  export * from './cow/CowSwapper';
@@ -14,8 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.getInboundAddressDataForChain = void 0;
17
18
  __exportStar(require("./zrx/ZrxSwapper"), exports);
18
19
  __exportStar(require("./thorchain/ThorchainSwapper"), exports);
20
+ var getInboundAddressDataForChain_1 = require("./thorchain/utils/getInboundAddressDataForChain");
21
+ Object.defineProperty(exports, "getInboundAddressDataForChain", { enumerable: true, get: function () { return getInboundAddressDataForChain_1.getInboundAddressDataForChain; } });
19
22
  __exportStar(require("./test/TestSwapper"), exports);
20
23
  __exportStar(require("./osmosis/OsmosisSwapper"), exports);
21
24
  __exportStar(require("./cow/CowSwapper"), exports);
@@ -1,3 +1,3 @@
1
1
  import { AssetId } from '@shapeshiftoss/caip';
2
2
  import type { InboundAddressResponse } from '../types';
3
- export declare const getInboundAddressDataForChain: (daemonUrl: string, assetId: AssetId | undefined) => Promise<InboundAddressResponse | undefined>;
3
+ export declare const getInboundAddressDataForChain: (daemonUrl: string, assetId: AssetId | undefined, excludeHalted?: boolean) => Promise<InboundAddressResponse | undefined>;
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getInboundAddressDataForChain = void 0;
4
4
  const caip_1 = require("@shapeshiftoss/caip");
5
5
  const thorService_1 = require("./thorService");
6
- const getInboundAddressDataForChain = async (daemonUrl, assetId) => {
6
+ const getInboundAddressDataForChain = async (daemonUrl, assetId, excludeHalted = true) => {
7
7
  if (!assetId)
8
8
  return undefined;
9
9
  const assetPoolId = caip_1.adapters.assetIdToPoolAssetId({ assetId });
10
10
  const assetChainSymbol = assetPoolId === null || assetPoolId === void 0 ? void 0 : assetPoolId.slice(0, assetPoolId.indexOf('.'));
11
11
  const { data: inboundAddresses } = await thorService_1.thorService.get(`${daemonUrl}/lcd/thorchain/inbound_addresses`);
12
12
  const activeInboundAddresses = inboundAddresses.filter((a) => !a.halted);
13
- return activeInboundAddresses.find((inbound) => inbound.chain === assetChainSymbol);
13
+ return (excludeHalted ? activeInboundAddresses : inboundAddresses).find((inbound) => inbound.chain === assetChainSymbol);
14
14
  };
15
15
  exports.getInboundAddressDataForChain = getInboundAddressDataForChain;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/swapper",
3
- "version": "15.2.2",
3
+ "version": "15.3.0",
4
4
  "description": "An interface and implementations to trade coins via various protocols",
5
5
  "repository": "https://github.com/shapeshift/lib",
6
6
  "license": "MIT",