cake_wallet/tool/utils/secret_key.dart
Matthew Fosse 73492ad865
Some checks failed
Cache Dependencies / test (push) Has been cancelled
update nano default node (#1408)
* update nano default node

* fix node indicator

* Update pr_test_build.yml

* Update pr_test_build.yml

* update default nano node for new wallets

* support extra args on tool script

* remove nano secrets from node.dart

---------

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
2024-07-04 22:44:08 +03:00

72 lines
2.7 KiB
Dart

import 'package:encrypt/encrypt.dart' as encrypt;
import 'package:convert/convert.dart';
class SecretKey {
const SecretKey(this.name, this.generate);
static final base = [
SecretKey('salt', () => hex.encode(encrypt.Key.fromSecureRandom(16).bytes)),
SecretKey('keychainSalt', () => hex.encode(encrypt.Key.fromSecureRandom(12).bytes)),
SecretKey('key', () => hex.encode(encrypt.Key.fromSecureRandom(16).bytes)),
SecretKey('walletSalt', () => hex.encode(encrypt.Key.fromSecureRandom(4).bytes)),
SecretKey('shortKey', () => hex.encode(encrypt.Key.fromSecureRandom(12).bytes)),
SecretKey('backupSalt', () => hex.encode(encrypt.Key.fromSecureRandom(8).bytes)),
SecretKey('backupKeychainSalt', () => hex.encode(encrypt.Key.fromSecureRandom(12).bytes)),
SecretKey('changeNowApiKey', () => ''),
SecretKey('changeNowApiKeyDesktop', () => ''),
SecretKey('wyreSecretKey', () => ''),
SecretKey('wyreApiKey', () => ''),
SecretKey('wyreAccountId', () => ''),
SecretKey('moonPayApiKey', () => ''),
SecretKey('moonPaySecretKey', () => ''),
SecretKey('sideShiftAffiliateId', () => ''),
SecretKey('simpleSwapApiKey', () => ''),
SecretKey('simpleSwapApiKeyDesktop', () => ''),
SecretKey('anypayToken', () => ''),
SecretKey('onramperApiKey', () => ''),
SecretKey('ioniaClientId', () => ''),
SecretKey('trocadorApiKey', () => ''),
SecretKey('trocadorExchangeMarkup', () => ''),
SecretKey('twitterBearerToken', () => ''),
SecretKey('anonPayReferralCode', () => ''),
SecretKey('fiatApiKey', () => ''),
SecretKey('payfuraApiKey', () => ''),
SecretKey('chatwootWebsiteToken', () => ''),
SecretKey('exolixApiKey', () => ''),
SecretKey('robinhoodApplicationId', () => ''),
SecretKey('exchangeHelperApiKey', () => ''),
SecretKey('walletConnectProjectId', () => ''),
SecretKey('moralisApiKey', () => ''),
SecretKey('ankrApiKey', () => ''),
SecretKey('quantexExchangeMarkup', () => ''),
SecretKey('testCakePayApiKey', () => ''),
SecretKey('cakePayApiKey', () => ''),
SecretKey('CSRFToken', () => ''),
SecretKey('authorization', () => ''),
];
static final coreSecrets = [];
static final evmChainsSecrets = [
SecretKey('etherScanApiKey', () => ''),
SecretKey('polygonScanApiKey', () => ''),
SecretKey('moralisApiKey', () => ''),
];
static final solanaSecrets = [
SecretKey('ankrApiKey', () => ''),
];
static final nanoSecrets = [
SecretKey('nano2ApiKey', () => ''),
SecretKey('nanoNowNodesApiKey', () => ''),
];
static final tronSecrets = [
SecretKey('tronGridApiKey', () => ''),
SecretKey('tronNowNodesApiKey', () => ''),
];
final String name;
final String Function() generate;
}