@shapeshiftoss/swapper 5.4.0 → 5.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 +1 -0
- package/dist/api.js +1 -0
- package/dist/swappers/cow/CowSwapper.d.ts +18 -0
- package/dist/swappers/cow/CowSwapper.js +52 -0
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
package/dist/api.js
CHANGED
|
@@ -7,6 +7,7 @@ var SwapperType;
|
|
|
7
7
|
(function (SwapperType) {
|
|
8
8
|
SwapperType["Zrx"] = "0x";
|
|
9
9
|
SwapperType["Thorchain"] = "Thorchain";
|
|
10
|
+
SwapperType["CowSwap"] = "CowSwap";
|
|
10
11
|
SwapperType["Test"] = "Test";
|
|
11
12
|
})(SwapperType = exports.SwapperType || (exports.SwapperType = {}));
|
|
12
13
|
// Swap Errors
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AssetId } from '@shapeshiftoss/caip';
|
|
2
|
+
import { Asset, SupportedChainIds } from '@shapeshiftoss/types';
|
|
3
|
+
import { ApprovalNeededInput, ApprovalNeededOutput, ApproveInfiniteInput, BuildTradeInput, BuyAssetBySellIdInput, ExecuteTradeInput, GetMinMaxInput, GetTradeQuoteInput, MinMaxOutput, Swapper, SwapperType, Trade, TradeQuote, TradeResult, TradeTxs } from '../../api';
|
|
4
|
+
export declare class CowSwapper implements Swapper {
|
|
5
|
+
static swapperName: string;
|
|
6
|
+
initialize(): Promise<void>;
|
|
7
|
+
getType(): SwapperType;
|
|
8
|
+
buildTrade(args: BuildTradeInput): Promise<Trade<SupportedChainIds>>;
|
|
9
|
+
getTradeQuote(input: GetTradeQuoteInput): Promise<TradeQuote<SupportedChainIds>>;
|
|
10
|
+
getUsdRate(input: Pick<Asset, 'symbol' | 'assetId'>): Promise<string>;
|
|
11
|
+
getMinMax(input: GetMinMaxInput): Promise<MinMaxOutput>;
|
|
12
|
+
executeTrade(args: ExecuteTradeInput<SupportedChainIds>): Promise<TradeResult>;
|
|
13
|
+
approvalNeeded(args: ApprovalNeededInput<SupportedChainIds>): Promise<ApprovalNeededOutput>;
|
|
14
|
+
approveInfinite(args: ApproveInfiniteInput<SupportedChainIds>): Promise<string>;
|
|
15
|
+
filterBuyAssetsBySellAssetId(args: BuyAssetBySellIdInput): AssetId[];
|
|
16
|
+
filterAssetIdsBySellable(assetIds: AssetId[]): AssetId[];
|
|
17
|
+
getTradeTxs(): Promise<TradeTxs>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CowSwapper = void 0;
|
|
4
|
+
const api_1 = require("../../api");
|
|
5
|
+
class CowSwapper {
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
7
|
+
async initialize() { }
|
|
8
|
+
getType() {
|
|
9
|
+
return api_1.SwapperType.CowSwap;
|
|
10
|
+
}
|
|
11
|
+
async buildTrade(args) {
|
|
12
|
+
console.info(args);
|
|
13
|
+
throw new Error('CowSwapper: buildTrade unimplemented');
|
|
14
|
+
}
|
|
15
|
+
async getTradeQuote(input) {
|
|
16
|
+
console.info(input);
|
|
17
|
+
throw new Error('CowSwapper: getTradeQuote unimplemented');
|
|
18
|
+
}
|
|
19
|
+
getUsdRate(input) {
|
|
20
|
+
console.info(input);
|
|
21
|
+
throw new Error('CowSwapper: getUsdRate unimplemented');
|
|
22
|
+
}
|
|
23
|
+
getMinMax(input) {
|
|
24
|
+
console.info(input);
|
|
25
|
+
throw new Error('CowSwapper: getMinMax unimplemented');
|
|
26
|
+
}
|
|
27
|
+
async executeTrade(args) {
|
|
28
|
+
console.info(args);
|
|
29
|
+
throw new Error('CowSwapper: executeTrade unimplemented');
|
|
30
|
+
}
|
|
31
|
+
async approvalNeeded(args) {
|
|
32
|
+
console.info(args);
|
|
33
|
+
throw new Error('CowSwapper: approvalNeeded unimplemented');
|
|
34
|
+
}
|
|
35
|
+
async approveInfinite(args) {
|
|
36
|
+
console.info(args);
|
|
37
|
+
throw new Error('CowSwapper: approveInfinite unimplemented');
|
|
38
|
+
}
|
|
39
|
+
filterBuyAssetsBySellAssetId(args) {
|
|
40
|
+
console.info(args);
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
filterAssetIdsBySellable(assetIds) {
|
|
44
|
+
console.info(assetIds);
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
async getTradeTxs() {
|
|
48
|
+
throw new Error('CowSwapper: executeTrade unimplemented');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.CowSwapper = CowSwapper;
|
|
52
|
+
CowSwapper.swapperName = 'CowSwapper';
|