@shapeshiftoss/swapper 8.5.1 → 8.5.2
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.
|
@@ -4,7 +4,7 @@ import { ApprovalNeededOutput, BuildTradeInput, BuyAssetBySellIdInput, ExecuteTr
|
|
|
4
4
|
import { OsmoSwapperDeps } from './utils/types';
|
|
5
5
|
export declare class OsmosisSwapper implements Swapper<ChainId> {
|
|
6
6
|
readonly name = "Osmosis";
|
|
7
|
-
|
|
7
|
+
supportedAssetIds: string[];
|
|
8
8
|
deps: OsmoSwapperDeps;
|
|
9
9
|
getType(): SwapperType;
|
|
10
10
|
constructor(deps: OsmoSwapperDeps);
|
|
@@ -10,7 +10,7 @@ class OsmosisSwapper {
|
|
|
10
10
|
constructor(deps) {
|
|
11
11
|
this.name = 'Osmosis';
|
|
12
12
|
this.deps = deps;
|
|
13
|
-
this.
|
|
13
|
+
this.supportedAssetIds = [caip_1.cosmosAssetId, caip_1.osmosisAssetId];
|
|
14
14
|
}
|
|
15
15
|
getType() {
|
|
16
16
|
return api_1.SwapperType.Osmosis;
|
|
@@ -52,13 +52,13 @@ class OsmosisSwapper {
|
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
filterBuyAssetsBySellAssetId(args) {
|
|
55
|
-
const { sellAssetId } = args;
|
|
56
|
-
if (!this.
|
|
55
|
+
const { assetIds = [], sellAssetId } = args;
|
|
56
|
+
if (!this.supportedAssetIds.includes(sellAssetId))
|
|
57
57
|
return [];
|
|
58
|
-
return this.
|
|
58
|
+
return assetIds.filter((assetId) => this.supportedAssetIds.includes(assetId) && assetId !== sellAssetId);
|
|
59
59
|
}
|
|
60
60
|
filterAssetIdsBySellable() {
|
|
61
|
-
return this.
|
|
61
|
+
return this.supportedAssetIds;
|
|
62
62
|
}
|
|
63
63
|
async buildTrade(args) {
|
|
64
64
|
const { sellAsset, buyAsset, sellAmount, receiveAddress } = args;
|
package/package.json
CHANGED