Skip to content

Commit

Permalink
chore: enable cf dca support (#1172)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
towanTG and github-actions[bot] authored Jan 28, 2025
1 parent 67ad605 commit 87419ab
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .changeset/rich-windows-matter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@swapkit/plugin-chainflip": patch
"@swapkit/core": patch
"@swapkit/api": patch
---

Adds support for Chainflip DCA
2 changes: 1 addition & 1 deletion packages/plugins/chainflip/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function plugin({

return {
swap,
supportedSwapkitProviders: [ProviderName.CHAINFLIP],
supportedSwapkitProviders: [ProviderName.CHAINFLIP, ProviderName.CHAINFLIP_STREAMING],
};
}

Expand Down
1 change: 1 addition & 0 deletions packages/swapkit/api/src/swapkitApi/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ export async function getTokenTradingPairs(
const UNCHAINABLE_PROVIDERS = [
ProviderName.CAVIAR_V1,
ProviderName.CHAINFLIP,
ProviderName.CHAINFLIP_STREAMING,
ProviderName.MAYACHAIN,
ProviderName.MAYACHAIN_STREAMING,
];
Expand Down
2 changes: 1 addition & 1 deletion packages/swapkit/core/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ export function SwapKit<Plugins extends PluginsType, Wallets extends WalletsType

if (type === "swap") {
const plugin = params.route.providers[0] as PluginNameEnum;
if (plugin === PluginNameEnum.CHAINFLIP) {
if ([PluginNameEnum.CHAINFLIP, PluginNameEnum.CHAINFLIP_STREAMING].includes(plugin)) {
const txObject = await wallet.createTransferTx({
from: wallet.address,
recipient: wallet.address,
Expand Down
4 changes: 3 additions & 1 deletion playgrounds/vite/src/Swap/SwapInputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ export const SwapInputs = ({ skClient, inputAsset, outputAsset, handleSwap }: Pr

const swap = async (route: QuoteResponseRoute, inputAssetValue?: AssetValue) => {
if (!(inputAsset && outputAsset && inputAssetValue && skClient)) return;
const isChainFlip = route?.providers?.includes(ProviderName.CHAINFLIP);
const isChainFlip =
route?.providers?.includes(ProviderName.CHAINFLIP) ||
route?.providers?.includes(ProviderName.CHAINFLIP_STREAMING);
if (isChainFlip) {
await handleSwap(route, useChainflipBoost);
return;
Expand Down

0 comments on commit 87419ab

Please sign in to comment.