-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(frontend): add sol api for balance #4032
Conversation
* RPC URLs | ||
*/ | ||
export const SOLANA_RPC_HTTP_URL_MAINNET = `https://solana-mainnet.g.alchemy.com/v2/${import.meta.env.VITE_ALCHEMY_API_KEY}`; | ||
export const SOLANA_RPC_HTTP_URL_TESTNET = 'https://api.testnet.solana.com'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is no testnet url in the alchemy dashboard
…alance' into feat(frontend)/add-sol-api-for-balance
please review #4033 first |
…l-api-for-balance # Conflicts: # src/frontend/src/sol/types/network.ts
network: SolanaNetworkType; | ||
}): Promise<bigint> => { | ||
assertNonNullish(address); | ||
assertNonNullish(network); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the function params are not optional, I don't think we need these asserts.
If address
and/or network
can be nullish, then we can keep the respective asserts but we need to update the function types accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks
Note
please review #4033 first
Motivation
To abstract the fetching of solana related data we introduce the solana.api.ts. Similar to how bitcoin.api.ts.
Note that this endpoint from solana only returns the sol balance in the wallet.
https://solana.com/docs/rpc/http/getbalance
Changes
Tests
Unit tests provided