mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-01 12:04:21 +01:00
CW-1368: Add Binance Smart Chain (#2836)
* feat: Add Binance Smart Chain support to wallet types and EVM chain registry * feat: Add BSC node list and support in wallet type and chain ID mappings * feat: Add BSC default tokens and update evm utility functions * feat: Integrate BSC support in node settings and management * feat: Add BSC support to config scripts and wallet type generation * feat: Add BSC support to EVM chain ID and switcher * feat: Extend BSC support in wallet utilities and chain type checks * feat: Add BSC support to different wallet functions * feat: Add BSCURI class and implement for uri handling * feat: Update Android and iOS configurations to support BSC URL schemes * feat: Add BSC support to different functionalities and settings * refactor: Update wallet type name from'Binance Smart Chain' to BNB Smart Chain * feat: Add switcher icon and updates token utils * Review fixes * More changes to BSC name, wallet listing and images * Add more default tokens
This commit is contained in:
+14
-10
@@ -34,8 +34,9 @@ Future<void> main(List<String> args) async {
|
||||
final hasDogecoin = args.contains('${prefix}dogecoin');
|
||||
final hasBase = args.contains('${prefix}base');
|
||||
final hasArbitrum = args.contains('${prefix}arbitrum');
|
||||
final hasBsc = args.contains('${prefix}bsc');
|
||||
final hasZcash = args.contains('${prefix}zcash');
|
||||
final hasEVM = hasEthereum || hasPolygon || hasBase || hasArbitrum;
|
||||
final hasEVM = hasEthereum || hasPolygon || hasBase || hasArbitrum || hasBsc;
|
||||
final excludeFlutterSecureStorage = args.contains('${prefix}excludeFlutterSecureStorage');
|
||||
|
||||
await generateBitcoin(hasBitcoin);
|
||||
@@ -69,6 +70,7 @@ Future<void> main(List<String> args) async {
|
||||
hasDogecoin: hasDogecoin,
|
||||
hasBase: hasBase,
|
||||
hasArbitrum: hasArbitrum,
|
||||
hasBsc: hasBsc,
|
||||
hasZcash: hasZcash,
|
||||
);
|
||||
await generateWalletTypes(
|
||||
@@ -87,6 +89,7 @@ Future<void> main(List<String> args) async {
|
||||
hasDogecoin: hasDogecoin,
|
||||
hasBase: hasBase,
|
||||
hasArbitrum: hasArbitrum,
|
||||
hasBsc: hasBsc,
|
||||
hasZcash: hasZcash,
|
||||
);
|
||||
await injectSecureStorage(!excludeFlutterSecureStorage);
|
||||
@@ -740,15 +743,12 @@ abstract class BitcoinCash {
|
||||
""";
|
||||
|
||||
const bitcoinCashEmptyDefinition = 'BitcoinCash? bitcoinCash;\n';
|
||||
const bitcoinCashCWDefinition =
|
||||
'BitcoinCash? bitcoinCash = CWBitcoinCash();\n';
|
||||
const bitcoinCashCWDefinition = 'BitcoinCash? bitcoinCash = CWBitcoinCash();\n';
|
||||
|
||||
final output = '$bitcoinCashCommonHeaders\n' +
|
||||
(hasImplementation ? '$bitcoinCashCWHeaders\n' : '\n') +
|
||||
(hasImplementation ? '$bitcoinCashCwPart\n\n' : '\n') +
|
||||
(hasImplementation
|
||||
? bitcoinCashCWDefinition
|
||||
: bitcoinCashEmptyDefinition) +
|
||||
(hasImplementation ? bitcoinCashCWDefinition : bitcoinCashEmptyDefinition) +
|
||||
'\n' +
|
||||
bitcoinCashContent;
|
||||
|
||||
@@ -883,8 +883,7 @@ abstract class NanoUtil {
|
||||
""";
|
||||
|
||||
const nanoEmptyDefinition = 'Nano? nano;\nNanoUtil? nanoUtil;\n';
|
||||
const nanoCWDefinition =
|
||||
'Nano? nano = CWNano();\nNanoUtil? nanoUtil = CWNanoUtil();\n';
|
||||
const nanoCWDefinition = 'Nano? nano = CWNano();\nNanoUtil? nanoUtil = CWNanoUtil();\n';
|
||||
|
||||
final output = '$nanoCommonHeaders\n' +
|
||||
(hasImplementation ? '$nanoCWHeaders\n' : '\n') +
|
||||
@@ -1674,6 +1673,7 @@ Future<void> generatePubspec({
|
||||
required bool hasDogecoin,
|
||||
required bool hasBase,
|
||||
required bool hasArbitrum,
|
||||
required bool hasBsc,
|
||||
required bool hasZcash,
|
||||
}) async {
|
||||
const cwCore = """
|
||||
@@ -1745,8 +1745,7 @@ Future<void> generatePubspec({
|
||||
final inputLines = inputText.split('\n');
|
||||
final dependenciesIndex = inputLines.indexWhere((line) => Platform.isWindows
|
||||
// On Windows it could contains `\r` (Carriage Return). It could be fixed in newer dart versions.
|
||||
? line.toLowerCase() == 'dependencies:\r' ||
|
||||
line.toLowerCase() == 'dependencies:'
|
||||
? line.toLowerCase() == 'dependencies:\r' || line.toLowerCase() == 'dependencies:'
|
||||
: line.toLowerCase() == 'dependencies:');
|
||||
var output = cwCore;
|
||||
|
||||
@@ -1834,6 +1833,7 @@ Future<void> generateWalletTypes({
|
||||
required bool hasDogecoin,
|
||||
required bool hasBase,
|
||||
required bool hasArbitrum,
|
||||
required bool hasBsc,
|
||||
required bool hasZcash,
|
||||
}) async {
|
||||
final walletTypesFile = File(walletTypesPath);
|
||||
@@ -1858,6 +1858,10 @@ Future<void> generateWalletTypes({
|
||||
outputContent += '\tWalletType.ethereum,\n';
|
||||
}
|
||||
|
||||
if (hasBsc) {
|
||||
outputContent += '\tWalletType.bsc,\n';
|
||||
}
|
||||
|
||||
if (hasSolana) {
|
||||
outputContent += '\tWalletType.solana,\n';
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ class SecretKey {
|
||||
SecretKey('polygonTestWalletSeeds', () => ''),
|
||||
SecretKey('baseTestWalletSeeds', () => ''),
|
||||
SecretKey('arbitrumTestWalletSeeds', () => ''),
|
||||
SecretKey('bscTestWalletSeeds', () => ''),
|
||||
SecretKey('solanaTestWalletSeeds', () => ''),
|
||||
SecretKey('tronTestWalletSeeds', () => ''),
|
||||
SecretKey('nanoTestWalletSeeds', () => ''),
|
||||
@@ -69,6 +70,7 @@ class SecretKey {
|
||||
SecretKey('polygonTestWalletReceiveAddress', () => ''),
|
||||
SecretKey('baseTestWalletReceiveAddress', () => ''),
|
||||
SecretKey('arbitrumTestWalletReceiveAddress', () => ''),
|
||||
SecretKey('bscTestWalletReceiveAddress', () => ''),
|
||||
SecretKey('solanaTestWalletReceiveAddress', () => ''),
|
||||
SecretKey('tronTestWalletReceiveAddress', () => ''),
|
||||
SecretKey('nanoTestWalletReceiveAddress', () => ''),
|
||||
|
||||
Reference in New Issue
Block a user