-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
352b96a
commit 872da50
Showing
12 changed files
with
154 additions
and
390 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,15 @@ | ||
import { ChainIds } from '@sovryn/ethers-provider'; | ||
|
||
export const BOLTZ_URL = { | ||
import { defaultChainId } from '../../../config/chains'; | ||
|
||
export const BOLTZ_API_URLS = { | ||
[ChainIds.RSK_MAINNET]: 'https://api.boltz.exchange/', | ||
[ChainIds.RSK_TESTNET]: 'https://testnet.boltz.exchange/api/', | ||
}; | ||
|
||
export const BOLTZ_EXCHANGE_URLS = { | ||
[ChainIds.RSK_MAINNET]: 'https://boltz.exchange/', | ||
[ChainIds.RSK_TESTNET]: 'https://testnet.boltz.exchange/', | ||
}; | ||
|
||
export const BOLTZ_EXCHANGE_URL = BOLTZ_EXCHANGE_URLS[defaultChainId]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
.../app/3_organisms/FastBtcDialog/components/BoltzSendFlow/components/StatusScreen.utils.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import React from 'react'; | ||
|
||
import { t } from 'i18next'; | ||
|
||
import { StatusType } from '@sovryn/ui'; | ||
|
||
import { StatusIcon } from '../../../../../2_molecules/StatusIcon/StatusIcon'; | ||
import { translations } from '../../../../../../locales/i18n'; | ||
import { BoltzStatusType } from './BoltzStatus'; | ||
|
||
const translation = translations.boltz.send.confirmationScreens; | ||
|
||
export const getTitle = ( | ||
txStatus: StatusType, | ||
BoltzStatus: BoltzStatusType, | ||
) => { | ||
if (!BoltzStatus) { | ||
return t(translation.titles.default); | ||
} | ||
if (txStatus === StatusType.error) { | ||
return t(translation.titles.error); | ||
} | ||
|
||
if ( | ||
txStatus === StatusType.success && | ||
[ | ||
BoltzStatusType.paid, | ||
BoltzStatusType.txClaimed, | ||
BoltzStatusType.settled, | ||
].includes(BoltzStatus) | ||
) { | ||
return t(translation.titles.success); | ||
} | ||
|
||
return t(translation.titles.pending); | ||
}; | ||
|
||
export const getDescription = ( | ||
txStatus: StatusType, | ||
boltzStatus: BoltzStatusType, | ||
) => { | ||
if (txStatus === StatusType.idle || !boltzStatus) { | ||
return t(translation.descriptions.default); | ||
} | ||
|
||
if (txStatus === StatusType.error) { | ||
return ( | ||
<StatusIcon | ||
status={StatusType.error} | ||
dataAttribute="funding-send-status" | ||
/> | ||
); | ||
} | ||
|
||
if ( | ||
txStatus === StatusType.success && | ||
[ | ||
BoltzStatusType.paid, | ||
BoltzStatusType.txClaimed, | ||
BoltzStatusType.settled, | ||
].includes(boltzStatus) | ||
) { | ||
return ( | ||
<StatusIcon | ||
status={StatusType.success} | ||
dataAttribute="funding-send-status" | ||
/> | ||
); | ||
} | ||
|
||
return ( | ||
<StatusIcon | ||
status={StatusType.pending} | ||
dataAttribute="funding-send-status" | ||
/> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...ontend/src/app/3_organisms/FastBtcDialog/components/NetworkChooser/NetworkChooser.type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export enum Direction { | ||
Receive, | ||
Send, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.