@shapeshiftoss/swapper 2.3.0 → 3.0.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 +5 -5
- package/dist/swappers/test/TestSwapper.d.ts +2 -2
- package/dist/swappers/thorchain/ThorchainSwapper.d.ts +2 -2
- package/dist/swappers/zrx/ZrxApprovalNeeded/ZrxApprovalNeeded.d.ts +2 -2
- package/dist/swappers/zrx/ZrxApproveInfinite/ZrxApproveInfinite.d.ts +2 -2
- package/dist/swappers/zrx/ZrxBuildQuoteTx/ZrxBuildQuoteTx.d.ts +2 -2
- package/dist/swappers/zrx/ZrxExecuteQuote/ZrxExecuteQuote.d.ts +2 -2
- package/dist/swappers/zrx/ZrxSwapper.d.ts +5 -5
- package/dist/swappers/zrx/getZrxQuote/getZrxQuote.d.ts +2 -2
- package/dist/swappers/zrx/utils/helpers/helpers.d.ts +3 -3
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -23,11 +23,11 @@ export interface Swapper {
|
|
|
23
23
|
/**
|
|
24
24
|
* Get a Quote along with an unsigned transaction that can be signed and broadcast to execute the swap
|
|
25
25
|
**/
|
|
26
|
-
buildQuoteTx(args: BuildQuoteTxInput): Promise<Quote<ChainTypes
|
|
26
|
+
buildQuoteTx(args: BuildQuoteTxInput): Promise<Quote<ChainTypes>>;
|
|
27
27
|
/**
|
|
28
28
|
* Get a basic quote (rate) for a trading pair
|
|
29
29
|
*/
|
|
30
|
-
getQuote(input: GetQuoteInput, wallet?: HDWallet): Promise<Quote<ChainTypes
|
|
30
|
+
getQuote(input: GetQuoteInput, wallet?: HDWallet): Promise<Quote<ChainTypes>>;
|
|
31
31
|
/**
|
|
32
32
|
* Get the usd rate from either the assets symbol or tokenId
|
|
33
33
|
*/
|
|
@@ -43,15 +43,15 @@ export interface Swapper {
|
|
|
43
43
|
/**
|
|
44
44
|
* Execute a quote built with buildQuoteTx by signing and broadcasting
|
|
45
45
|
*/
|
|
46
|
-
executeQuote(args: ExecQuoteInput<ChainTypes
|
|
46
|
+
executeQuote(args: ExecQuoteInput<ChainTypes>): Promise<ExecQuoteOutput>;
|
|
47
47
|
/**
|
|
48
48
|
* Get a boolean if a quote needs approval
|
|
49
49
|
*/
|
|
50
|
-
approvalNeeded(args: ApprovalNeededInput<ChainTypes
|
|
50
|
+
approvalNeeded(args: ApprovalNeededInput<ChainTypes>): Promise<ApprovalNeededOutput>;
|
|
51
51
|
/**
|
|
52
52
|
* Get the txid of an approve infinite transaction
|
|
53
53
|
*/
|
|
54
|
-
approveInfinite(args: ApproveInfiniteInput<ChainTypes
|
|
54
|
+
approveInfinite(args: ApproveInfiniteInput<ChainTypes>): Promise<string>;
|
|
55
55
|
/**
|
|
56
56
|
* Get supported buyAssetId's by sellAssetId
|
|
57
57
|
*/
|
|
@@ -9,8 +9,8 @@ export declare class TestSwapper implements Swapper {
|
|
|
9
9
|
supportAssets: string[];
|
|
10
10
|
getType(): SwapperType;
|
|
11
11
|
constructor();
|
|
12
|
-
getQuote(): Promise<Quote<ChainTypes
|
|
13
|
-
buildQuoteTx(): Promise<Quote<ChainTypes
|
|
12
|
+
getQuote(): Promise<Quote<ChainTypes>>;
|
|
13
|
+
buildQuoteTx(): Promise<Quote<ChainTypes>>;
|
|
14
14
|
getUsdRate(input: Pick<Asset, 'symbol' | 'tokenId'>): Promise<string>;
|
|
15
15
|
getMinMax(input: GetQuoteInput): Promise<MinMaxOutput>;
|
|
16
16
|
executeQuote(): Promise<ExecQuoteOutput>;
|
|
@@ -3,8 +3,8 @@ import { ApprovalNeededOutput, Asset, ChainTypes, ExecQuoteOutput, GetQuoteInput
|
|
|
3
3
|
import { Swapper } from '../../api';
|
|
4
4
|
export declare class ThorchainSwapper implements Swapper {
|
|
5
5
|
getType(): SwapperType;
|
|
6
|
-
getQuote(): Promise<Quote<ChainTypes
|
|
7
|
-
buildQuoteTx(): Promise<Quote<ChainTypes
|
|
6
|
+
getQuote(): Promise<Quote<ChainTypes>>;
|
|
7
|
+
buildQuoteTx(): Promise<Quote<ChainTypes>>;
|
|
8
8
|
getUsdRate(input: Pick<Asset, 'symbol' | 'tokenId'>): Promise<string>;
|
|
9
9
|
getMinMax(input: GetQuoteInput): Promise<MinMaxOutput>;
|
|
10
10
|
executeQuote(): Promise<ExecQuoteOutput>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ApprovalNeededInput, ApprovalNeededOutput, ChainTypes
|
|
1
|
+
import { ApprovalNeededInput, ApprovalNeededOutput, ChainTypes } from '@shapeshiftoss/types';
|
|
2
2
|
import { ZrxSwapperDeps } from '../ZrxSwapper';
|
|
3
|
-
export declare function ZrxApprovalNeeded({ adapterManager, web3 }: ZrxSwapperDeps, { quote, wallet }: ApprovalNeededInput<ChainTypes
|
|
3
|
+
export declare function ZrxApprovalNeeded({ adapterManager, web3 }: ZrxSwapperDeps, { quote, wallet }: ApprovalNeededInput<ChainTypes>): Promise<ApprovalNeededOutput>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ApproveInfiniteInput, ChainTypes
|
|
1
|
+
import { ApproveInfiniteInput, ChainTypes } from '@shapeshiftoss/types';
|
|
2
2
|
import { ZrxSwapperDeps } from '../ZrxSwapper';
|
|
3
|
-
export declare function ZrxApproveInfinite({ adapterManager, web3 }: ZrxSwapperDeps, { quote, wallet }: ApproveInfiniteInput<ChainTypes
|
|
3
|
+
export declare function ZrxApproveInfinite({ adapterManager, web3 }: ZrxSwapperDeps, { quote, wallet }: ApproveInfiniteInput<ChainTypes>): Promise<string>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { BuildQuoteTxInput, ChainTypes, Quote
|
|
1
|
+
import { BuildQuoteTxInput, ChainTypes, Quote } from '@shapeshiftoss/types';
|
|
2
2
|
import { ZrxSwapperDeps } from '../ZrxSwapper';
|
|
3
|
-
export declare function ZrxBuildQuoteTx({ adapterManager, web3 }: ZrxSwapperDeps, { input, wallet }: BuildQuoteTxInput): Promise<Quote<ChainTypes
|
|
3
|
+
export declare function ZrxBuildQuoteTx({ adapterManager, web3 }: ZrxSwapperDeps, { input, wallet }: BuildQuoteTxInput): Promise<Quote<ChainTypes>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ChainTypes, ExecQuoteInput, ExecQuoteOutput
|
|
1
|
+
import { ChainTypes, ExecQuoteInput, ExecQuoteOutput } from '@shapeshiftoss/types';
|
|
2
2
|
import { ZrxSwapperDeps } from '../ZrxSwapper';
|
|
3
|
-
export declare function ZrxExecuteQuote({ adapterManager }: ZrxSwapperDeps, { quote, wallet }: ExecQuoteInput<ChainTypes.Ethereum
|
|
3
|
+
export declare function ZrxExecuteQuote({ adapterManager }: ZrxSwapperDeps, { quote, wallet }: ExecQuoteInput<ChainTypes.Ethereum>): Promise<ExecQuoteOutput>;
|
|
@@ -15,14 +15,14 @@ export declare class ZrxSwapper implements Swapper {
|
|
|
15
15
|
deps: ZrxSwapperDeps;
|
|
16
16
|
constructor(deps: ZrxSwapperDeps);
|
|
17
17
|
getType(): SwapperType;
|
|
18
|
-
buildQuoteTx(args: BuildQuoteTxInput): Promise<Quote<ChainTypes
|
|
19
|
-
getQuote(input: GetQuoteInput): Promise<Quote<ChainTypes
|
|
18
|
+
buildQuoteTx(args: BuildQuoteTxInput): Promise<Quote<ChainTypes>>;
|
|
19
|
+
getQuote(input: GetQuoteInput): Promise<Quote<ChainTypes>>;
|
|
20
20
|
getUsdRate(input: Pick<Asset, 'symbol' | 'tokenId'>): Promise<string>;
|
|
21
21
|
getMinMax(input: GetQuoteInput): Promise<MinMaxOutput>;
|
|
22
22
|
getDefaultPair(): [CAIP19, CAIP19];
|
|
23
|
-
executeQuote(args: ExecQuoteInput<ChainTypes
|
|
24
|
-
approvalNeeded(args: ApprovalNeededInput<ChainTypes
|
|
25
|
-
approveInfinite(args: ApproveInfiniteInput<ChainTypes
|
|
23
|
+
executeQuote(args: ExecQuoteInput<ChainTypes>): Promise<ExecQuoteOutput>;
|
|
24
|
+
approvalNeeded(args: ApprovalNeededInput<ChainTypes>): Promise<ApprovalNeededOutput>;
|
|
25
|
+
approveInfinite(args: ApproveInfiniteInput<ChainTypes>): Promise<string>;
|
|
26
26
|
filterBuyAssetsBySellAssetId(args: BuyAssetBySellIdInput): CAIP19[];
|
|
27
27
|
filterAssetIdsBySellable(assetIds: CAIP19[]): CAIP19[];
|
|
28
28
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ChainTypes, GetQuoteInput, Quote
|
|
2
|
-
export declare function getZrxQuote(input: GetQuoteInput): Promise<Quote<ChainTypes.Ethereum
|
|
1
|
+
import { ChainTypes, GetQuoteInput, Quote } from '@shapeshiftoss/types';
|
|
2
|
+
export declare function getZrxQuote(input: GetQuoteInput): Promise<Quote<ChainTypes.Ethereum>>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ChainAdapter } from '@shapeshiftoss/chain-adapters';
|
|
2
2
|
import { HDWallet } from '@shapeshiftoss/hdwallet-core';
|
|
3
|
-
import { Asset, ChainTypes, Quote
|
|
3
|
+
import { Asset, ChainTypes, Quote } from '@shapeshiftoss/types';
|
|
4
4
|
import BigNumber from 'bignumber.js';
|
|
5
5
|
import Web3 from 'web3';
|
|
6
6
|
import { AbiItem } from 'web3-utils';
|
|
7
7
|
export declare type GetAllowanceRequiredArgs = {
|
|
8
|
-
quote: Quote<ChainTypes
|
|
8
|
+
quote: Quote<ChainTypes>;
|
|
9
9
|
web3: Web3;
|
|
10
10
|
erc20AllowanceAbi: AbiItem[];
|
|
11
11
|
};
|
|
@@ -17,7 +17,7 @@ export declare type GetERC20AllowanceArgs = {
|
|
|
17
17
|
spenderAddress: string;
|
|
18
18
|
};
|
|
19
19
|
declare type GrantAllowanceArgs = {
|
|
20
|
-
quote: Quote<ChainTypes
|
|
20
|
+
quote: Quote<ChainTypes>;
|
|
21
21
|
wallet: HDWallet;
|
|
22
22
|
adapter: ChainAdapter<ChainTypes.Ethereum>;
|
|
23
23
|
erc20Abi: AbiItem[];
|