mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
* feat: Integrate Jupiter DEX * feat: Enable internal swaps * feat: implement Jupiter swap execution api and enhance trade handling - Added executeSwap method to handle signed swap transactions via the execute endpoint. - Updated signAndPrepareJupiterSwapTransaction to include request ID and handle swap execution response. - Modified trade details to use txId instead of id for Jupiter trades. - Enhanced error handling for swap execution with user-friendly messages. - Updated sendviewmodel to manage trade state updates after transaction commitment. * fix: null error after successfully swapping * fix: Finallyyy fixed the annoying tx history issue for solana dex swaps * fix: update inputAddress to use toAddress in JupiterExchangeProvider * feat: enhance transaction handling and token balance updates - Cut down tx fetch/update time for transactions update after swapping - Added TransactionFetchResult class to hold parsed transactions and token mints. - Added pollForTransaction method to handle transaction polling with exponential backoff. - Conditionally hide the external send button based on provider type. * feat: add fees to trade object and handle null case * feat: add Jupiter referral fee and account configuration --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
124 lines
5.4 KiB
Dart
124 lines
5.4 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('changeNowCakeWalletApiKey', () => ''),
|
|
SecretKey('changeNowMoneroApiKey', () => ''),
|
|
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('trocadorMoneroApiKey', () => ''),
|
|
SecretKey('trocadorExchangeMarkup', () => ''),
|
|
SecretKey('twitterBearerToken', () => ''),
|
|
SecretKey('anonPayReferralCode', () => ''),
|
|
SecretKey('fiatApiKey', () => ''),
|
|
SecretKey('chatwootWebsiteToken', () => ''),
|
|
SecretKey('exolixCakeWalletApiKey', () => ''),
|
|
SecretKey('exolixMoneroApiKey', () => ''),
|
|
SecretKey('robinhoodApplicationId', () => ''),
|
|
SecretKey('exchangeHelperApiKey', () => ''),
|
|
SecretKey('walletConnectProjectId', () => ''),
|
|
SecretKey('moralisApiKey', () => ''),
|
|
SecretKey('ankrApiKey', () => ''),
|
|
SecretKey('chainStackApiKey', () => ''),
|
|
SecretKey('swapTradeExchangeMarkup', () => ''),
|
|
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('baseTestWalletSeeds', () => ''),
|
|
SecretKey('arbitrumTestWalletSeeds', () => ''),
|
|
SecretKey('solanaTestWalletSeeds', () => ''),
|
|
SecretKey('tronTestWalletSeeds', () => ''),
|
|
SecretKey('nanoTestWalletSeeds', () => ''),
|
|
SecretKey('wowneroTestWalletSeeds', () => ''),
|
|
SecretKey('moneroTestWalletReceiveAddress', () => ''),
|
|
SecretKey('bitcoinTestWalletReceiveAddress', () => ''),
|
|
SecretKey('ethereumTestWalletReceiveAddress', () => ''),
|
|
SecretKey('litecoinTestWalletReceiveAddress', () => ''),
|
|
SecretKey('bitcoinCashTestWalletReceiveAddress', () => ''),
|
|
SecretKey('polygonTestWalletReceiveAddress', () => ''),
|
|
SecretKey('baseTestWalletReceiveAddress', () => ''),
|
|
SecretKey('arbitrumTestWalletReceiveAddress', () => ''),
|
|
SecretKey('solanaTestWalletReceiveAddress', () => ''),
|
|
SecretKey('tronTestWalletReceiveAddress', () => ''),
|
|
SecretKey('nanoTestWalletReceiveAddress', () => ''),
|
|
SecretKey('wowneroTestWalletReceiveAddress', () => ''),
|
|
SecretKey('etherScanApiKey', () => ''),
|
|
SecretKey('polygonScanApiKey', () => ''),
|
|
SecretKey('letsExchangeBearerToken', () => ''),
|
|
SecretKey('letsExchangeAffiliateId', () => ''),
|
|
SecretKey('stealthExBearerToken', () => ''),
|
|
SecretKey('stealthExAdditionalFeePercent', () => ''),
|
|
SecretKey('moneroTestWalletBlockHeight', () => ''),
|
|
SecretKey('chainflipApiKey', () => ''),
|
|
SecretKey('chainflipAffiliateFee', () => ''),
|
|
SecretKey('kryptonimApiKey', () => ''),
|
|
SecretKey('walletGroupSalt', () => hex.encode(encrypt.Key.fromSecureRandom(16).bytes)),
|
|
SecretKey('swapsXyzApiKey', () => ''),
|
|
SecretKey('jupiterApiKey', () => ''),
|
|
SecretKey('jupiterReferralFeeBps', () => ''),
|
|
SecretKey('jupiterReferralAccount', () => ''),
|
|
SecretKey('nearIntentsBearerToken', () => ''),
|
|
SecretKey('nearIntentsAppFee', () => ''),
|
|
SecretKey('nearIntentsAppFeeRecipient', () => ''),
|
|
];
|
|
|
|
static final evmChainsSecrets = [
|
|
SecretKey('etherScanApiKey', () => ''),
|
|
SecretKey('polygonScanApiKey', () => ''),
|
|
SecretKey('moralisApiKey', () => ''),
|
|
SecretKey('nowNodesApiKey ', () => ''),
|
|
SecretKey('blinkApiKey', () => ''),
|
|
];
|
|
|
|
static final solanaSecrets = [
|
|
SecretKey('ankrApiKey', () => ''),
|
|
SecretKey('nowNodesApiKey', () => ''),
|
|
SecretKey('chainStackApiKey', () => ''),
|
|
SecretKey('moralisApiKey', () => ''),
|
|
];
|
|
|
|
static final nanoSecrets = [
|
|
SecretKey('nano2ApiKey', () => ''),
|
|
SecretKey('nanoNowNodesApiKey', () => ''),
|
|
];
|
|
|
|
static final tronSecrets = [
|
|
SecretKey('tronGridApiKey', () => ''),
|
|
SecretKey('tronNowNodesApiKey', () => ''),
|
|
];
|
|
|
|
final String name;
|
|
final String Function() generate;
|
|
}
|