@shapeshiftoss/swapper 1.14.1 → 1.15.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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CAIP19 } from '@shapeshiftoss/caip';
|
|
1
2
|
import { HDWallet } from '@shapeshiftoss/hdwallet-core';
|
|
2
3
|
import { ApprovalNeededInput, ApprovalNeededOutput, ApproveInfiniteInput, Asset, BuildQuoteTxInput, ChainTypes, ExecQuoteInput, ExecQuoteOutput, GetQuoteInput, MinMaxOutput, Quote, SendMaxAmountInput, SwapperType } from '@shapeshiftoss/types';
|
|
3
4
|
export declare class SwapError extends Error {
|
|
@@ -28,7 +29,7 @@ export interface Swapper {
|
|
|
28
29
|
/**
|
|
29
30
|
* Get the default pair of the swapper
|
|
30
31
|
*/
|
|
31
|
-
getDefaultPair():
|
|
32
|
+
getDefaultPair(): [CAIP19, CAIP19];
|
|
32
33
|
/**
|
|
33
34
|
* Get the minimum and maximum trade value of the sellAsset and buyAsset
|
|
34
35
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CAIP19 } from '@shapeshiftoss/caip';
|
|
1
2
|
import { ApprovalNeededOutput, Asset, ChainTypes, ExecQuoteOutput, GetQuoteInput, MinMaxOutput, Quote, SwapperType } from '@shapeshiftoss/types';
|
|
2
3
|
import { Swapper } from '../../api';
|
|
3
4
|
export declare class ThorchainSwapper implements Swapper {
|
|
@@ -9,7 +10,7 @@ export declare class ThorchainSwapper implements Swapper {
|
|
|
9
10
|
getAvailableAssets(assets: Asset[]): Asset[];
|
|
10
11
|
canTradePair(sellAsset: Asset, buyAsset: Asset): boolean;
|
|
11
12
|
executeQuote(): Promise<ExecQuoteOutput>;
|
|
12
|
-
getDefaultPair():
|
|
13
|
+
getDefaultPair(): [CAIP19, CAIP19];
|
|
13
14
|
approvalNeeded(): Promise<ApprovalNeededOutput>;
|
|
14
15
|
approveInfinite(): Promise<string>;
|
|
15
16
|
getSendMaxAmount(): Promise<string>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CAIP19 } from '@shapeshiftoss/caip';
|
|
1
2
|
import { ChainAdapterManager } from '@shapeshiftoss/chain-adapters';
|
|
2
3
|
import { ApprovalNeededInput, ApprovalNeededOutput, ApproveInfiniteInput, Asset, BuildQuoteTxInput, ChainTypes, ExecQuoteInput, ExecQuoteOutput, GetQuoteInput, MinMaxOutput, Quote, SendMaxAmountInput, SwapperType } from '@shapeshiftoss/types';
|
|
3
4
|
import Web3 from 'web3';
|
|
@@ -20,7 +21,7 @@ export declare class ZrxSwapper implements Swapper {
|
|
|
20
21
|
getMinMax(input: GetQuoteInput): Promise<MinMaxOutput>;
|
|
21
22
|
getAvailableAssets(assets: Asset[]): Asset[];
|
|
22
23
|
canTradePair(sellAsset: Asset, buyAsset: Asset): boolean;
|
|
23
|
-
getDefaultPair():
|
|
24
|
+
getDefaultPair(): [CAIP19, CAIP19];
|
|
24
25
|
executeQuote(args: ExecQuoteInput<ChainTypes, SwapperType>): Promise<ExecQuoteOutput>;
|
|
25
26
|
approvalNeeded(args: ApprovalNeededInput<ChainTypes, SwapperType>): Promise<ApprovalNeededOutput>;
|
|
26
27
|
approveInfinite(args: ApproveInfiniteInput<ChainTypes, SwapperType>): Promise<string>;
|
|
@@ -44,8 +44,8 @@ class ZrxSwapper {
|
|
|
44
44
|
return availableAssets.length === 2;
|
|
45
45
|
}
|
|
46
46
|
getDefaultPair() {
|
|
47
|
-
const ETH =
|
|
48
|
-
const FOX =
|
|
47
|
+
const ETH = 'eip155:1/slip44:60';
|
|
48
|
+
const FOX = 'eip155:1/erc20:0xc770eefad204b5180df6a14ee197d99d808ee52d';
|
|
49
49
|
return [ETH, FOX];
|
|
50
50
|
}
|
|
51
51
|
async executeQuote(args) {
|