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

feat: send token #1524

Draft
wants to merge 302 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
302 commits
Select commit Hold shift + click to select a range
12f2419
wip: populate db on list change
Jaxiii Jun 14, 2024
2c148a4
wip: change datetime to millisecs since epoch
Jaxiii Jun 15, 2024
48ba80f
timestamp on filename
Jaxiii Jun 17, 2024
6d3e9fb
wip: info dialog
Jaxiii Jun 17, 2024
179d804
fix: styling
Jaxiii Jun 17, 2024
0cd8cf3
fix: linter
Jaxiii Jun 17, 2024
248ac31
Merge branch 'master' into token-details-page
Jaxiii Jun 17, 2024
ce311e3
wip: timestamped csv file and timespamp based init
Jaxiii Jun 17, 2024
cabc328
fix: linter
Jaxiii Jun 17, 2024
e15eb35
Merge branch 'master' into feat/store-token-list-localdb
Jaxiii Jun 17, 2024
0e0da4f
wip: sync getToken
Jaxiii Jun 18, 2024
38180f9
wip: remove in memory json
Jaxiii Jun 18, 2024
3c26aa6
remove unused files
justinenerio Jun 18, 2024
a78fced
wip: getToken async
Jaxiii Jun 18, 2024
cc7614c
feat: token info dark background
Jaxiii Jun 19, 2024
1c7cc4c
wip: recent activity
Jaxiii Jun 20, 2024
be3c7e9
feat: token mint address
Jaxiii Jun 20, 2024
8c352bb
wip: token tx list
Jaxiii Jun 22, 2024
d133768
wip: polish
Jaxiii Jun 22, 2024
d338fc3
wip: scroll animation and amount value
Jaxiii Jun 23, 2024
173cf9b
fix: styling
Jaxiii Jun 23, 2024
7e65826
fix: stylinh
Jaxiii Jun 23, 2024
21fd4ae
fix: linter
Jaxiii Jun 23, 2024
26599fc
fix: dep cycle
Jaxiii Jun 23, 2024
5ff07a8
db pump version
Jaxiii Jun 23, 2024
8b77cf2
feat: getToken from localdb
Jaxiii Jun 24, 2024
18c61b5
fix: tests
Jaxiii Jun 24, 2024
6a498de
fix: styling
Jaxiii Jun 24, 2024
c1d7be2
fix: comments
Jaxiii Jun 24, 2024
9bb6135
fix: imports
Jaxiii Jun 24, 2024
72ccf55
fix: tests
Jaxiii Jun 24, 2024
6ea9b7f
fix: tests
Jaxiii Jun 24, 2024
9ed46a9
wip: move init and getToken to repository
Jaxiii Jun 25, 2024
4c03680
wip: move TokenListRepo outside model scope
Jaxiii Jun 25, 2024
4bb164b
wip: chuncked stream data to isolate
Jaxiii Jun 26, 2024
e5637fc
feat: token conversion rate refresh
Jaxiii Jun 28, 2024
45be1b6
fix: styling
Jaxiii Jun 28, 2024
9350050
fix: transaction collision
Jaxiii Jun 28, 2024
ac3909f
fix: linter & styling
Jaxiii Jun 28, 2024
4444295
wip: send token layout
Jaxiii Jun 30, 2024
3b50d0f
wip: remove token service
Jaxiii Jul 1, 2024
b2dab55
fix: remove future from build method
Jaxiii Jul 1, 2024
7ea3202
fix: mount on async gap
Jaxiii Jul 1, 2024
89cbcf4
fix: tests
Jaxiii Jul 1, 2024
70387fd
feat: mocked and memory test
Jaxiii Jul 1, 2024
96f039d
fix: first opening price fetch
Jaxiii Jul 1, 2024
160a1e5
wip: get token list file from ec_backend
Jaxiii Jul 3, 2024
d5683b4
fix: naming
Jaxiii Jul 3, 2024
6467472
wip: network stream token list
Jaxiii Jul 7, 2024
76f98f6
wip: remove unused dto
Jaxiii Jul 7, 2024
3ccff66
wip: remove token assets from pubspec
Jaxiii Jul 7, 2024
4da836d
wip: intl version
Jaxiii Jul 7, 2024
6b3eba4
wip: add .g client
Jaxiii Jul 8, 2024
97e471b
Merge branch 'master' into feat/store-token-list-localdb
Jaxiii Jul 8, 2024
e64c931
Merge branch 'master' into token-details-page
Jaxiii Jul 8, 2024
6b437ee
fix: merge imports
Jaxiii Jul 8, 2024
96d1a79
fix: details screen textspan fiat amount null checker
Jaxiii Jul 8, 2024
6dd5fee
feat: md5 hash
Jaxiii Jul 9, 2024
02fd984
feat: md5 hash
Jaxiii Jul 9, 2024
7e3626a
fix: analyzer and dcm
Jaxiii Jul 9, 2024
67c4617
fix: parseTags & parseExtensions
Jaxiii Jul 10, 2024
57bf0e8
fix: remove unused endpoint ref
Jaxiii Jul 10, 2024
0ff6ace
Merge branch 'feat/store-token-list-localdb' into token-details-page
Jaxiii Jul 10, 2024
6c85379
feat: local token db and better tx updater
Jaxiii Jul 11, 2024
2c2b592
fix: db bump and dcm
Jaxiii Jul 11, 2024
ce507ce
fix: db_schemas
Jaxiii Jul 11, 2024
55e54e3
Merge branch 'master' into feat/store-token-list-localdb
Jaxiii Jul 11, 2024
eb7880a
wip: update call
Jaxiii Jul 11, 2024
ac9aa96
fix: api calls naming
Jaxiii Jul 11, 2024
a9da75c
refact: naming
Jaxiii Jul 12, 2024
f43f8fd
refact: api
Jaxiii Jul 12, 2024
de304f4
Merge branch 'master' into feat/store-token-list-localdb
Jaxiii Jul 12, 2024
003bc53
Merge branch 'feat/store-token-list-localdb' into token-details-page
Jaxiii Jul 12, 2024
95eb4b4
refact: naming
Jaxiii Jul 12, 2024
59a0fd4
Merge branch 'token-details-page' into feat/send-token
Jaxiii Jul 12, 2024
5bfaeca
fix: naming and amount decimals
Jaxiii Jul 12, 2024
29c611c
feat: i10n
Jaxiii Jul 13, 2024
acc546b
feat: i10l file
Jaxiii Jul 13, 2024
623e835
refact: convert screen to stateless
Jaxiii Jul 13, 2024
e207875
fix: dcm styling
Jaxiii Jul 14, 2024
be21a21
Merge branch 'token-details-page' into feat/send-token
Jaxiii Jul 14, 2024
ca21de5
wip: balance loader
Jaxiii Jul 14, 2024
52be837
Merge branch 'master' into feat/store-token-list-localdb
ookami-kb Jul 15, 2024
a0bddbf
wip: send token flow
Jaxiii Jul 15, 2024
ac656ed
fix: clean up
Jaxiii Jul 15, 2024
269079c
fix: clean up
Jaxiii Jul 15, 2024
d88a79c
fix: clean up
Jaxiii Jul 15, 2024
097a9e7
Merge branch 'feat/store-token-list-localdb' into token-details-page
Jaxiii Jul 15, 2024
66eb39e
fix: remove solana pkg changes
Jaxiii Jul 15, 2024
bc0d304
fix: format codec exception
Jaxiii Jul 15, 2024
01a735e
Merge branch 'master' into feat/store-token-list-localdb
Jaxiii Jul 15, 2024
fbea8ae
fix: token file stream codec error
Jaxiii Jul 16, 2024
48249e8
Merge branch 'feat/store-token-list-localdb' into token-details-page
Jaxiii Jul 16, 2024
cdda44d
refact: arg naming style
Jaxiii Jul 16, 2024
38e2d94
Merge branch 'feat/store-token-list-localdb' into token-details-page
Jaxiii Jul 16, 2024
e989cbf
wip: moving tx init
Jaxiii Jul 17, 2024
6efacdd
fix: remove future from build method
Jaxiii Jul 17, 2024
2ebf21c
Merge branch 'feat/store-token-list-localdb' into token-details-page
Jaxiii Jul 17, 2024
7ba20cb
fix: analyzer
Jaxiii Jul 17, 2024
10900c1
refact: transaction repo init
Jaxiii Jul 18, 2024
ef8ab00
refact: transaction repo init
Jaxiii Jul 18, 2024
6e9ecac
Merge branch 'token-details-page' into feat/send-token
Jaxiii Jul 18, 2024
54c2dca
wip: send token flow
Jaxiii Jul 19, 2024
8ec0101
wip: send token flow
Jaxiii Jul 19, 2024
9536499
minor upd
justinenerio Jul 23, 2024
14bbe6d
refactor: polish
Jaxiii Jul 26, 2024
841a0a1
refact: remove async cache
Jaxiii Jul 26, 2024
b1bb454
refactor to services
justinenerio Jul 26, 2024
3417fcc
upd
justinenerio Jul 26, 2024
6ff06c2
Merge branch 'feat/store-token-list-localdb' into token-details-page
Jaxiii Jul 26, 2024
e6d9ff4
refact: remove unused wrapper
Jaxiii Jul 26, 2024
9dfd8e6
fix: remove unused var
Jaxiii Jul 26, 2024
e5c69c7
Merge branch 'token-details-page' into feat/send-token
Jaxiii Jul 26, 2024
2f9716a
fix: remove unused param
Jaxiii Jul 26, 2024
d32dd02
fix: remove unused param
Jaxiii Jul 26, 2024
a37ab9c
Merge branch 'token-details-page' into feat/send-token
Jaxiii Jul 26, 2024
1b0518f
Merge branch 'master' into feat/store-token-list-localdb
Jaxiii Jul 31, 2024
50fb0f4
add schema
Jaxiii Jul 31, 2024
1a7e6e6
Merge branch 'feat/store-token-list-localdb' into token-details-page
Jaxiii Jul 31, 2024
7612dc7
add schema
Jaxiii Jul 31, 2024
2f74a10
Merge branch 'token-details-page' into feat/send-token
Jaxiii Aug 1, 2024
37e3d39
upd
ookami-kb Aug 1, 2024
9851a7b
upd
ookami-kb Aug 1, 2024
052ac50
fix: watch activity
Jaxiii Aug 1, 2024
3b63a27
fix: linter
Jaxiii Aug 2, 2024
38f1f9c
fix: remove unused import
Jaxiii Aug 2, 2024
da1b61c
Merge branch 'feat/store-token-list-localdb' into token-details-page
Jaxiii Aug 2, 2024
19b1cea
Merge branch 'token-details-page' into feat/send-token
Jaxiii Aug 2, 2024
eed63b8
feat: quant input validation
Jaxiii Aug 2, 2024
ba3f144
feat: input locale
Jaxiii Aug 2, 2024
6ddbff3
feat: usdc equivalent token value
Jaxiii Aug 2, 2024
9851d12
upd
ookami-kb Aug 2, 2024
bf32d1e
remove extensions
ookami-kb Aug 2, 2024
8cdbe57
remove extensions
ookami-kb Aug 2, 2024
9a3563e
update schema
ookami-kb Aug 2, 2024
41fb4b1
refact: validate func
Jaxiii Aug 3, 2024
51a7f04
wip: isolate token list
Jaxiii Aug 9, 2024
f959990
wip: 2 step init token db
Jaxiii Aug 9, 2024
08454e0
fix: dcm
Jaxiii Aug 12, 2024
a6a7059
Merge branch 'master' into feat/store-token-list-localdb
Jaxiii Aug 12, 2024
052a45a
fix: null checker
Jaxiii Aug 13, 2024
3966ae1
fix: isolate scope & file hash
Jaxiii Aug 13, 2024
6e60d45
upd
Jaxiii Aug 14, 2024
ad110f1
Merge branch 'feat/store-token-list-localdb' into token-details-page
Jaxiii Aug 14, 2024
a4ee191
refact: rmv single upd
Jaxiii Aug 14, 2024
864eb41
upd schema
Jaxiii Aug 14, 2024
b30eb5a
Merge branch 'token-details-page' into feat/send-token
Jaxiii Aug 14, 2024
dd363aa
Merge branch 'master' into feat/store-token-list-localdb
Jaxiii Aug 15, 2024
0248745
Merge branch 'feat/store-token-list-localdb' into token-details-page
Jaxiii Aug 15, 2024
ed9941c
Merge branch 'token-details-page' into feat/send-token
Jaxiii Aug 15, 2024
d5a87d5
upd
Jaxiii Aug 15, 2024
5b37614
upd
Jaxiii Aug 15, 2024
17b8408
Merge branch 'master' into feat/store-token-list-localdb
Jaxiii Aug 16, 2024
327699a
upd
Jaxiii Aug 16, 2024
1e7b428
Merge branch 'feat/store-token-list-localdb' into token-details-page
Jaxiii Aug 16, 2024
e9c1539
Merge branch 'token-details-page' into feat/send-token
Jaxiii Aug 16, 2024
a6a05df
Merge branch 'master' into feat/store-token-list-localdb
Jaxiii Aug 21, 2024
02e6658
Merge branch 'feat/store-token-list-localdb' into token-details-page
Jaxiii Aug 21, 2024
1721e07
upd schema
Jaxiii Aug 21, 2024
96c5f0f
Merge branch 'token-details-page' into feat/send-token
Jaxiii Aug 21, 2024
41effb2
wip
Jaxiii Aug 23, 2024
7e267c4
wip
Jaxiii Aug 23, 2024
99caf28
wip
Jaxiii Aug 23, 2024
9fa7535
wip
Jaxiii Aug 23, 2024
a662631
fix cycle
Jaxiii Aug 23, 2024
f02ec0d
upd schemas
Jaxiii Aug 23, 2024
1f98191
Merge branch 'feat/store-token-list-localdb' into token-details-page
Jaxiii Aug 23, 2024
47fcc5f
Merge branch 'token-details-page' into feat/send-token
Jaxiii Aug 23, 2024
345a0c1
upd schema
Jaxiii Aug 23, 2024
02430a6
Merge branch 'token-details-page' into feat/send-token
Jaxiii Aug 23, 2024
d4b7ee4
upd
Jaxiii Aug 23, 2024
23b2941
Merge branch 'token-details-page' into feat/send-token
Jaxiii Aug 23, 2024
c40f85f
upd
Jaxiii Aug 23, 2024
70c3ee8
Merge branch 'token-details-page' into feat/send-token
Jaxiii Aug 23, 2024
a2712a6
Merge commit '6be502c4f2d56ead3df879f22dd84c6df40601c1' into token-de…
justinenerio Sep 13, 2024
223b571
upd
justinenerio Sep 13, 2024
7b95306
upd
justinenerio Sep 13, 2024
fd77179
upd
justinenerio Sep 13, 2024
73a3b08
upd
justinenerio Sep 13, 2024
d63f3df
upd
justinenerio Sep 13, 2024
41d3df7
upd
justinenerio Sep 13, 2024
52d210b
upd
justinenerio Sep 13, 2024
c7f060e
upd
justinenerio Sep 13, 2024
f266f30
upd
justinenerio Sep 13, 2024
7f51890
Merge branch 'master' into token-details-page
Merculiar Dec 12, 2024
bdd56f8
upd
Merculiar Dec 12, 2024
d298962
revert
Merculiar Dec 12, 2024
d32496e
upd
Merculiar Dec 12, 2024
0acc99c
removed double check for carousel
Merculiar Dec 13, 2024
a16c4cb
upd
Merculiar Dec 13, 2024
bf7acaa
upd
Merculiar Dec 13, 2024
f392d09
Merge branch 'master' into token-details-page
Merculiar Dec 16, 2024
027e3d6
upd
Merculiar Dec 16, 2024
572f6fb
Merge branch 'master' into token-details-page
Merculiar Dec 16, 2024
a21fb86
Merge branch 'token-details-page' into feat/send-token
Merculiar Dec 16, 2024
b791eeb
formatting
Merculiar Dec 16, 2024
016907c
formatting
Merculiar Dec 16, 2024
6409ce6
upd
Merculiar Dec 16, 2024
0380102
upd
Merculiar Dec 16, 2024
9419625
refactoring
Merculiar Dec 17, 2024
fae2c58
upd
Merculiar Dec 17, 2024
b2cd7b7
upd
Merculiar Dec 17, 2024
5101e67
upd
Merculiar Dec 17, 2024
83094d8
Merge branch 'master' into token-details-page
Merculiar Dec 18, 2024
da9ad39
Merge branch 'token-details-page' into feat/send-token
Merculiar Dec 18, 2024
1fe6f8f
update fetch limit
Merculiar Dec 18, 2024
c1419a8
upd
Merculiar Dec 19, 2024
6743b85
upd
Merculiar Dec 20, 2024
ff407be
Merge branch 'token-details-page' into feat/send-token
Merculiar Dec 20, 2024
7ab4830
upd
Merculiar Dec 20, 2024
fce887d
added chunks to avoid limit requests per seconds
Merculiar Dec 20, 2024
718ee2d
Merge branch 'token-details-page' into feat/send-token
Merculiar Dec 20, 2024
02a2fc6
upd
Merculiar Dec 20, 2024
8fc2047
Merge branch 'token-details-page' into feat/send-token
Merculiar Dec 20, 2024
7b4e49b
upd
Merculiar Dec 20, 2024
bfcae63
Merge branch 'master' into token-details-page
Merculiar Dec 20, 2024
e24301d
Merge branch 'master' into token-details-page
Merculiar Dec 23, 2024
75bdb94
Merge branch 'token-details-page' into feat/send-token
Merculiar Dec 23, 2024
6068eb2
upd
Merculiar Dec 24, 2024
1a5bbc8
upd
Merculiar Dec 24, 2024
c9ae1f8
upd
Merculiar Dec 24, 2024
94bc4fa
upd
Merculiar Dec 24, 2024
1a5efec
upd
Merculiar Dec 24, 2024
3c2a21a
Merge branch 'master' into token-details-page
Merculiar Dec 24, 2024
b33ecbc
Merge branch 'token-details-page' into feat/send-token
Merculiar Dec 24, 2024
9a9168a
upd
Merculiar Dec 27, 2024
e6d522b
upd
Merculiar Dec 27, 2024
c71d6ff
upd
Merculiar Dec 27, 2024
b992771
reogranisation
Merculiar Dec 27, 2024
a1424ea
upd
Merculiar Jan 2, 2025
169d7c5
upd
Merculiar Jan 2, 2025
ea517ca
upd
Merculiar Jan 3, 2025
128ea8a
remove redundant code
Merculiar Jan 3, 2025
5417800
Merge branch 'master' into token-details-page
Merculiar Jan 6, 2025
c7facce
Merge branch 'master' into feat/send-token
Merculiar Jan 6, 2025
c6dc644
formatting
ookami-kb Jan 6, 2025
911ec17
UI improvements
Merculiar Jan 7, 2025
a045051
Merge branch 'master' into token-details-page
Merculiar Jan 7, 2025
ccc792b
upd
Merculiar Jan 7, 2025
18c2e70
nullable tx response
Merculiar Jan 8, 2025
356e12a
add new methods for fetching multiples txs for multiple accounts
Merculiar Jan 8, 2025
a2663aa
add tests
Merculiar Jan 8, 2025
37c81da
Merge branch 'fix/nullable-txs-response' into token-details-page
Merculiar Jan 8, 2025
d79cd55
update
Merculiar Jan 8, 2025
695ee0b
formatting
Merculiar Jan 8, 2025
d4ce966
upd min amount
Merculiar Jan 8, 2025
ea5679a
remove unused code
Merculiar Jan 8, 2025
a2854eb
Merge branch 'token-details-page' into feat/send-token
Merculiar Jan 8, 2025
2e12e80
Merge branch 'master' into feat/send-token
Merculiar Jan 14, 2025
9de7a59
Merge branch 'master' into feat/send-token
Merculiar Jan 15, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@ class AnalyticsManager {
);

void directPaymentSent({
required String symbol,
required Decimal amount,
}) =>
_analytics.track(
'directPaymentSent',
properties: {'amount': amount.toDouble()},
properties: {'token': symbol, 'amount': amount.toDouble()},
);

void paymentRequestLinkCreated({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:dfunc/dfunc.dart';
import 'package:flutter/material.dart';

import '../../../di.dart';
import '../../../l10n/decimal_separator.dart';
import '../../../l10n/device_locale.dart';
import '../../../l10n/l10n.dart';
Expand All @@ -13,6 +14,7 @@ import '../../../ui/usdc_info.dart';
import '../../currency/models/amount.dart';
import '../../currency/models/currency.dart';
import '../../tokens/token.dart';
import '../data/repository.dart';
import '../services/amount_ext.dart';
import 'extensions.dart';

Expand All @@ -25,6 +27,7 @@ class AmountWithEquivalent extends StatelessWidget {
this.shakeKey,
this.error = '',
this.showUsdcInfo = false,
this.backgroundColor = Colors.black,
});

final TextEditingController inputController;
Expand All @@ -33,6 +36,7 @@ class AmountWithEquivalent extends StatelessWidget {
final Key? shakeKey;
final String error;
final bool showUsdcInfo;
final Color backgroundColor;

@override
Widget build(BuildContext context) =>
Expand All @@ -54,6 +58,7 @@ class AmountWithEquivalent extends StatelessWidget {
child: _InputDisplay(
input: value.text,
fontSize: collapsed ? 57 : (context.isSmall ? 55 : 80),
token: token,
),
),
if (!collapsed)
Expand All @@ -77,7 +82,7 @@ class AmountWithEquivalent extends StatelessWidget {
_ => _EquivalentDisplay(
input: value.text,
token: token,
backgroundColor: Colors.black,
backgroundColor: backgroundColor,
),
},
],
Expand Down Expand Up @@ -117,11 +122,27 @@ class _EquivalentDisplay extends StatelessWidget {

final String formattedAmount;
if (shouldDisplay) {
formattedAmount = Amount.fromDecimal(value: value, currency: Currency.usd)
.let((it) => it as FiatAmount)
.let((it) => it.toTokenAmount(token)?.round(Currency.usd.decimals))
formattedAmount = Amount.fromDecimal(
value: value,
currency:
token == Token.usdc ? Currency.usd : CryptoCurrency(token: token),
)
.let(
(it) => switch (it) {
final FiatAmount fiat =>
fiat.toTokenAmount(token)?.round(Currency.usd.decimals),
final CryptoAmount crypto => crypto.toFiatAmount(
defaultFiatCurrency,
ratesRepository: sl<ConversionRatesRepository>(),
),
},
)
.maybeFlatMap(
(it) => it.format(locale, roundInteger: true, skipSymbol: true),
(it) => it.format(
locale,
roundInteger: true,
skipSymbol: token == Token.usdc,
),
)
.ifNull(() => '0');
} else {
Expand All @@ -139,14 +160,15 @@ class _EquivalentDisplay extends StatelessWidget {
fontWeight: FontWeight.w700,
),
),
TextSpan(
text: ' ${token.symbol.toUpperCase()}',
style: const TextStyle(
color: CpColors.yellowColor,
fontSize: 15,
fontWeight: FontWeight.w700,
if (token == Token.usdc)
TextSpan(
text: ' ${Token.usdc.symbol.toUpperCase()}',
style: const TextStyle(
color: CpColors.yellowColor,
fontSize: 15,
fontWeight: FontWeight.w700,
),
),
),
],
),
textAlign: TextAlign.center,
Expand Down Expand Up @@ -218,16 +240,19 @@ class _InputDisplay extends StatelessWidget {
const _InputDisplay({
required this.input,
required this.fontSize,
required this.token,
});

final String input;
final double fontSize;
final Token token;

@override
Widget build(BuildContext context) {
final sign = Currency.usd.sign;
final amount = input.formatted(context);
final formatted = '$sign$amount';
final formatted =
token == Token.usdc ? '$sign$amount' : '$amount ${token.symbol}';

return SizedBox(
height: 94,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ class ODPService {
);

if (newStatus is ODPStatusSuccess) {
_analyticsManager.directPaymentSent(amount: payment.amount.decimal);
_analyticsManager.directPaymentSent(
symbol: payment.amount.token.symbol,
amount: payment.amount.decimal,
);
}

return newStatus == null ? payment : payment.copyWith(status: newStatus);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ import '../../conversion_rates/widgets/extensions.dart';
import '../../currency/models/amount.dart';
import '../../currency/models/currency.dart';
import '../../ramp/widgets/ramp_buttons.dart';
import '../../token_send/screens/token_send_input_screen.dart';
import '../../token_send/widgets/token_app_bar.dart';
import '../../tokens/token.dart';
import '../widgets/token_app_bar.dart';
import '../widgets/token_info.dart';

class TokenDetailsScreen extends StatelessWidget {
Expand Down Expand Up @@ -89,7 +90,10 @@ class _TokenDetailsBody extends StatelessWidget {
const SizedBox(height: 4),
const _TokenHeader(),
const SizedBox(height: 24),
if (token.isUsdcToken) const _RampButtons(),
if (token.isUsdcToken)
const _RampButtons()
else
_ActionButtons(token: token),
const SizedBox(height: 24),
Expanded(
child: DecoratedBox(
Expand Down Expand Up @@ -226,28 +230,34 @@ class _RampButtons extends StatelessWidget {
);
}

// ignore: unused_element, won't be available in first release
class _SwapButton extends StatelessWidget {
const _SwapButton();
class _ActionButtons extends StatelessWidget {
const _ActionButtons({required this.token});

final Token token;

@override
Widget build(BuildContext context) => Padding(
padding: const EdgeInsets.symmetric(horizontal: 40),
// ignore: avoid-single-child-column-or-row, won't be available in first release,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
// TODO(dev): add swap button
// CpButton(
// text: 'Swap',
// minWidth: 106,
// size: CpButtonSize.big,
// onPressed: () {},
// ),
// const SizedBox(width: 14),
CpButton(
text: 'Swap',
text: context.l10n.send,
minWidth: 106,
size: CpButtonSize.big,
onPressed: () {},
),
const SizedBox(width: 14),
CpButton(
text: 'Send',
minWidth: 106,
size: CpButtonSize.big,
onPressed: () {},
onPressed: () => TokenSendInputScreen.push(
context,
token: token,
),
),
],
),
Expand Down
Loading
Loading