mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 20:39:51 +00:00
change Solana node (#1903)
* change Solana node * Fix reaching limit for fetching transactions
This commit is contained in:
parent
3e93a5ecb8
commit
ed12ff6afe
13 changed files with 90 additions and 48 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue