@shapeshiftoss/swapper 15.4.0 → 15.5.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.
package/dist/api.d.ts
CHANGED
|
@@ -38,6 +38,12 @@ declare type ChainSpecificQuoteFeeData<T extends ChainId> = ChainSpecific<T, {
|
|
|
38
38
|
approvalFeeCryptoBaseUnit?: string;
|
|
39
39
|
totalFee?: string;
|
|
40
40
|
};
|
|
41
|
+
[KnownChainIds.OptimismMainnet]: {
|
|
42
|
+
estimatedGas?: string;
|
|
43
|
+
gasPriceCryptoBaseUnit?: string;
|
|
44
|
+
approvalFeeCryptoBaseUnit?: string;
|
|
45
|
+
totalFee?: string;
|
|
46
|
+
};
|
|
41
47
|
[KnownChainIds.BitcoinMainnet]: {
|
|
42
48
|
byteCount: string;
|
|
43
49
|
satsPerByte: string;
|
|
@@ -65,7 +65,12 @@ class CowSwapper {
|
|
|
65
65
|
!blacklist_1.COWSWAP_UNSUPPORTED_ASSETS.includes(id));
|
|
66
66
|
}
|
|
67
67
|
filterAssetIdsBySellable(assetIds) {
|
|
68
|
-
return assetIds.filter((id) =>
|
|
68
|
+
return assetIds.filter((id) => {
|
|
69
|
+
const { chainId, assetNamespace } = (0, caip_1.fromAssetId)(id);
|
|
70
|
+
return (chainId === types_1.KnownChainIds.EthereumMainnet &&
|
|
71
|
+
assetNamespace === caip_1.ASSET_NAMESPACE.erc20 &&
|
|
72
|
+
!blacklist_1.COWSWAP_UNSUPPORTED_ASSETS.includes(id));
|
|
73
|
+
});
|
|
69
74
|
}
|
|
70
75
|
async getTradeTxs(args) {
|
|
71
76
|
return (0, cowGetTradeTxs_1.cowGetTradeTxs)(this.deps, args);
|
|
@@ -113,9 +113,7 @@ exports.pollForAtomChannelBalance = pollForAtomChannelBalance;
|
|
|
113
113
|
const findPool = async (sellAssetSymbol, buyAssetSymbol, osmoUrl) => {
|
|
114
114
|
const sellAssetDenom = exports.symbolDenomMapping[sellAssetSymbol];
|
|
115
115
|
const buyAssetDenom = exports.symbolDenomMapping[buyAssetSymbol];
|
|
116
|
-
|
|
117
|
-
// this will need to increase when adding new pools
|
|
118
|
-
const poolsUrl = osmoUrl + '/osmosis/gamm/v1beta1/pools?pagination.limit=10';
|
|
116
|
+
const poolsUrl = osmoUrl + '/osmosis/gamm/v1beta1/pools?pagination.limit=1000';
|
|
119
117
|
const poolsResponse = await (async () => {
|
|
120
118
|
try {
|
|
121
119
|
return osmoPoolsService.get(poolsUrl);
|
|
@@ -37,6 +37,7 @@ class ThorchainSwapper {
|
|
|
37
37
|
[types_1.KnownChainIds.CosmosMainnet]: true,
|
|
38
38
|
[types_1.KnownChainIds.ThorchainMainnet]: true,
|
|
39
39
|
[types_1.KnownChainIds.AvalancheMainnet]: false,
|
|
40
|
+
[types_1.KnownChainIds.OptimismMainnet]: false,
|
|
40
41
|
};
|
|
41
42
|
this.buySupportedChainIds = {
|
|
42
43
|
[types_1.KnownChainIds.EthereumMainnet]: true,
|
|
@@ -47,6 +48,7 @@ class ThorchainSwapper {
|
|
|
47
48
|
[types_1.KnownChainIds.CosmosMainnet]: true,
|
|
48
49
|
[types_1.KnownChainIds.ThorchainMainnet]: true,
|
|
49
50
|
[types_1.KnownChainIds.AvalancheMainnet]: false,
|
|
51
|
+
[types_1.KnownChainIds.OptimismMainnet]: false,
|
|
50
52
|
};
|
|
51
53
|
this.supportedSellAssetIds = [caip_1.thorchainAssetId];
|
|
52
54
|
this.supportedBuyAssetIds = [caip_1.thorchainAssetId];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ZrxSwapper = void 0;
|
|
4
|
+
const caip_1 = require("@shapeshiftoss/caip");
|
|
4
5
|
const types_1 = require("@shapeshiftoss/types");
|
|
5
6
|
const api_1 = require("../../api");
|
|
6
7
|
const getZrxTradeQuote_1 = require("./getZrxTradeQuote/getZrxTradeQuote");
|
|
@@ -51,12 +52,12 @@ class ZrxSwapper {
|
|
|
51
52
|
}
|
|
52
53
|
filterBuyAssetsBySellAssetId(args) {
|
|
53
54
|
const { assetIds = [], sellAssetId } = args;
|
|
54
|
-
return assetIds.filter((id) => id.
|
|
55
|
-
(
|
|
55
|
+
return assetIds.filter((id) => (0, caip_1.fromAssetId)(id).chainId === this.chainId &&
|
|
56
|
+
(0, caip_1.fromAssetId)(sellAssetId).chainId === this.chainId &&
|
|
56
57
|
!blacklist_1.UNSUPPORTED_ASSETS.includes(id));
|
|
57
58
|
}
|
|
58
59
|
filterAssetIdsBySellable(assetIds = []) {
|
|
59
|
-
return assetIds.filter((id) => id.
|
|
60
|
+
return assetIds.filter((id) => (0, caip_1.fromAssetId)(id).chainId === this.chainId && !blacklist_1.UNSUPPORTED_ASSETS.includes(id));
|
|
60
61
|
}
|
|
61
62
|
async getTradeTxs(tradeResult) {
|
|
62
63
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shapeshiftoss/swapper",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.5.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",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@shapeshiftoss/caip": "^8.0.0",
|
|
36
36
|
"@shapeshiftoss/chain-adapters": "^10.5.0",
|
|
37
37
|
"@shapeshiftoss/errors": "^1.1.2",
|
|
38
|
-
"@shapeshiftoss/hdwallet-core": "^1.
|
|
38
|
+
"@shapeshiftoss/hdwallet-core": "^1.42.0",
|
|
39
39
|
"@shapeshiftoss/types": "^8.1.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@shapeshiftoss/caip": "^8.0.0",
|
|
44
44
|
"@shapeshiftoss/chain-adapters": "^10.5.0",
|
|
45
45
|
"@shapeshiftoss/errors": "^1.1.2",
|
|
46
|
-
"@shapeshiftoss/hdwallet-core": "^1.
|
|
46
|
+
"@shapeshiftoss/hdwallet-core": "^1.42.0",
|
|
47
47
|
"@shapeshiftoss/types": "^8.1.0",
|
|
48
48
|
"@shapeshiftoss/unchained-client": "^10.0.1",
|
|
49
49
|
"@types/readline-sync": "^1.4.4",
|