Skip to content

Commit 93d1afb

Browse files
committed
Merge branch 'fix/solana-tokens' into vacay
2 parents a371b4b + c43b8fe commit 93d1afb

3 files changed

Lines changed: 36 additions & 13 deletions

File tree

.github/workflows/test.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ jobs:
77
steps:
88
- name: Prepare repository
99
uses: actions/checkout@v4
10+
with:
11+
fetch-depth: 0
1012
- name: Install Flutter
1113
uses: subosito/flutter-action@v2
1214
with:
@@ -94,9 +96,21 @@ jobs:
9496
NAMECOIN_TEST: ${{ secrets.NAMECOIN_TEST }}
9597
PARTICL_TEST: ${{ secrets.PARTICL_TEST }}
9698

97-
- name: Verify Dart formatting
98-
run: dart format --output=none --set-exit-if-changed .
99-
99+
- name: Check formatting of changed files
100+
run: |
101+
if [ "${{ github.event_name }}" = "pull_request" ]; then
102+
BASE=$(git merge-base ${{ github.event.pull_request.base.sha }} HEAD)
103+
else
104+
BASE=${{ github.event.before }}
105+
fi
106+
FILES=$(git diff --name-only --diff-filter=ACM "$BASE"..HEAD -- '*.dart')
107+
if [ -z "$FILES" ]; then
108+
echo "No Dart files changed."
109+
exit 0
110+
fi
111+
echo "Checking formatting of $(echo "$FILES" | wc -l) file(s):"
112+
echo "$FILES"
113+
dart format --output=none --set-exit-if-changed $FILES
100114
# - name: Analyze
101115
# run: flutter analyze
102116
- name: Test

lib/utilities/default_sol_tokens.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ abstract class DefaultSolTokens {
2020
"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/logo.png",
2121
),
2222
SolContract(
23-
address: "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenEst",
23+
address: "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB",
2424
name: "Tether",
2525
symbol: "USDT",
2626
decimals: 6,
2727
logoUri:
28-
"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenEst/logo.svg",
28+
"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB/logo.svg",
2929
),
3030
SolContract(
3131
address: "MangoCzJ36AjZyKwVj3VnYU4GTonjfVEnJmvvWaxLac",
@@ -36,20 +36,20 @@ abstract class DefaultSolTokens {
3636
"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/MangoCzJ36AjZyKwVj3VnYU4GTonjfVEnJmvvWaxLac/logo.png",
3737
),
3838
SolContract(
39-
address: "SRMuApVgqbCmmp3uVrwpad5p4stLBUq3nSoSnqQQXmk",
39+
address: "SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt",
4040
name: "Serum",
4141
symbol: "SRM",
4242
decimals: 6,
4343
logoUri:
44-
"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/SRMuApVgqbCmmp3uVrwpad5p4stLBUq3nSoSnqQQXmk/logo.png",
44+
"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt/logo.png",
4545
),
4646
SolContract(
47-
address: "orca8TvxvggsCKvVPXSHXDvKgJ3bNroWusDawg461mpD",
47+
address: "orcaEKTdK7LKz57vaAYr9QeNsVEPfiu6QeMU1kektZE",
4848
name: "Orca",
4949
symbol: "ORCA",
5050
decimals: 6,
5151
logoUri:
52-
"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/orcaEKTdK7LKz57chYcSKdBI6qrE5dS1zG4FqHWGcKc/logo.svg",
52+
"https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/orcaEKTdK7LKz57vaAYr9QeNsVEPfiu6QeMU1kektZE/logo.png",
5353
),
5454
];
5555
}

lib/wallets/wallet/impl/sub_wallets/solana_token_wallet.dart

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,8 @@ class SolanaTokenWallet extends Wallet {
510510
(e) =>
511511
e.containsKey("parsed") &&
512512
e["program"] == "spl-token" &&
513-
e["parsed"]["type"] == "transferChecked",
513+
(e["parsed"]["type"] == "transferChecked" ||
514+
e["parsed"]["type"] == "transfer"),
514515
);
515516

516517
if (splTransfers.length != 1) {
@@ -522,9 +523,17 @@ class SolanaTokenWallet extends Wallet {
522523
continue;
523524
}
524525
final transfer = splTransfers.first;
525-
final lamports = BigInt.parse(
526-
transfer["parsed"]["info"]["tokenAmount"]["amount"].toString(),
527-
);
526+
final transferType = transfer["parsed"]["type"] as String;
527+
final BigInt lamports;
528+
if (transferType == "transferChecked") {
529+
lamports = BigInt.parse(
530+
transfer["parsed"]["info"]["tokenAmount"]["amount"].toString(),
531+
);
532+
} else {
533+
lamports = BigInt.parse(
534+
transfer["parsed"]["info"]["amount"].toString(),
535+
);
536+
}
528537
final senderAddress = transfer["parsed"]["info"]["source"] as String;
529538
final receiverAddress =
530539
transfer["parsed"]["info"]["destination"] as String;

0 commit comments

Comments
 (0)