Skip to content

Commit

Permalink
fix(blockchain-link): correctly handle Solana server URL
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-pvl authored and tomasklim committed Feb 28, 2025
1 parent cbb6cdb commit 1fe9034
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
1 change: 1 addition & 0 deletions packages/blockchain-link/src/workers/solana/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,7 @@ const getAccountInfo = async (
payload.descriptor,
isTestnet,
solEpoch,
api.clusterUrl,
);
misc = {
owner: accountInfo?.owner,
Expand Down
10 changes: 1 addition & 9 deletions packages/blockchain-link/src/workers/solana/stakingAccounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { Network, Solana, isStake, stakeAccountState } from '@everstake/wallet-s

import { SolanaStakingAccount } from '@trezor/blockchain-link-types/src/solana';

import config from './../../ui/config';

const EVERSTAKE_VOTER_PUBKEYS = [
'9QU2QSxhb24FUX3Tu2FpczXjpK3VYrvRudywSZaM29mF', // mainnet
'GkqYQysEGmuL6V2AJoNnWZUz2ZBGWhzQXsJiXm2CLKAN', // devnet
Expand All @@ -13,14 +11,8 @@ export const getSolanaStakingData = async (
descriptor: string,
isTestnet: boolean,
epoch: number,
serverUrl: string,
): Promise<SolanaStakingAccount[]> => {
const blockchainEnvironment = isTestnet ? 'devnet' : 'mainnet';

// Find the blockchain configuration for the specified chain and environment
const blockchainConfig = config.find(c =>
c.blockchain.name.toLowerCase().includes(`solana ${blockchainEnvironment}`),
);
const serverUrl = blockchainConfig?.blockchain.server[0];
const network = isTestnet ? Network.Devnet : Network.Mainnet;

const solanaClient = new Solana(network, serverUrl);
Expand Down

0 comments on commit 1fe9034

Please sign in to comment.