Skip to main content

Class: BungeeBridgeProvider

Implements

Constructors

constructor

new BungeeBridgeProvider(options): BungeeBridgeProvider

Parameters

NameType
optionsBungeeBridgeProviderOptions

Returns

BungeeBridgeProvider

Defined in

external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:62

Properties

api

Protected api: BungeeApi

Defined in

external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:58


cowShedSdk

Protected cowShedSdk: CowShedSdk

Defined in

external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:59


getRpcProvider

getRpcProvider: (chainId: SupportedChainId) => JsonRpcProvider

Type declaration

▸ (chainId): JsonRpcProvider

Parameters
NameType
chainIdSupportedChainId
Returns

JsonRpcProvider

Implementation of

BridgeProvider.getRpcProvider

Defined in

external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:60


info

info: BridgeProviderInfo

Implementation of

BridgeProvider.info

Defined in

external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:68


options

Private options: BungeeBridgeProviderOptions

Defined in

external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:62

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
_hookCoWHookThe bridge hook

Returns

Promise<BridgeDeposit>

Implementation of

BridgeProvider.decodeBridgeHook

Defined in

external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:208


getBridgingId

getBridgingId(_orderUid, _settlementTx, _logIndex): Promise<string>

Parameters

NameType
_orderUidstring
_settlementTxstring
_logIndexnumber

Returns

Promise<string>

Defined in

external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:215


getBridgingParams

getBridgingParams(_chainId, orderId, _txHash): Promise<null | BridgingDepositParams>

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

Parameters

NameTypeDescription
_chainIdnumber
orderIdstringThe unique identifier of the order
_txHashstringThe hash of the settlement transaction in which the bridging post-hook was executed

Returns

Promise<null | BridgingDepositParams>

Implementation of

BridgeProvider.getBridgingParams

Defined in

external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:187


getBuyTokens

getBuyTokens(params): Promise<TokenInfo[]>

Get supported tokens for a chain

Parameters

NameType
paramsBuyTokensParams

Returns

Promise<TokenInfo[]>

Implementation of

BridgeProvider.getBuyTokens

Defined in

external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:79


getCancelBridgingTx

getCancelBridgingTx(_bridgingId): Promise<EvmCall>

Parameters

NameType
_bridgingIdstring

Returns

Promise<EvmCall>

Implementation of

BridgeProvider.getCancelBridgingTx

Defined in

external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:277


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/bungee/BungeeBridgeProvider.ts:220


getGasLimitEstimationForHook

getGasLimitEstimationForHook(request): Promise<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

Promise<number>

Implementation of

BridgeProvider.getGasLimitEstimationForHook

Defined in

external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:145


getIntermediateTokens

getIntermediateTokens(request): Promise<TokenInfo[]>

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<TokenInfo[]>

Implementation of

BridgeProvider.getIntermediateTokens

Defined in

external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:83


getNetworks

getNetworks(): Promise<ChainInfo[]>

Get basic supported chains

Returns

Promise<ChainInfo[]>

Implementation of

BridgeProvider.getNetworks

Defined in

external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:75


getQuote

getQuote(request): Promise<BungeeQuoteResult>

Get a quote for a bridge request.

Parameters

NameTypeDescription
requestQuoteBridgeRequestThe quote request

Returns

Promise<BungeeQuoteResult>

Implementation of

BridgeProvider.getQuote

Defined in

external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:95


getRefundBridgingTx

getRefundBridgingTx(_bridgingId): Promise<EvmCall>

Parameters

NameType
_bridgingIdstring

Returns

Promise<EvmCall>

Implementation of

BridgeProvider.getRefundBridgingTx

Defined in

external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:284


getSignedHook

getSignedHook(chainId, unsignedCall, signer, bridgeHookNonce, deadline, hookGasLimit): 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
bridgeHookNoncestring
deadlinebigint
hookGasLimitnumber

Returns

Promise<BridgeHook>

Implementation of

BridgeProvider.getSignedHook

Defined in

external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:149


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/bungee/BungeeBridgeProvider.ts:224


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
quoteBungeeQuoteResultThe 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/bungee/BungeeBridgeProvider.ts:137