cake_wallet/tool/utils/secret_key.dart
Serhii 02f53055b1
Cw 657 new buy sell flow (#1553)
* init commit

* onramper

* moonPay

* dfx provider

* meld

* dfx payment methods

* fiat buy credentials

* moonpay payment method

* payment loading state

* dfx sell quote

* onramper launch trade

* meld launch trade

* country picker

* update option tile

* buy/sell action

* meld refactor

* update pr_test_build.yml

* ui fixes

* revert country picker commit

* update the ui

* recommended providers

* payment method [skip ci]

* provider option tile

* remove buy action

* minor fixes

* update the best rate when the amount is changed

* fixes for currency title

* fix icons

* code refactoring

* null issue

* code review fixes

* Update pr_test_build_linux.yml

* Update meld_buy_provider.dart

* Update meld_buy_provider.dart

* add show wallets action

* remove default sell / buy provider setting

* localisation

* providerTypes

* icons

* remove duplicate file [skip ci]

* minor changes [skip ci]

* fixes from review

* disable dfx for non eur/chf currencies
fix providers to be fetched with the selected currency

* fix breaking from loop if one element failed

* fix minor naming issue from merging conflicts

* add fiat check for moonpay

* fix address validation

* merge conflict

* fix destination and source currency

* minor fix

* minor fix

* update the flow

* fix bch address format

* fix wallet addresses

* fix initial fetching amount.

* Update address_validator.dart

* review comments

* revert switch case to return null

* minor fix

---------

Co-authored-by: OmarHatem <omarh.ismail1@gmail.com>
2024-11-09 21:00:56 +02:00

102 lines
4.3 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('seeds', () => ''),
SecretKey('testCakePayApiKey', () => ''),
SecretKey('cakePayApiKey', () => ''),
SecretKey('CSRFToken', () => ''),
SecretKey('authorization', () => ''),
SecretKey('meldTestApiKey', () => ''),
SecretKey('meldTestPublicKey', () => ''),
SecretKey('moneroTestWalletSeeds', () => ''),
SecretKey('moneroLegacyTestWalletSeeds ', () => ''),
SecretKey('bitcoinTestWalletSeeds', () => ''),
SecretKey('ethereumTestWalletSeeds', () => ''),
SecretKey('litecoinTestWalletSeeds', () => ''),
SecretKey('bitcoinCashTestWalletSeeds', () => ''),
SecretKey('polygonTestWalletSeeds', () => ''),
SecretKey('solanaTestWalletSeeds', () => ''),
SecretKey('polygonTestWalletSeeds', () => ''),
SecretKey('tronTestWalletSeeds', () => ''),
SecretKey('nanoTestWalletSeeds', () => ''),
SecretKey('wowneroTestWalletSeeds', () => ''),
SecretKey('moneroTestWalletReceiveAddress', () => ''),
SecretKey('bitcoinTestWalletReceiveAddress', () => ''),
SecretKey('ethereumTestWalletReceiveAddress', () => ''),
SecretKey('litecoinTestWalletReceiveAddress', () => ''),
SecretKey('bitco inCashTestWalletReceiveAddress', () => ''),
SecretKey('polygonTestWalletReceiveAddress', () => ''),
SecretKey('solanaTestWalletReceiveAddress', () => ''),
SecretKey('tronTestWalletReceiveAddress', () => ''),
SecretKey('nanoTestWalletReceiveAddress', () => ''),
SecretKey('wowneroTestWalletReceiveAddress', () => ''),
SecretKey('etherScanApiKey', () => ''),
SecretKey('polygonScanApiKey', () => ''),
SecretKey('letsExchangeBearerToken', () => ''),
SecretKey('letsExchangeAffiliateId', () => ''),
SecretKey('stealthExBearerToken', () => ''),
SecretKey('stealthExAdditionalFeePercent', () => ''),
SecretKey('moneroTestWalletBlockHeight', () => ''),
];
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;
}