@cowprotocol/cow-sdk 6.0.0-RC.2 → 6.0.0-RC.6

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.
@@ -1,16 +1,22 @@
1
1
  import { SwapAdvancedSettings, TradingSdk } from '../../trading';
2
- import { BridgeProvider, BridgeQuoteResult, CrossChainQuoteAndPost, GetBuyTokensParams, QuoteBridgeRequest } from '../types';
2
+ import { BridgeProvider, BridgeQuoteResult, CrossChainQuoteAndPost, GetBuyTokensParams, GetErc20Decimals, QuoteBridgeRequest } from '../types';
3
3
  import { TokenInfo } from '../../common';
4
- import { ChainInfo, TargetChainId } from '../../chains';
4
+ import { ChainInfo } from '../../chains';
5
5
  export interface BridgingSdkOptions {
6
- getErc20Decimals(chainId: TargetChainId, tokenAddress: string): Promise<number>;
7
- tradingSdk?: TradingSdk;
8
6
  /**
9
7
  * Providers for the bridging.
10
8
  */
11
9
  providers: BridgeProvider<BridgeQuoteResult>[];
10
+ /**
11
+ * Function to get the decimals of the ERC20 tokens
12
+ */
13
+ getErc20Decimals?: GetErc20Decimals;
14
+ /**
15
+ * Trading SDK.
16
+ */
17
+ tradingSdk?: TradingSdk;
12
18
  }
13
- export type BridgingSdkConfig = Required<BridgingSdkOptions>;
19
+ export type BridgingSdkConfig = Required<Omit<BridgingSdkOptions, 'getErc20Decimals'>> & Pick<BridgingSdkOptions, 'getErc20Decimals'>;
14
20
  /**
15
21
  * SDK for bridging for swapping tokens between different chains.
16
22
  */
@@ -0,0 +1,4 @@
1
+ import { Provider } from '@ethersproject/providers';
2
+ import { Signer } from '@ethersproject/abstract-signer';
3
+ import { GetErc20Decimals } from '../types';
4
+ export declare function factoryGetErc20Decimals(provider: Signer | Provider): GetErc20Decimals;