-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add sign and submit with passwoard (#2663)
- Loading branch information
Showing
35 changed files
with
1,380 additions
and
681 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions
21
apps/wallet-mobile/src/features/Swap/common/TransactionSigned/TransactionSigned.stories.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,21 @@ | ||
import {storiesOf} from '@storybook/react-native' | ||
import React from 'react' | ||
import {StyleSheet, View} from 'react-native' | ||
|
||
import {TransactionSigned} from './TransactionSigned' | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
padding: 16, | ||
}, | ||
}) | ||
|
||
storiesOf('SWAP TransactionSigned', module) // | ||
.add('success', () => { | ||
return ( | ||
<View style={styles.container}> | ||
<TransactionSigned /> | ||
</View> | ||
) | ||
}) |
51 changes: 51 additions & 0 deletions
51
apps/wallet-mobile/src/features/Swap/common/TransactionSigned/TransactionSigned.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,51 @@ | ||
import React from 'react' | ||
import {Image, StyleSheet, Text, TouchableOpacity, View} from 'react-native' | ||
|
||
import TxSuccess from '../../../../assets/img//transaction-success.png' | ||
import {Button} from '../../../../components' | ||
import {useNavigateTo} from '../navigation' | ||
import {useStrings} from '../strings' | ||
|
||
export const TransactionSigned = () => { | ||
const strings = useStrings() | ||
const navigate = useNavigateTo() | ||
|
||
return ( | ||
<View style={styles.container}> | ||
<View> | ||
<Image source={TxSuccess} /> | ||
</View> | ||
|
||
<Text style={styles.title}>{strings.transactionSigned}</Text> | ||
|
||
<Text style={styles.text}>{strings.transactionDisplay}</Text> | ||
|
||
<TouchableOpacity style={styles.button}> | ||
<Text>{strings.seeOnExplorer}</Text> | ||
</TouchableOpacity> | ||
|
||
<Button shelleyTheme title={strings.goToOrders} onPress={() => navigate.startSwap()} /> | ||
</View> | ||
) | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flexDirection: 'column', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
height: '100%', | ||
}, | ||
title: { | ||
fontWeight: '500', | ||
fontSize: 20, | ||
paddingBottom: 4, | ||
}, | ||
text: { | ||
color: '#6B7384', | ||
fontSize: 16, | ||
}, | ||
button: { | ||
paddingVertical: 16, | ||
}, | ||
}) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import {mockSwapStateDefault} from '@yoroi/swap' | ||
|
||
import {mocks as walletMocks} from '../../../yoroi-wallets/mocks/wallet' | ||
import {asQuantity} from '../../../yoroi-wallets/utils' | ||
|
||
type ProviderType = 'sundaeswap' | 'minswap' | 'wingriders' | 'muesliswap_v1' | 'muesliswap_v2' | 'muesliswap_v3' | ||
type Type = 'market' | 'limit' | ||
|
||
export const mocks = { | ||
confirmTx: { | ||
...mockSwapStateDefault, | ||
yoroiUnsignedTx: walletMocks.yoroiUnsignedTx, | ||
createOrder: { | ||
address: '', | ||
amounts: { | ||
buy: { | ||
quantity: asQuantity(20467572) as `${number}`, | ||
tokenId: '208a2ca888886921513cb777bb832a8dc685c04de990480151f12150.53484942414441', | ||
}, | ||
sell: {quantity: asQuantity(2000000), tokenId: ''}, | ||
}, | ||
datum: '', | ||
datumHash: '', | ||
limitPrice: undefined, | ||
selectedPool: { | ||
batcherFee: {quantity: asQuantity(2500000), tokenId: ''}, | ||
deposit: {quantity: asQuantity(2000000), tokenId: ''}, | ||
fee: '0.05', | ||
lastUpdate: '2023-09-08 09:56:13', | ||
lpToken: { | ||
quantity: asQuantity(68917682), | ||
tokenId: '0029cb7c88c7567b63d1a512c0ed626aa169688ec980730c0473b913.6c702083', | ||
}, | ||
poolId: '0029cb7c88c7567b63d1a512c0ed626aa169688ec980730c0473b913.702083', | ||
price: 0.0890390378168252, | ||
provider: 'sundaeswap' as ProviderType, | ||
tokenA: {quantity: asQuantity(20630071), tokenId: ''}, | ||
tokenB: { | ||
quantity: asQuantity(231696922), | ||
tokenId: '208a2ca888886921513cb777bb832a8dc685c04de990480151f12150.53484942414441', | ||
}, | ||
}, | ||
slippage: 1, | ||
type: 'market' as Type, | ||
}, | ||
}, | ||
} |
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
34 changes: 34 additions & 0 deletions
34
apps/wallet-mobile/src/features/Swap/useCases/ConfirmTxScreen/ConfirmTx.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,34 @@ | ||
import {Datum} from '@emurgo/yoroi-lib' | ||
import React from 'react' | ||
|
||
import {YoroiWallet} from '../../../../yoroi-wallets/cardano/types' | ||
import {YoroiUnsignedTx} from '../../../../yoroi-wallets/types' | ||
import {ConfirmTxWithHW} from './ConfirmTxWithHW' | ||
import {ConfirmTxWithPassword} from './ConfirmTxWithPassword' | ||
|
||
type Props = { | ||
wallet: YoroiWallet | ||
unsignedTx: YoroiUnsignedTx | ||
onCancel: () => void | ||
onSuccess: () => void | ||
datum: Datum | ||
} | ||
|
||
export const ConfirmTx = ({wallet, onSuccess, onCancel, unsignedTx, datum}: Props) => { | ||
return wallet.isHW ? ( | ||
<ConfirmTxWithHW // | ||
wallet={wallet} | ||
unsignedTx={unsignedTx} | ||
onSuccess={onSuccess} | ||
onCancel={onCancel} | ||
/> | ||
) : ( | ||
<ConfirmTxWithPassword // | ||
wallet={wallet} | ||
unsignedTx={unsignedTx} | ||
datum={datum} | ||
onSuccess={onSuccess} | ||
onCancel={onCancel} | ||
/> | ||
) | ||
} |
Oops, something went wrong.