Class: BungeeBridgeProvider
Implementsโ
Constructorsโ
constructorโ
โข new BungeeBridgeProvider(options
): BungeeBridgeProvider
Parametersโ
Name | Type |
---|---|
options | BungeeBridgeProviderOptions |
Returnsโ
Defined inโ
external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:64
Propertiesโ
apiโ
โข Protected
api: BungeeApi
Defined inโ
external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:60
cowShedSdkโ
โข Protected
cowShedSdk: CowShedSdk
Defined inโ
external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:61
getRpcProviderโ
โข getRpcProvider: (chainId
: SupportedChainId
) => JsonRpcProvider
Type declarationโ
โธ (chainId
): JsonRpcProvider
Parametersโ
Name | Type |
---|---|
chainId | SupportedChainId |
Returnsโ
JsonRpcProvider
Implementation ofโ
Defined inโ
external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:62
infoโ
โข info: BridgeProviderInfo
Implementation ofโ
Defined inโ
external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:70
optionsโ
โข Private
options: BungeeBridgeProviderOptions
Defined inโ
external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:64
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 | CoWHook | The bridge hook |
Returnsโ
Promise
<BridgeDeposit
>
Implementation ofโ
BridgeProvider.decodeBridgeHook
Defined inโ
external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:230
getBridgingParamsโ
โธ getBridgingParams(_chainId
, orderId
, _txHash
): Promise
<null
| { params
: BridgingDepositParams
; status
: BridgeStatusResult
}>
Get the identifier of the bridging transaction from the settlement transaction.
Parametersโ
Name | Type | Description |
---|---|---|
_chainId | number | |
orderId | string | The unique identifier of the order |
_txHash | string | The hash of the settlement transaction in which the bridging post-hook was executed |
Returnsโ
Promise
<null
| { params
: BridgingDepositParams
; status
: BridgeStatusResult
}>
Implementation ofโ
BridgeProvider.getBridgingParams
Defined inโ
external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:201
getBuyTokensโ
โธ getBuyTokens(params
): Promise
<GetProviderBuyTokens
>
Get supported tokens for a chain
Parametersโ
Name | Type |
---|---|
params | BuyTokensParams |
Returnsโ
Promise
<GetProviderBuyTokens
>
Implementation ofโ
Defined inโ
external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:81
getCancelBridgingTxโ
โธ getCancelBridgingTx(_bridgingId
): Promise
<EvmCall
>
Parametersโ
Name | Type |
---|---|
_bridgingId | string |
Returnsโ
Promise
<EvmCall
>
Implementation ofโ
BridgeProvider.getCancelBridgingTx
Defined inโ
external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:248
getExplorerUrlโ
โธ getExplorerUrl(bridgingId
): string
Get the explorer url for a bridging id.
Parametersโ
Name | Type | Description |
---|---|---|
bridgingId | string | The bridging id |
Returnsโ
string
Implementation ofโ
Defined inโ
external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:237
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:
- 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.
For some providers, the extraGas
flag adds a 100,000 gasโunit buffer to the hook
(see DEFAULT_EXTRA_GAS_FOR_HOOK_ESTIMATION).
Parametersโ
Name | Type |
---|---|
request | QuoteBridgeRequest |
Returnsโ
Promise
<number
>
Implementation ofโ
BridgeProvider.getGasLimitEstimationForHook
Defined inโ
external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:152
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โ
Name | Type | Description |
---|---|---|
request | QuoteBridgeRequest | The quote request |
Returnsโ
Promise
<TokenInfo
[]>
Implementation ofโ
BridgeProvider.getIntermediateTokens
Defined inโ
external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:91
getNetworksโ
โธ getNetworks(): Promise
<ChainInfo
[]>
Get basic supported chains
Returnsโ
Promise
<ChainInfo
[]>
Implementation ofโ
Defined inโ
external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:77
getQuoteโ
โธ getQuote(request
): Promise
<BungeeQuoteResult
>
Get a quote for a bridge request.
Parametersโ
Name | Type | Description |
---|---|---|
request | QuoteBridgeRequest | The quote request |
Returnsโ
Promise
<BungeeQuoteResult
>
Implementation ofโ
Defined inโ
external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:103
getRefundBridgingTxโ
โธ getRefundBridgingTx(_bridgingId
): Promise
<EvmCall
>
Parametersโ
Name | Type |
---|---|
_bridgingId | string |
Returnsโ
Promise
<EvmCall
>
Implementation ofโ
BridgeProvider.getRefundBridgingTx
Defined inโ
external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:255
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โ
Name | Type |
---|---|
chainId | SupportedChainId |
unsignedCall | EvmCall |
signer | Signer |
bridgeHookNonce | string |
deadline | bigint |
hookGasLimit | number |
Returnsโ
Promise
<BridgeHook
>
Implementation ofโ
Defined inโ
external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:163
getStatusโ
โธ getStatus(_bridgingId
): Promise
<BridgeStatusResult
>
Get the status of a bridging transaction.
Parametersโ
Name | Type | Description |
---|---|---|
_bridgingId | string | The bridging id |
Returnsโ
Promise
<BridgeStatusResult
>
Implementation ofโ
Defined inโ
external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:241
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 | BungeeQuoteResult | The 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:145
isExtraGasRequiredโ
โธ isExtraGasRequired(request
): boolean
Parametersโ
Name | Type |
---|---|
request | QuoteBridgeRequest |
Returnsโ
boolean
Defined inโ
external/cow-sdk/src/bridging/providers/bungee/BungeeBridgeProvider.ts:263