Skip to main content

Class: AcrossBridgeProvider

Implements

Constructors

constructor

new AcrossBridgeProvider(options?): AcrossBridgeProvider

Parameters

NameType
optionsAcrossBridgeProviderOptions

Returns

AcrossBridgeProvider

Defined in

external/cow-sdk/src/bridging/providers/across/AcrossBridgeProvider.ts:61

Properties

api

Protected api: AcrossApi

Defined in

external/cow-sdk/src/bridging/providers/across/AcrossBridgeProvider.ts:58


cowShedSdk

Protected cowShedSdk: CowShedSdk

Defined in

external/cow-sdk/src/bridging/providers/across/AcrossBridgeProvider.ts:59


info

info: BridgeProviderInfo

Implementation of

BridgeProvider.info

Defined in

external/cow-sdk/src/bridging/providers/across/AcrossBridgeProvider.ts:66


options

Private options: AcrossBridgeProviderOptions = {}

Defined in

external/cow-sdk/src/bridging/providers/across/AcrossBridgeProvider.ts:61

Methods

decodeBridgeHook

decodeBridgeHook(_hook): Promise<BridgeDeposit>

Decode a bridge hook into a bridge deposit information.

This method is used to recover the information about the limit order placed into the bridge locking contract. This allows to load an order from the orderbook and decode the bridging hook and understand what was the minimum buy amount the user signed to receive in the destination chain.

Parameters

NameTypeDescription
_hookBridgeHookThe bridge hook

Returns

Promise<BridgeDeposit>

Implementation of

BridgeProvider.decodeBridgeHook

Defined in

external/cow-sdk/src/bridging/providers/across/AcrossBridgeProvider.ts:172


getBridgingId

getBridgingId(_orderUid, _settlementTx): Promise<string>

Get the identifier of the bridging transaction from the settlement transaction.

Parameters

NameTypeDescription
_orderUidstringThe unique identifier of the order
_settlementTxstringThe settlement transaction in which the bridging post-hook was executed

Returns

Promise<string>

Implementation of

BridgeProvider.getBridgingId

Defined in

external/cow-sdk/src/bridging/providers/across/AcrossBridgeProvider.ts:176


getBuyTokens

getBuyTokens(targetChainId): Promise<TokenInfo[]>

Get supported tokens for a chain

Parameters

NameType
targetChainIdTargetChainId

Returns

Promise<TokenInfo[]>

Implementation of

BridgeProvider.getBuyTokens

Defined in

external/cow-sdk/src/bridging/providers/across/AcrossBridgeProvider.ts:75


getCancelBridgingTx

getCancelBridgingTx(_bridgingId): Promise<EvmCall>

Parameters

NameType
_bridgingIdstring

Returns

Promise<EvmCall>

Implementation of

BridgeProvider.getCancelBridgingTx

Defined in

external/cow-sdk/src/bridging/providers/across/AcrossBridgeProvider.ts:190


getExplorerUrl

getExplorerUrl(bridgingId): string

Get the explorer url for a bridging id.

Parameters

NameTypeDescription
bridgingIdstringThe bridging id

Returns

string

Implementation of

BridgeProvider.getExplorerUrl

Defined in

external/cow-sdk/src/bridging/providers/across/AcrossBridgeProvider.ts:181


getGasLimitEstimationForHook

getGasLimitEstimationForHook(_request): number

Returns the estimated gas cost for executing the bridge hook.

This method helps calculate the final amount of tokens the user will receive more accurately. The estimation is done without the amount parameter to break a circular dependency:

  1. Hook gas costs affect the final amount
  2. The final amount could affect hook gas costs

By estimating gas costs independently, we can resolve this dependency cycle.

Parameters

NameType
_requestQuoteBridgeRequest

Returns

number

Implementation of

BridgeProvider.getGasLimitEstimationForHook

Defined in

external/cow-sdk/src/bridging/providers/across/AcrossBridgeProvider.ts:140


getIntermediateTokens

getIntermediateTokens(request): Promise<string[]>

Get intermediate tokens given a quote request.

An intermediate token, is a token in the source chain, that could be used to bridge the tokens to the destination chain. This method returns a sorted list of tokens, they are sorted by priority, so first tokens are more likely to be more liquid.

Parameters

NameTypeDescription
requestQuoteBridgeRequestThe quote request

Returns

Promise<string[]>

Implementation of

BridgeProvider.getIntermediateTokens

Defined in

external/cow-sdk/src/bridging/providers/across/AcrossBridgeProvider.ts:89


getNetworks

getNetworks(): Promise<ChainInfo[]>

Get basic supported chains

Returns

Promise<ChainInfo[]>

Implementation of

BridgeProvider.getNetworks

Defined in

external/cow-sdk/src/bridging/providers/across/AcrossBridgeProvider.ts:71


getQuote

getQuote(request): Promise<AcrossQuoteResult>

Get a quote for a bridge request.

Parameters

NameTypeDescription
requestQuoteBridgeRequestThe quote request

Returns

Promise<AcrossQuoteResult>

Implementation of

BridgeProvider.getQuote

Defined in

external/cow-sdk/src/bridging/providers/across/AcrossBridgeProvider.ts:109


getRefundBridgingTx

getRefundBridgingTx(_bridgingId): Promise<EvmCall>

Parameters

NameType
_bridgingIdstring

Returns

Promise<EvmCall>

Implementation of

BridgeProvider.getRefundBridgingTx

Defined in

external/cow-sdk/src/bridging/providers/across/AcrossBridgeProvider.ts:193


getSignedHook

getSignedHook(chainId, unsignedCall, signer): Promise<BridgeHook>

Get a pre-authorized hook for initiating a bridge.

The hook contains the ethereum call that the trampoline contract will need to execute during the settlement to initate the bridge.

Typically, this hook will:

  • Get the balance of cow-shed account
  • Ensure the approval for the bridge lock contract is set
  • Deposit into the bridge contract

This hook will include the pre-authorization (signature) of the owner of the cow-shed account (the trader).

Parameters

NameType
chainIdSupportedChainId
unsignedCallEvmCall
signerSigner

Returns

Promise<BridgeHook>

Implementation of

BridgeProvider.getSignedHook

Defined in

external/cow-sdk/src/bridging/providers/across/AcrossBridgeProvider.ts:144


getStatus

getStatus(_bridgingId): Promise<BridgeStatusResult>

Get the status of a bridging transaction.

Parameters

NameTypeDescription
_bridgingIdstringThe bridging id

Returns

Promise<BridgeStatusResult>

Implementation of

BridgeProvider.getStatus

Defined in

external/cow-sdk/src/bridging/providers/across/AcrossBridgeProvider.ts:186


getUnsignedBridgeCall

getUnsignedBridgeCall(request, quote): Promise<EvmCall>

Get an unsigned bridge call for a quote.

The transaction details should be executed in the context of cow-shed account.

Parameters

NameTypeDescription
requestQuoteBridgeRequestThe quote request
quoteAcrossQuoteResultThe quote

Returns

Promise<EvmCall>

The unsigned transaction details that cow-shed needs to sign

Implementation of

BridgeProvider.getUnsignedBridgeCall

Defined in

external/cow-sdk/src/bridging/providers/across/AcrossBridgeProvider.ts:132