Skip to content

Commit

Permalink
fixup!
Browse files Browse the repository at this point in the history
  • Loading branch information
dni committed Aug 5, 2024
1 parent 3b71e78 commit d2e13d1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/status/InvoicePending.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const InvoicePending = () => {
<div>
<p>{t("invoice_pending")}</p>
<LoadingSpinner />
<Show when={swapStatusTransaction() !== null}>
<Show when={swapStatusTransaction()}>
<BlockExplorer
asset={swap().assetSend}
txId={swapStatusTransaction().id}
Expand Down
2 changes: 1 addition & 1 deletion src/status/TransactionConfirmed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ const TransactionConfirmed = () => {
<h2>{t("tx_confirmed")}</h2>
<p>{t("tx_ready_to_claim")}</p>
<LoadingSpinner />
<Show when={swapStatusTransaction() !== null}>
<Show when={swapStatusTransaction()}>
<BlockExplorer
asset={swap().assetSend}
txId={swapStatusTransaction().id}
Expand Down
2 changes: 1 addition & 1 deletion src/status/TransactionMempool.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const TransactionMempool = () => {
<h2>{t("tx_in_mempool")}</h2>
<p>{t("tx_in_mempool_subline")}</p>
<LoadingSpinner />
<Show when={swapStatusTransaction() !== null}>
<Show when={swapStatusTransaction()}>
<BlockExplorer
asset={swap().assetSend}
txId={swapStatusTransaction().id}
Expand Down
34 changes: 18 additions & 16 deletions src/utils/boltzClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,6 @@ type ChainSwapCreatedResponse = {
lockupDetails: ChainSwapDetails;
};

export type LockupTransaction = {
id: string;
hex: string;
timeoutBlockHeight: number;
timeoutEta?: number;
};

type ChainSwapTransaction = {
transaction: {
id: string;
Expand Down Expand Up @@ -369,6 +362,13 @@ export const broadcastTransaction = (asset: string, txHex: string) =>
hex: txHex,
});

export type LockupTransaction = {
id: string;
hex: string;
timeoutBlockHeight: number;
timeoutEta?: number;
};

export const getLockupTransaction = async (
asset: string,
id: string,
Expand Down Expand Up @@ -404,16 +404,18 @@ export const getReverseTransaction = (asset: string, id: string) =>
timeoutBlockHeight: number;
}>(`/v2/swap/reverse/${id}/transaction`, asset);

export type SwapStatus = {
status: string;
failureReason?: string;
zeroConfRejected?: boolean;
transaction?: {
id: string;
hex: string;
};
};

export const getSwapStatus = (asset: string, id: string) =>
fetcher<{
status: string;
failureReason?: string;
zeroConfRejected?: boolean;
transaction?: {
id: string;
hex: string;
};
}>(`/v2/swap/${id}`, asset);
fetcher<SwapStatus>(`/v2/swap/${id}`, asset);

export const getChainSwapClaimDetails = (asset: string, id: string) =>
fetcher<{
Expand Down

0 comments on commit d2e13d1

Please sign in to comment.