UNPKG

@f5i23q999d/cow-sdk

Version:

<p align="center"> <img width="400" src="https://github.com/cowprotocol/cow-sdk/raw/main/docs/images/CoW.png" /> </p>

42 lines (41 loc) 2.26 kB
import { Signer } from 'ethers'; import { BridgeDeposit, BridgeHook, BridgeProvider, BridgeProviderInfo, BridgeQuoteResult, BridgeStatusResult, QuoteBridgeRequest } from '../../types.js'; import { ChainId, ChainInfo, SupportedChainId, TargetChainId } from '../../../chains/index.js'; import { EvmCall, TokenInfo } from '../../../common/index.js'; import { AcrossApi, AcrossApiOptions, SuggestedFeesResponse } from './AcrossApi.js'; import { CowShedSdk, CowShedSdkOptions } from '../../../cow-shed/index.js'; export declare const ACROSS_SUPPORTED_NETWORKS: ChainInfo[]; export interface AcrossBridgeProviderOptions { /** * Token info provider * @param chainId - The chain ID * @param addresses - The addresses of the tokens to get the info for * @returns The token infos */ getTokenInfos?: (chainId: ChainId, addresses: string[]) => Promise<TokenInfo[]>; apiOptions?: AcrossApiOptions; cowShedOptions?: CowShedSdkOptions; } export interface AcrossQuoteResult extends BridgeQuoteResult { suggestedFees: SuggestedFeesResponse; } export declare class AcrossBridgeProvider implements BridgeProvider<AcrossQuoteResult> { private options; protected api: AcrossApi; protected cowShedSdk: CowShedSdk; constructor(options?: AcrossBridgeProviderOptions); info: BridgeProviderInfo; getNetworks(): Promise<ChainInfo[]>; getBuyTokens(targetChainId: TargetChainId): Promise<TokenInfo[]>; getIntermediateTokens(request: QuoteBridgeRequest): Promise<string[]>; getQuote(request: QuoteBridgeRequest): Promise<AcrossQuoteResult>; getUnsignedBridgeCall(request: QuoteBridgeRequest, quote: AcrossQuoteResult): Promise<EvmCall>; getGasLimitEstimationForHook(_request: QuoteBridgeRequest): number; getSignedHook(chainId: SupportedChainId, unsignedCall: EvmCall, signer: Signer): Promise<BridgeHook>; decodeBridgeHook(_hook: BridgeHook): Promise<BridgeDeposit>; getBridgingId(_orderUid: string, _settlementTx: string): Promise<string>; getExplorerUrl(bridgingId: string): string; getStatus(_bridgingId: string): Promise<BridgeStatusResult>; getCancelBridgingTx(_bridgingId: string): Promise<EvmCall>; getRefundBridgingTx(_bridgingId: string): Promise<EvmCall>; }