Skip to content

Conversation

@rafinskipg
Copy link
Collaborator

WIP as we will need an RPC package

Limitation Identified

VersionedTransactions with Address Lookup Tables (ALTs) require RPC calls to resolve account keys. Currently, when parsing transactions that use ALTs, we get the error: "Failed to get account keys because address table lookups were not resolved".

Proposed Solution

Create a new @phantom/rpc package that:

  • Provides internal Phantom RPC access for account resolution
  • Handles Address Lookup Table resolution for VersionedTransactions
  • Offers utility methods like resolveAddressLookupTables(transaction, rpc)
  • Integrates with SwapperSDK for complete transaction parsing

Integration Plan

// Future SwapperSDK enhancement
import { resolveTransactionAccounts } from '@phantom/rpc'

export async function getSolanaTransactionFromQuote(
quote: SwapperSolanaQuoteRepresentation,
rpcEndpoint?: string
): Promise<VersionedTransaction[]> {
const transactions = parseTransactionStrings(quote.transactionData)

// Resolve ALTs using internal Phantom RPC
return await Promise.all(
transactions.map(tx => resolveTransactionAccounts(tx, rpcEndpoint))
)
}

Dependencies

  • SwapperSDK → RPC package → Internal Phantom RPC endpoints
  • Enables full transaction resolution and execution for complex swaps

@rafinskipg rafinskipg requested a review from a team as a code owner August 10, 2025 06:48
@rafinskipg rafinskipg changed the base branch from main to swapper-sdk August 10, 2025 06:48
@rafinskipg rafinskipg marked this pull request as draft August 10, 2025 06:48
@rafinskipg rafinskipg changed the title feat; Swapper sdk demo feat: Swapper sdk demo Aug 10, 2025
@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​types/​react-dom@​18.3.71001007490100
Added@​types/​react@​18.3.231001007792100
Addedvite@​5.4.19951008199100
Addedeslint-plugin-react-refresh@​0.4.201001009983100
Addedeventsource@​2.0.21001009885100
Addedreact-dom@​18.3.11001009197100

View full report

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.

3 participants