@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 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, SwapperType>>;
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, SwapperType>>;
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, SwapperType>): Promise<ExecQuoteOutput>;
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, SwapperType>): Promise<ApprovalNeededOutput>;
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, SwapperType>): Promise<string>;
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, SwapperType>>;
13
- buildQuoteTx(): Promise<Quote<ChainTypes, SwapperType>>;
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, SwapperType>>;
7
- buildQuoteTx(): Promise<Quote<ChainTypes, SwapperType>>;
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, SwapperType } from '@shapeshiftoss/types';
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, SwapperType>): Promise<ApprovalNeededOutput>;
3
+ export declare function ZrxApprovalNeeded({ adapterManager, web3 }: ZrxSwapperDeps, { quote, wallet }: ApprovalNeededInput<ChainTypes>): Promise<ApprovalNeededOutput>;
@@ -1,3 +1,3 @@
1
- import { ApproveInfiniteInput, ChainTypes, SwapperType } from '@shapeshiftoss/types';
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, SwapperType>): Promise<string>;
3
+ export declare function ZrxApproveInfinite({ adapterManager, web3 }: ZrxSwapperDeps, { quote, wallet }: ApproveInfiniteInput<ChainTypes>): Promise<string>;
@@ -1,3 +1,3 @@
1
- import { BuildQuoteTxInput, ChainTypes, Quote, SwapperType } from '@shapeshiftoss/types';
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, SwapperType>>;
3
+ export declare function ZrxBuildQuoteTx({ adapterManager, web3 }: ZrxSwapperDeps, { input, wallet }: BuildQuoteTxInput): Promise<Quote<ChainTypes>>;
@@ -1,3 +1,3 @@
1
- import { ChainTypes, ExecQuoteInput, ExecQuoteOutput, SwapperType } from '@shapeshiftoss/types';
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, SwapperType>): Promise<ExecQuoteOutput>;
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, SwapperType>>;
19
- getQuote(input: GetQuoteInput): Promise<Quote<ChainTypes, SwapperType>>;
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, SwapperType>): Promise<ExecQuoteOutput>;
24
- approvalNeeded(args: ApprovalNeededInput<ChainTypes, SwapperType>): Promise<ApprovalNeededOutput>;
25
- approveInfinite(args: ApproveInfiniteInput<ChainTypes, SwapperType>): Promise<string>;
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, SwapperType } from '@shapeshiftoss/types';
2
- export declare function getZrxQuote(input: GetQuoteInput): Promise<Quote<ChainTypes.Ethereum, SwapperType>>;
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, SwapperType } from '@shapeshiftoss/types';
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, SwapperType>;
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, SwapperType>;
20
+ quote: Quote<ChainTypes>;
21
21
  wallet: HDWallet;
22
22
  adapter: ChainAdapter<ChainTypes.Ethereum>;
23
23
  erc20Abi: AbiItem[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/swapper",
3
- "version": "2.3.0",
3
+ "version": "3.0.0",
4
4
  "description": "TODO: description",
5
5
  "repository": "https://github.com/shapeshift/lib",
6
6
  "license": "MIT",