Class: BridgingSdk
SDK for bridging for swapping tokens between different chains.
Constructors
constructor
• new BridgingSdk(options
): BridgingSdk
Parameters
Name | Type |
---|---|
options | BridgingSdkOptions |
Returns
Defined in
external/cow-sdk/src/bridging/BridgingSdk/BridgingSdk.ts:47
Properties
config
• Protected
config: BridgingSdkConfig
Defined in
external/cow-sdk/src/bridging/BridgingSdk/BridgingSdk.ts:46
options
• Readonly
options: BridgingSdkOptions
Defined in
external/cow-sdk/src/bridging/BridgingSdk/BridgingSdk.ts:47
Accessors
provider
• get
provider(): BridgeProvider
<BridgeQuoteResult
>
Returns
BridgeProvider
<BridgeQuoteResult
>
Defined in
external/cow-sdk/src/bridging/BridgingSdk/BridgingSdk.ts:66
Methods
getBuyTokens
▸ getBuyTokens(targetChainId
): Promise
<TokenInfo
[]>
Get the available buy tokens for buying in a specific target chain
Parameters
Name | Type |
---|---|
targetChainId | TargetChainId |
Returns
Promise
<TokenInfo
[]>
Defined in
external/cow-sdk/src/bridging/BridgingSdk/BridgingSdk.ts:99
getProviders
▸ getProviders(): BridgeProvider
<BridgeQuoteResult
>[]
Get the providers for the bridging.
Returns
BridgeProvider
<BridgeQuoteResult
>[]
Defined in
external/cow-sdk/src/bridging/BridgingSdk/BridgingSdk.ts:75
getQuote
▸ getQuote(quoteBridgeRequest
, advancedSettings?
): Promise
<CrossChainQuoteAndPost
>
Get quote details, including a callback function to post the order on-chain.
This method support both, cross-chain swaps and single-chain swap.
The return type will be either QuoteAndPost
or BridgeQuoteAndPost
.
To safely assert the type in Typescript, you can use:
isBridgeQuoteAndPost(result)
utility.isQuoteAndPost(result)
utility.assertIsBridgeQuoteAndPost(result)
assertion.assertIsQuoteAndPost(result)
assertion.
Parameters
Name | Type |
---|---|
quoteBridgeRequest | QuoteBridgeRequest |
advancedSettings? | SwapAdvancedSettings |
Returns
Promise
<CrossChainQuoteAndPost
>
Throws
Error if no path is found
Defined in
external/cow-sdk/src/bridging/BridgingSdk/BridgingSdk.ts:118
getSourceNetworks
▸ getSourceNetworks(): Promise
<ChainInfo
[]>
Get the available sources networks for the bridging.
Returns
Promise
<ChainInfo
[]>
Defined in
external/cow-sdk/src/bridging/BridgingSdk/BridgingSdk.ts:82
getTargetNetworks
▸ getTargetNetworks(): Promise
<ChainInfo
[]>
Get the available target networks for the bridging.
Returns
Promise
<ChainInfo
[]>
Defined in
external/cow-sdk/src/bridging/BridgingSdk/BridgingSdk.ts:89