Skip to content
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/solana tokens support #2

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from
Open

Conversation

mikhd
Copy link
Collaborator

@mikhd mikhd commented Dec 20, 2023

📝 Description

  • Finalized integration with SPL tokens on Solana.

Details:

  • Updated sub accounts sychronisation [coin-solana solana]
  • Added BURN operation type [LLD, libs/coin-framework, libs/ledgerjs/packages/types-live]
  • Added account sub header for displaying alert message for frozen tokens [LLD, LLM]
  • Disable staking modal for solana tokens [LLD]
  • Added additinal warning messages [LLM, LLD]
  • Fixed tx fee of token account (it should be in SOL) [LLM]
  • Implement functions (assignFromTokenAccountRaw, assignToTokenAccountRaw) for serialization of TokenAccount custom fields (like token "frozen" state) [libs/coin-framework, libs/ledgerjs/packages/types-live]
  • Enabled existing tokens integration tests and added additional few in bridge.integration.test.ts [coin-solana solana]
  • Added speculos tests for tokens [coin-solana solana]
  • Updated bridge.integration.test.ts snapshot [LLC solana]

Screenshots


❓ Context

  • JIRA or GitHub link:

✅ Checklist

Pull Requests must pass the CI and be code reviewed. Set as Draft if the PR is not ready.

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    • Solana accounts in LLD, LLM. Send tokens, receive tokens, view tokens

🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.
  • Performance considerations have been taken into account. (changes have been profiled or benchmarked if necessary)

@mikhd mikhd self-assigned this Dec 20, 2023
@mikhd mikhd changed the title Feat/solana tokens support Feat/solana tokens support [WIP] Dec 20, 2023
@mikhd mikhd force-pushed the feat/solana-tokens-support branch 4 times, most recently from 8297904 to e7745ec Compare December 25, 2023 05:47
@mikhd mikhd force-pushed the feat/solana-tokens-support branch 5 times, most recently from 9b341e3 to 704a865 Compare January 15, 2024 06:13
@mikhd mikhd force-pushed the feat/solana-tokens-support branch 2 times, most recently from 5ffead8 to 9fc214b Compare February 15, 2024 07:13
@mikhd mikhd force-pushed the feat/solana-tokens-support branch 2 times, most recently from 3e15b12 to 3459cf3 Compare March 1, 2024 08:12
mikhd pushed a commit that referenced this pull request Mar 8, 2024
@mikhd mikhd force-pushed the feat/solana-tokens-support branch from 3459cf3 to 5caaea2 Compare March 8, 2024 09:23
@mikhd mikhd force-pushed the feat/solana-tokens-support branch from ad08d82 to ef984ca Compare March 18, 2024 11:08
@mikhd mikhd force-pushed the feat/solana-tokens-support branch from ef984ca to f812724 Compare April 5, 2024 07:39
@mikhd mikhd force-pushed the feat/solana-tokens-support branch from ddf9cef to 9a1fd9b Compare April 15, 2024 07:17
@mikhd mikhd force-pushed the feat/solana-tokens-support branch from 9a1fd9b to 64987a5 Compare April 22, 2024 07:23
@mikhd mikhd force-pushed the feat/solana-tokens-support branch 3 times, most recently from dd8f788 to 5c7a563 Compare May 7, 2024 09:16
@mikhd mikhd force-pushed the feat/solana-tokens-support branch from 5c7a563 to 2fa49b3 Compare May 13, 2024 08:55
@mikhd mikhd force-pushed the feat/solana-tokens-support branch 3 times, most recently from dc8da6b to d9be258 Compare May 27, 2024 08:24
@mikhd mikhd force-pushed the feat/solana-tokens-support branch 2 times, most recently from 9c75693 to 7a7c62c Compare July 16, 2024 08:51
@mikhd mikhd force-pushed the feat/solana-tokens-support branch 2 times, most recently from e6d8ec3 to 547e3b5 Compare July 29, 2024 10:48
@mikhd mikhd force-pushed the feat/solana-tokens-support branch 2 times, most recently from 6370e50 to ddf7890 Compare August 8, 2024 10:47
mikhd pushed a commit that referenced this pull request Aug 20, 2024
mikhd pushed a commit that referenced this pull request Aug 20, 2024
mikhd pushed a commit that referenced this pull request Aug 20, 2024
@mikhd mikhd force-pushed the feat/solana-tokens-support branch from ddf7890 to 1a5d64f Compare August 20, 2024 07:40
@mikhd mikhd force-pushed the feat/solana-tokens-support branch from 6dbc379 to 67ffbd3 Compare August 28, 2024 12:57
mikhd pushed a commit that referenced this pull request Sep 10, 2024
* add svgs

* changeset

* rename tokens svg

* rename to proper id

* fix SD svg icon

* fix SD svg icon #2

* proper svg
@mikhd mikhd force-pushed the feat/solana-tokens-support branch from 1d15700 to fc1bea1 Compare October 1, 2024 11:36
@mikhd mikhd force-pushed the feat/solana-tokens-support branch from fc1bea1 to abded20 Compare October 7, 2024 08:49
@@ -4,6 +4,7 @@ export const supportLinkByTokenType = {
trc20: "https://support.ledger.com/article/360013062159-zd",
asa: "https://support.ledger.com/article/360015896040-zd",
nfts: "https://support.ledger.com/article/4404389453841-zd",
// spl: "Solana spl tokens. TODO: to be defined",

Choose a reason for hiding this comment

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

missing support article link

@@ -153,6 +154,7 @@ export const urls = {
},
solana: {
staking: "https://support.ledger.com/article/4731749170461-zd",
splTokenInfo: "Solana spl tokens link TODO: to be defined",

Choose a reason for hiding this comment

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

same

export default function SolanaAccountSubHeader({ account }: Props) {
return (
<>
{isTokenAccountFrozen(account) && (

Choose a reason for hiding this comment

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

To check if it's the right position we want

@@ -129,11 +130,21 @@ export function fromAccountRaw(rawAccount: AccountRaw, fromRaw?: FromFamiliyRaw)
fromRaw.assignFromAccountRaw(rawAccount, res);
}

if (fromRaw?.assignFromTokenAccountRaw && res.subAccounts) {

Choose a reason for hiding this comment

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

We have to test migration of a previous account

* @param {TokenAccount} tokenAccount - The original token account object.
* @param {TokenAccountRaw} tokenAccountRaw - The token account in its serialized form.
*/
assignToTokenAccountRaw?: (tokenAccount: TokenAccount, tokenAccountRaw: TokenAccountRaw) => void;

Choose a reason for hiding this comment

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

This may not be useful, we don't have to do this with other token supporting integrations

@@ -54,6 +55,8 @@ addTokens(vechainTokens.map(convertVechainToken));
addTokens(jettonTokens.map(convertJettonToken));
// Filecoin tokens
addTokens(filecoinTokens.map(convertERC20));
// Solana tokens
addTokens(spltokens.map(convertSplTokens));

Choose a reason for hiding this comment

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

We may need to implement token importer

@mikhd
Copy link
Collaborator Author

mikhd commented Oct 21, 2024

@hedi-edelbloute Hi Hedi
How are you?
Just got back from vacation. Do you need any input or actions from my side in current PR?

I see there is another PR into LL repository was created.

@hedi-edelbloute
Copy link

Hello @mikhd ! I'm fine and hope it's the same for you 😄

Quentin is working to finish SPL token and pulled most of your work, was the PR complete on your side ?

Priority fees PR introduced an issue on the Swap specifically, so we reverted. Quentin pulled priority fees work again, and is also trying to fix the swap issue, as fees seem to be too low without it for spl tokens

We can discuss this in more details on discord

@mikhd
Copy link
Collaborator Author

mikhd commented Oct 21, 2024

Hello @mikhd ! I'm fine and hope it's the same for you 😄

Quentin is working to finish SPL token and pulled most of your work, was the PR complete on your side ?

Priority fees PR introduced an issue on the Swap specifically, so we reverted. Quentin pulled priority fees work again, and is also trying to fix the swap issue, as fees seem to be too low without it for spl tokens

We can discuss this in more details on discord

Please let me know in discord if any help is required

This PR had few remaining things to be completed

  • Links to the articles (Livio mentioned that they will be provided later)
  • To display custom fields of Solana tokens (e.g frozen state or Token2022 extensions info) I had to add similar to assignFromAccountRaw, assignToAccountRaw functionalities for SubAccounts. Hope it's ok

Sign up for free to 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.

2 participants