Skip to content

Commit

Permalink
fix: chainflip broker base url usage (#1169)
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 23, 2025
1 parent 8025ba9 commit c200679
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changeset/polite-chairs-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@swapkit/plugin-chainflip": patch
"@swapkit/api": patch
---

Fixes usage of broker url for openening deposit channels
1 change: 1 addition & 0 deletions packages/plugins/chainflip/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ function plugin({
}

const { depositAddress } = await swapkitApiEndpoints.getChainflipDepositChannel({
baseUrl: brokerUrl,
body: {
...chainflip,
destinationAddress: recipient || chainflip.destinationAddress,
Expand Down
4 changes: 3 additions & 1 deletion packages/swapkit/api/src/swapkitApi/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,17 +348,19 @@ export async function getTokenTradingPairs(

export async function getChainflipDepositChannel({
isDev = false,
baseUrl,
body,
}: {
isDev?: boolean;
baseUrl?: string;
body: BrokerDepositChannelParams;
}) {
const { destinationAddress } = body;

if (!destinationAddress) {
throw new SwapKitError("chainflip_broker_invalid_params");
}
const url = `${getBaseUrl(isDev)}/channel`;
const url = `${baseUrl || getBaseUrl(isDev)}/channel`;

const response = await RequestClient.post<DepositChannelResponse>(url, {
json: body,
Expand Down

0 comments on commit c200679

Please sign in to comment.