Interface: BridgeProvider<Q>
Type parameters
| Name | Type | 
|---|---|
Q | extends BridgeQuoteResult | 
Implemented by
Properties
info
• info: BridgeProviderInfo
Defined in
external/cow-sdk/src/bridging/types.ts:104
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
| Name | Type | Description | 
|---|---|---|
hook | BridgeHook | The bridge hook | 
Returns
Promise<BridgeDeposit>
Defined in
external/cow-sdk/src/bridging/types.ts:181
getBridgingId
▸ getBridgingId(orderUid, settlementTx): Promise<string>
Get the identifier of the bridging transaction from the settlement transaction.
Parameters
| Name | Type | Description | 
|---|---|---|
orderUid | string | The unique identifier of the order | 
settlementTx | string | The settlement transaction in which the bridging post-hook was executed | 
Returns
Promise<string>
Defined in
external/cow-sdk/src/bridging/types.ts:188
getBuyTokens
▸ getBuyTokens(targetChainId): Promise<TokenInfo[]>
Get supported tokens for a chain
Parameters
| Name | Type | 
|---|---|
targetChainId | TargetChainId | 
Returns
Promise<TokenInfo[]>
Defined in
external/cow-sdk/src/bridging/types.ts:114
getCancelBridgingTx
▸ getCancelBridgingTx(bridgingId): Promise<EvmCall>
Parameters
| Name | Type | 
|---|---|
bridgingId | string | 
Returns
Promise<EvmCall>
Defined in
external/cow-sdk/src/bridging/types.ts:206
getExplorerUrl
▸ getExplorerUrl(bridgingId): string
Get the explorer url for a bridging id.
Parameters
| Name | Type | Description | 
|---|---|---|
bridgingId | string | The bridging id | 
Returns
string
Defined in
external/cow-sdk/src/bridging/types.ts:195
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:
- Hook gas costs affect the final amount
 - The final amount could affect hook gas costs
 
By estimating gas costs independently, we can resolve this dependency cycle.
Parameters
| Name | Type | 
|---|---|
request | Omit<QuoteBridgeRequest, "amount"> | 
Returns
number
Defined in
external/cow-sdk/src/bridging/types.ts:154
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
| Name | Type | Description | 
|---|---|---|
request | QuoteBridgeRequest | The quote request | 
Returns
Promise<string[]>
Defined in
external/cow-sdk/src/bridging/types.ts:124
getNetworks
▸ getNetworks(): Promise<ChainInfo[]>
Get basic supported chains
Returns
Promise<ChainInfo[]>
Defined in
external/cow-sdk/src/bridging/types.ts:109
getQuote
▸ getQuote(request): Promise<Q>
Get a quote for a bridge request.
Parameters
| Name | Type | Description | 
|---|---|---|
request | QuoteBridgeRequest | The quote request | 
Returns
Promise<Q>
Defined in
external/cow-sdk/src/bridging/types.ts:131
getRefundBridgingTx
▸ getRefundBridgingTx(bridgingId): Promise<EvmCall>
Parameters
| Name | Type | 
|---|---|
bridgingId | string | 
Returns
Promise<EvmCall>
Defined in
external/cow-sdk/src/bridging/types.ts:210
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
| Name | Type | 
|---|---|
chainId | SupportedChainId | 
unsignedCall | EvmCall | 
signer | Signer | 
Returns
Promise<BridgeHook>
Defined in
external/cow-sdk/src/bridging/types.ts:171
getStatus
▸ getStatus(bridgingId): Promise<BridgeStatusResult>
Get the status of a bridging transaction.
Parameters
| Name | Type | Description | 
|---|---|---|
bridgingId | string | The bridging id | 
Returns
Promise<BridgeStatusResult>
Defined in
external/cow-sdk/src/bridging/types.ts:202
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
| Name | Type | Description | 
|---|---|---|
request | QuoteBridgeRequest | The quote request | 
quote | Q | The quote | 
Returns
Promise<EvmCall>
The unsigned transaction details that cow-shed needs to sign
Defined in
external/cow-sdk/src/bridging/types.ts:142