change Solana node (#1903)

* change Solana node

* Fix reaching limit for fetching transactions
This commit is contained in:
Omar Hatem 2024-12-27 00:42:36 +02:00 committed by GitHub
parent 3e93a5ecb8
commit ed12ff6afe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 90 additions and 48 deletions

View file

@ -140,25 +140,24 @@ abstract class Web3WalletServiceBase with Store {
for (final cId in SolanaChainId.values) {
final node = appStore.settingsStore.getCurrentNode(appStore.wallet!.type);
Uri? rpcUri;
String webSocketUrl;
bool isModifiedNodeUri = false;
Uri rpcUri = node.uri;
String webSocketUrl = 'wss://${node.uriRaw}';
if (node.uriRaw == 'rpc.ankr.com') {
isModifiedNodeUri = true;
//A better way to handle this instead of adding this to the general secrets?
String ankrApiKey = secrets.ankrApiKey;
rpcUri = Uri.https(node.uriRaw, '/solana/$ankrApiKey');
webSocketUrl = 'wss://${node.uriRaw}/solana/ws/$ankrApiKey';
} else {
webSocketUrl = 'wss://${node.uriRaw}';
} else if (node.uriRaw == 'solana-mainnet.core.chainstack.com') {
String chainStackApiKey = secrets.chainStackApiKey;
rpcUri = Uri.https(node.uriRaw, '/$chainStackApiKey');
webSocketUrl = 'wss://${node.uriRaw}/$chainStackApiKey';
}
SolanaChainServiceImpl(
reference: cId,
rpcUrl: isModifiedNodeUri ? rpcUri! : node.uri,
rpcUrl: rpcUri,
webSocketUrl: webSocketUrl,
wcKeyService: walletKeyService,
bottomSheetService: _bottomSheetHandler,