Skip to content

Commit

Permalink
2169, fix bridgers status (#557)
Browse files Browse the repository at this point in the history
  • Loading branch information
PseudoElement authored Feb 6, 2024
2 parents dada718 + fd125d5 commit 9bdcbfe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 16 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rubic-sdk",
"version": "4.54.1",
"version": "4.54.2",
"description": "Simplify dApp creation",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@ import { BridgersCrossChainSupportedBlockchain } from 'src/features/cross-chain/
export async function getBridgersTradeStatus(
srcTxHash: string,
fromBlockchain: BridgersCrossChainSupportedBlockchain,
sourceFlag: 'rubic' | 'rubic_widget',
amountOutMin?: string
sourceFlag: 'rubic' | 'rubic_widget'
): Promise<TxStatusData> {
try {
const updateDataAndStatusRequest: BridgersUpdateDataAndStatusRequest = {
hash: srcTxHash,
fromTokenChain: toBridgersBlockchain[fromBlockchain],
sourceFlag,
amountOutMin
sourceFlag
};
const updateDataAndStatusResponse =
await Injector.httpClient.post<BridgersUpdateDataAndStatusResponse>(
Expand Down Expand Up @@ -66,7 +64,9 @@ export async function getBridgersTradeStatus(
hash: null
};
}
} catch {}
} catch (err) {
console.debug('[ERROR_getBridgersTradeStatus]', err);
}

return {
status: TX_STATUS.PENDING,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,14 +381,10 @@ export class CrossChainStatusManager {
* @returns Cross-chain transaction status.
*/
private getBridgersDstSwapStatus(data: CrossChainTradeData): Promise<TxStatusData> {
if (!data.amountOutMin) {
throw new RubicSdkError('field amountOutMin is not set.');
}
return getBridgersTradeStatus(
data.srcTxHash,
data.fromBlockchain as BridgersCrossChainSupportedBlockchain,
'rubic',
data.amountOutMin
'rubic'
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@ export interface CrossChainTradeData {
*/
rangoRequestId?: string;

/**
* Expected minimum output amount.
*/
amountOutMin?: string;

/**
* Celer bridge transaction ID.
*/
Expand Down

0 comments on commit 9bdcbfe

Please sign in to comment.