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

chore: solana tx #5673

Merged
merged 3 commits into from
Mar 5, 2025
Merged

chore: solana tx #5673

merged 3 commits into from
Mar 5, 2025

Conversation

ganchoradkov
Copy link
Member

Description

Added custom parsing for solana_signAllTransactions

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Draft PR (breaking/non-breaking change which needs more work for having a proper functionality [Mark this PR as ready to review only when completely ready])
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How has this been tested?

tests

Checklist

  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

Additional Information (Optional)

Please include any additional information that may be useful for the reviewer.

@ganchoradkov ganchoradkov requested review from Cali93 and jakubuid March 4, 2025 08:24
@arein arein added the accepted label Mar 4, 2025
@@ -106,3 +109,35 @@ export async function isValidEip1271Signature(
function generateJsonRpcId() {
return Date.now() + Math.floor(Math.random() * 1000);
}

export function extractSolanaTransactionId(solanaTransaction: string): string {
const binary = atob(solanaTransaction);
Copy link

Choose a reason for hiding this comment

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

what's atob?

in Kotlin i'm trying to decode base64 if fails base58

Copy link
Member Author

Choose a reason for hiding this comment

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

atob decodes base64 string. I added a bit extra validation just in case to avoid handling dummy data.
For example, atob throws if the string is not valid base64 encoding, and the validation after that will filer base64 encoded non transaction values

Copy link

Choose a reason for hiding this comment

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

got it
phantom docs says that these signed transactions can be base58 encoded but our solana rpc docs say that they can be base64
i think we should add decoding for both

@ganchoradkov ganchoradkov merged commit 1b56092 into v2.0 Mar 5, 2025
10 checks passed
@ganchoradkov ganchoradkov deleted the chore/solana-tx branch March 5, 2025 08:00
@ganchoradkov ganchoradkov mentioned this pull request Mar 12, 2025
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants