Skip to content

add solana - #816

Merged
sneurlax merged 1 commit into
cypherstack:solanafrom
detherminal:staging
Mar 21, 2024
Merged

add solana#816
sneurlax merged 1 commit into
cypherstack:solanafrom
detherminal:staging

Conversation

@detherminal

@detherminaldetherminal commented Mar 20, 2024

Copy link
Copy Markdown
Contributor

Added Solana with all functionalities:

  • mnemonic generation/restoration
  • address derivation
  • balance control
  • transaction control
  • transfering
  • rent exemption of Solana
  • price fetching
    etc. etc.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 0% with 25 lines in your changes are missing coverage. Please review.

Project coverage is 41.20%. Comparing base (414803d) to head (05d0889).
Report is 68 commits behind head on staging.

FilesPatch %Lines
lib/utilities/enums/coin_enum.dart0.00%11 Missing ⚠️
lib/utilities/constants.dart0.00%7 Missing ⚠️
lib/themes/color_theme.dart0.00%3 Missing ⚠️
lib/themes/stack_colors.dart0.00%2 Missing ⚠️
...ib/models/isar/models/blockchain_data/address.dart0.00%1 Missing ⚠️
lib/utilities/amount/amount_unit.dart0.00%1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@ Coverage Diff @@## staging #816 +/- ##
============================================
+ Coverage 5.83% 41.20% +35.36% 
============================================
Files 741 54 -687 Lines 70283 4638 -65645 ============================================
- Hits 4100 1911 -2189 + Misses 66183 2727 -63456 

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


@override
bool validateAddress(String address) {
RegExp regex = RegExp(r'^[a-zA-Z0-9]{44}$');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO better validation

Comment threadlib/wallets/wallet/impl/solana_wallet.dart
Comment threadlib/wallets/wallet/impl/solana_wallet.dart
Comment threadlib/wallets/wallet/impl/solana_wallet.dart
// Rent exemption of Solana
final accInfo = await rpcClient.getAccountInfo((await _getKeyPair()).address);
final minimumRent = await rpcClient.getMinimumBalanceForRentExemption(accInfo.value!.data.toString().length);
var spendableBalance = balance.value - minimumRent;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we want to send more than the minimum rent out of the wallet?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The account have to be closed to fully send all funds.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we actually do that?

@sneurlaxsneurlax left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me although I still need to review if Tor usage works with the RpcClient as used here

@sneurlax
sneurlax changed the base branch from staging to solanaMarch 21, 2024 17:47
@sneurlax
sneurlax merged commit 1fd3e87 into cypherstack:solanaMar 21, 2024
@sneurlax

Copy link
Copy Markdown
Member

@detherminal I merged your changes to the solana branch, where I will hide Solana behind a toggle in the developer menu so we can test it more thoroughly. To access the developer menu, click the Stack Wallet logo 7 times (it should spin when clicked)

The notes here on this PR should be followed up on but we might convert them to issues and leave them to be upon improved later

@sneurlaxsneurlax mentioned this pull request Mar 21, 2024
4 tasks
@sneurlaxsneurlax mentioned this pull request Apr 19, 2024
5 tasks
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@detherminal@codecov-commenter@sneurlax