Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TW-786 Refactored transaction history for send, receive and delegate #884

Merged
Show file tree
Hide file tree
Changes from 29 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
ad2a252
TW-786 Refactored transaction history for send, receive and delegate
herkoss Jul 17, 2023
45a105f
TW-786 Fixed tests
herkoss Jul 18, 2023
f3f1070
TW-786 Fixed qa issues
herkoss Jul 27, 2023
800d7f2
TW-786 Fixed ios/TempleWallet.xcodeproj/project.pbxproj
herkoss Jul 27, 2023
bcc2e75
TW-786 Fixed selected fiat currency symbol
herkoss Jul 27, 2023
f58b554
TW-786 Fixed QA issues
herkoss Jul 31, 2023
64295fd
TW-786 Added parser
herkoss Aug 2, 2023
dd69343
TW-786 Used Parser
herkoss Aug 3, 2023
41a26da
TW-786 Finished big refactoting
herkoss Aug 4, 2023
7f9e031
Merge branch 'development' into TW-786-transaction-history-send-recei…
herkoss Aug 7, 2023
a27e35c
TW-786 Fixed snapshot
herkoss Aug 7, 2023
7ddcaff
Merge branch 'TW-786-transaction-history-send-receive-baking-rewards-…
herkoss Aug 7, 2023
3675d00
TW-786 Fixed comments
herkoss Aug 7, 2023
b20c4a9
TW-786 Fixed comments after review
herkoss Aug 10, 2023
caba37d
TW-786 Fixed comments after review
herkoss Aug 10, 2023
f24adc0
TW-786 Added known bakers
herkoss Aug 11, 2023
90f4f1c
TW-786 Fixed QA issues. Fixed activity loading and address styles
herkoss Aug 14, 2023
ae808da
TW-786 Fixed imports
herkoss Aug 15, 2023
a81335d
TW-786 Fixed activity loading
herkoss Aug 15, 2023
76d11c5
TW-786 Fixed comment
herkoss Aug 15, 2023
ae78a60
TW-786 FIed
herkoss Aug 15, 2023
710ccfe
TW-786 Fixed bug while parser return empty array of activities
herkoss Aug 16, 2023
1a08041
TW-786 deleted console.logs
herkoss Aug 16, 2023
b1d9319
TW-786 Fixed QA issues
herkoss Aug 23, 2023
fec1db6
TW-786 Added memo to callbacks
herkoss Aug 25, 2023
02ccc41
TW-786 FIxed comments
herkoss Aug 25, 2023
7965bfc
TW-786 FIxed render item functinon
herkoss Aug 25, 2023
5cec3e2
Update src/hooks/use-contract-activity.ts
herkoss Aug 28, 2023
92fda81
TW-786 Fixed comments
herkoss Aug 28, 2023
68f0079
Merge branch 'transaction-history-epic' into TW-786-transaction-histo…
herkoss Aug 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"@taquito/tzip12": "17.0.0",
"@taquito/tzip16": "17.0.0",
"@taquito/utils": "17.0.0",
"@temple-wallet/transactions-parser": "^1.0.0",
"@temple-wallet/wallet-address-validator": "^0.4.2",
"@tezos-domains/core": "1.26.0",
"@tezos-domains/taquito-client": "1.26.0",
Expand All @@ -68,8 +69,8 @@
"bip39": "^3.0.4",
"buffer": "^6.0.3",
"cross-fetch": "^3.1.5",
"date-fns": "^2.30.0",
"currency-codes": "^2.1.0",
"date-fns": "^2.30.0",
"ed25519-hd-key": "^1.3.0",
"events": "^3.3.0",
"formik": "^2.2.9",
Expand Down
234 changes: 234 additions & 0 deletions src/apis/baking-bad/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,237 @@ export const mockBaker: BakerInterface = {
audit: 'Mock Audit',
insuranceCoverage: 44
};

export interface KnownBaker {
address: string;
name: string;
logo: string | null;
}

export const KNOWN_BAKERS: Array<KnownBaker> = [
{
address: 'tz1SvASb4xmkiM82ijexDHzn6bYakaReBypt',
name: 'Anonstake Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1SvASb4xmkiM82ijexDHzn6bYakaReBypt'
},
{
address: 'tz1TqU5hwh6CtC8Ps5GYBi7YyawvtKLNCbvQ',
name: 'Ateza Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1TqU5hwh6CtC8Ps5GYBi7YyawvtKLNCbvQ'
},
{
address: 'tz1Zrqm4TkJwqTxm5TiyVFh6taXG4Wrq7tko',
name: 'Bake’n’Rolls Payouts 2',
logo: null
},
{
address: 'tz1iVCqjMRG7MfBoFnVjbLQyeLAeJQfLxXze',
name: 'Bakery-IL Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1iVCqjMRG7MfBoFnVjbLQyeLAeJQfLxXze'
},
{
address: 'tz1NAozDvi5e7frVq9cUaC3uXQQannemB8Jw',
name: 'BakeTz Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1NAozDvi5e7frVq9cUaC3uXQQannemB8Jw'
},
{
address: 'tz1PayLDWLg39fbkwKejnT3aijz4QEd5kgt3',
name: 'Baking Team Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1PayLDWLg39fbkwKejnT3aijz4QEd5kgt3'
},
{
address: 'tz1UQvdfQ2cwyDa6k6U62mkHWeULwBqCcJwN',
name: 'Citadel.one Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1UQvdfQ2cwyDa6k6U62mkHWeULwBqCcJwN'
},
{
address: 'tz1cNARmnRRrvZgspPr2rSTUWq5xtGTuKuHY',
name: 'Cryptium Labs Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1cNARmnRRrvZgspPr2rSTUWq5xtGTuKuHY'
},
{
address: 'tz1ZbSrRrfhU8LYHELWNswx2JcFARXTGKKVk',
name: 'DNAG Delegation Payouts 1',
logo: 'https://services.tzkt.io/v1/avatars/tz1ZbSrRrfhU8LYHELWNswx2JcFARXTGKKVk'
},
{
address: 'tz1aqYbUuXoraB7h39Ls3HvbDwiMhHRV199L',
name: 'Elite Tezos Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1aqYbUuXoraB7h39Ls3HvbDwiMhHRV199L'
},
{
address: 'tz1W1en9UpMCH4ZJL8wQCh8JDKCZARyVx2co',
name: 'Everstake Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1W1en9UpMCH4ZJL8wQCh8JDKCZARyVx2co'
},
{
address: 'tz1dXCHSN8uwnappk4uet1WQeuvbaJog4Jwi',
name: 'Figment Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1dXCHSN8uwnappk4uet1WQeuvbaJog4Jwi'
},
{
address: 'tz1ePtw5wtQMNH1LkJaVXbeVmW7joWqdNzge',
name: 'GOLD TZ Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1ePtw5wtQMNH1LkJaVXbeVmW7joWqdNzge'
},
{
address: 'tz1TyAEPtLt7oapQvZirVbswz1VRbdRqdfW7',
name: 'Happy Tezos Dexter Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1TyAEPtLt7oapQvZirVbswz1VRbdRqdfW7'
},
{
address: 'tz1hodLFy8YDHtf1qJ3XH1gCyeXfwWEitkj9',
name: 'hodl.farm Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1hodLFy8YDHtf1qJ3XH1gCyeXfwWEitkj9'
},
{
address: 'tz1MTAmuFmKu3MoxnkVsMj7xvSScj6d83hu5',
name: 'LetzBake! Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1MTAmuFmKu3MoxnkVsMj7xvSScj6d83hu5'
},
{
address: 'tz1fRAiiDUxnXZwDmQghh1n6VytQUZWNPwWN',
name: 'Melange Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1fRAiiDUxnXZwDmQghh1n6VytQUZWNPwWN'
},
{
address: 'tz1MdSsDBG8k8q1pxZrdpSC2Aw49ukFs8ACy',
name: 'Money Every 3 Days Payouts 1',
logo: 'https://services.tzkt.io/v1/avatars/tz1MdSsDBG8k8q1pxZrdpSC2Aw49ukFs8ACy'
},
{
address: 'tz1XVBuWfdFpWCiMvsEV8KEX2nkMHN3mfuHJ',
name: 'Neokta Labs Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1XVBuWfdFpWCiMvsEV8KEX2nkMHN3mfuHJ'
},
{
address: 'tz1c9HEyZdAWXZCLE7h3KcZCyykjZr7VY3QM',
name: 'PayTezos Payouts 2',
logo: 'https://services.tzkt.io/v1/avatars/tz1c9HEyZdAWXZCLE7h3KcZCyykjZr7VY3QM'
},
{
address: 'tz1MoonPbyMJSqMVsVwExgVc5egnv18CgSDq',
name: 'P2P Validator Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1MoonPbyMJSqMVsVwExgVc5egnv18CgSDq'
},
{
address: 'tz1VCP3MQdfxtRc83CRJZX43wc1oZUxb6KmH',
name: 'Spice Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1VCP3MQdfxtRc83CRJZX43wc1oZUxb6KmH'
},
{
address: 'tz1fishChEERnSesm8mHe7xsJJwymbHVLcYf',
name: 'Stake.fish Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1fishChEERnSesm8mHe7xsJJwymbHVLcYf'
},
{
address: 'tz1Ywgcavxq9D6hL32Q2AQWHAux9MrWqGoZC',
name: 'StakeNow Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1Ywgcavxq9D6hL32Q2AQWHAux9MrWqGoZC'
},
{
address: 'tz1Y2rhY9nBKfd2jp7m4z8iAMKKARWS3BvFA',
name: "Shake 'n Bake Payouts",
logo: 'https://services.tzkt.io/v1/avatars/tz1Y2rhY9nBKfd2jp7m4z8iAMKKARWS3BvFA'
},
{
address: 'tz1gs78wrxS34XhGPECmN5fABKpEuhUGwAXS',
name: 'Stakery Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1gs78wrxS34XhGPECmN5fABKpEuhUGwAXS'
},
{
address: 'tz1iuZ76cLaaca8Dh4soYEHjYeVb5vHmmP5Z',
name: 'Staking Facilities Payouts 2',
logo: 'https://services.tzkt.io/v1/avatars/tz1iuZ76cLaaca8Dh4soYEHjYeVb5vHmmP5Z'
},
{
address: 'tz1hxtCEcD7idQJEDiJEq37vBkoRcwF6KC2X',
name: 'Staking Shop Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1hxtCEcD7idQJEDiJEq37vBkoRcwF6KC2X'
},
{
address: 'tz1hTJnYMKSDUv55yREM8ezmC5nsdbPUWao7',
name: 'Steak.and.Bake Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1hTJnYMKSDUv55yREM8ezmC5nsdbPUWao7'
},
{
address: 'tz1iQRWn2zvdTqhJtGTBbYktodNtw67yE4a6',
name: 'Tezbaguette Payouts ',
logo: 'https://services.tzkt.io/v1/avatars/tz1iQRWn2zvdTqhJtGTBbYktodNtw67yE4a6'
},
{
address: 'tz1TkQCxYhhpzMop7Da6g2tpa1Z2giUbPdqv',
name: 'Tez Baker Payouts 5',
logo: 'https://services.tzkt.io/v1/avatars/tz1TkQCxYhhpzMop7Da6g2tpa1Z2giUbPdqv'
},
{
address: 'tz1g4o4a2wxpzJ7EgG3onFM5TLaPyiRFjFhL',
name: 'Tezgate Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1g4o4a2wxpzJ7EgG3onFM5TLaPyiRFjFhL'
},
{
address: 'tz1RiSGsJwcN6roErVt4D3mfSCYSaWYWP9q8',
name: 'Tezoris Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1RiSGsJwcN6roErVt4D3mfSCYSaWYWP9q8'
},
{
address: 'tz1LJycSuCT25AA5VJwNW1QYXVGyy7YLwZh9',
name: 'TezosAirGap Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1LJycSuCT25AA5VJwNW1QYXVGyy7YLwZh9'
},
{
address: 'tz1LXaBkg3gZLVyB2awuboPAi6CnWxT4bCMt',
name: 'Tezos Boutique Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1LXaBkg3gZLVyB2awuboPAi6CnWxT4bCMt'
},
{
address: 'tz1VfoA5qPksECBkvr2EUuT6u5VgLCi3vTPV',
name: 'Tezos.nu Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1VfoA5qPksECBkvr2EUuT6u5VgLCi3vTPV'
},
{
address: 'tz1Y2bfsQAYHrWZpM1AwomYMw2KEtaJ5VMfU',
name: 'Tezos.Rio Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1Y2bfsQAYHrWZpM1AwomYMw2KEtaJ5VMfU'
},
{
address: 'tz1LXz7C2wPr74nfMMHmqsqbnasPvi89o2U6',
name: 'TezosRus Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1LXz7C2wPr74nfMMHmqsqbnasPvi89o2U6'
},
{
address: 'tz1Tnr7CDL5i45EHSPpPReBocDiGbMwpdTCn',
name: "Tezos Wake n' Bake Payouts",
logo: 'https://services.tzkt.io/v1/avatars/tz1Tnr7CDL5i45EHSPpPReBocDiGbMwpdTCn'
},
{
address: 'tz1WntXgznbivRjyhE7Y5jEzoebAhMPB2iJa',
name: 'Tezzieland Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1WntXgznbivRjyhE7Y5jEzoebAhMPB2iJa'
},
{
address: 'tz1ant4etDpDJKQqASYri7bse5tCv2FNbvR6',
name: 'XTZ Antipodes Payouts 2',
logo: 'https://services.tzkt.io/v1/avatars/tz1ant4etDpDJKQqASYri7bse5tCv2FNbvR6'
},
{
address: 'tz1Z7HGaayrL4XDNQ7UyXe7L4wXboELkhBm3',
name: 'XTZ Delegate Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1Z7HGaayrL4XDNQ7UyXe7L4wXboELkhBm3'
},
{
address: 'tz1aF8E89g1EqqzCmbNCLunTtCtxgkoQUX7N',
name: '0xb1 / PlusMinus Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1aF8E89g1EqqzCmbNCLunTtCtxgkoQUX7N'
},
{
address: 'tz1KwdqMQGB75VDnSsLiteFKVX4HNzvbNvjZ',
name: '888XTZ Payouts',
logo: 'https://services.tzkt.io/v1/avatars/tz1KwdqMQGB75VDnSsLiteFKVX4HNzvbNvjZ'
},
{
address: 'tz1ea4wfxxvjpic1DZCU2WnUCBmiPVrSXrSz',
name: 'Cerberus Bakery Payouts',
logo: null
}
];
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@ export const useActivityGroupAmountChangeStyles = createUseStyles(({ colors, typ
container: {
alignItems: 'flex-end'
},
amountText: {
...typography.numbersRegular17,
amountWeight: {
fontWeight: '400'
},
amountText15: {
...typography.numbersRegular15
},
amountText13: {
...typography.numbersRegular13
},
destructiveAmountText: {
color: colors.destructive
},
positiveAmountText: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,39 @@
import React, { FC } from 'react';
import { Text, View } from 'react-native';

import { NonZeroAmounts } from '../../../../interfaces/non-zero-amounts.interface';
import { conditionalStyle } from '../../../../utils/conditional-style';
import { formatAssetAmount } from '../../../../utils/number.util';
import { NonZeroAmounts } from 'src/interfaces/non-zero-amounts.interface';
import { conditionalStyle } from 'src/utils/conditional-style';
import { formatAssetAmount } from 'src/utils/number.util';
import { shortizeSymbol } from 'src/utils/token-metadata.utils';

import { useActivityGroupAmountChangeStyles } from './activity-group-amount-change.styles';

export enum TextSize {
Small = 'Small',
Regular = 'Regular'
}
interface Props {
textSize?: TextSize;
nonZeroAmounts: NonZeroAmounts;
}

export const ActivityGroupAmountChange: FC<Props> = ({ nonZeroAmounts }) => {
export const ActivityGroupAmountChange: FC<Props> = ({ nonZeroAmounts, textSize = TextSize.Regular }) => {
const styles = useActivityGroupAmountChangeStyles();

return (
<View style={styles.container}>
{nonZeroAmounts.amounts.map(({ parsedAmount, isPositive, symbol }, index) => (
<Text key={index} style={[styles.amountText, conditionalStyle(isPositive, styles.positiveAmountText)]}>
<Text
key={index}
style={[
styles.amountWeight,
conditionalStyle(textSize === TextSize.Small, styles.amountText13),
conditionalStyle(textSize === TextSize.Regular, styles.amountText15),
conditionalStyle(isPositive, styles.positiveAmountText, styles.destructiveAmountText)
]}
>
{isPositive && '+'}
{formatAssetAmount(parsedAmount)} {symbol}
{formatAssetAmount(parsedAmount)} {shortizeSymbol(symbol)}
</Text>
))}
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const useActivityGroupDollarAmountChangeStyles = createUseStyles(({ color
color: colors.destructive
},
valueText: {
...typography.numbersRegular11
...typography.numbersRegular11,
color: colors.gray1
}
}));
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React, { FC } from 'react';
import { View } from 'react-native';

import { NonZeroAmounts } from '../../../../interfaces/non-zero-amounts.interface';
import { conditionalStyle } from '../../../../utils/conditional-style';
import { FormattedAmount } from '../../../formatted-amount';
import { useActivityGroupDollarAmountChangeStyles } from './activity-group-dollar-amount-change.styles';

Expand All @@ -16,17 +15,7 @@ export const ActivityGroupDollarAmountChange: FC<Props> = ({ nonZeroAmounts }) =
return (
<View style={styles.container}>
{nonZeroAmounts.dollarSums.map((amount, index) => (
<FormattedAmount
key={index}
amount={amount}
isDollarValue={true}
showMinusSign={amount.isLessThan(0)}
showPlusSign={amount.isGreaterThan(0)}
style={[
styles.valueText,
conditionalStyle(amount.isGreaterThan(0), styles.positiveAmountText, styles.negativeAmountText)
]}
/>
<FormattedAmount key={index} amount={amount} isDollarValue={true} style={styles.valueText} />
))}
</View>
);
Expand Down
Loading
Loading