Skip to content

poc: solana#252

Open
chrstph-dvx wants to merge 11 commits into
solana/02-hooksfrom
solana/poc
Open

poc: solana#252
chrstph-dvx wants to merge 11 commits into
solana/02-hooksfrom
solana/poc

Conversation

@chrstph-dvx

@chrstph-dvx chrstph-dvx commented Apr 2, 2026

Copy link
Copy Markdown
Contributor
Depends on #251. This PR is part of a stack created with Aviator.

Summary

Steps to test

@vercel

vercel Bot commented Apr 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
arbitrum-portal Ready Ready Preview Jun 22, 2026 9:38am

Request Review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Example of what using providers + context allow us. We can test the TransferPanel with connected state, display of balance, execution, etc...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We get fetchers from Solana/EVM context and return fetcher based on the chainId

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We get signer from Solana/EVM context and return both signer (source and destination).
This allow us to claim without switching networks.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Context with balance fetching (EVM)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Context with balance fetching (Solana)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Context with signer (EVM)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Context with signer (Solana)

DisabledFeatures.TRANSFERS_TO_NON_ARBITRUM_CHAINS,
);

const shouldDisableConnectedChainSync = isSolanaEnabled();

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.

How is this going to work once the feature is shipped? Is it gonna break existing behavior for EVM chains?

Comment on lines +31 to +32
const provider = new providers.Web3Provider(walletProvider);
const signer = provider.getSigner();

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.

Ideally we'd use useSendTransaction from Wagmi

};

export class SolanaTransferStarter {
public async transfer({

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.

Ideally we'd eventually refactor the TransferStarter objects to just prepare transaction requests, and handle signing outside. So maybe some of the code that is currently in packages/arb-token-bridge-ui/src/wallet/providers/SolanaSignerProvider.tsx is moved here?

Comment on lines +340 to +359
try {
const { transactionRequest } = await getStepTransaction(selectedRoute.protocolData.step);

if (sourceWallet.account.chain?.id !== sourceChainId) {
await switchChain(wagmiConfig, { chainId: sourceChainId });
}

const transferStarter =
sourceWallet.ecosystem === 'solana' ? SolanaTransferStarter : LifiTransferStarter;
const preparedTransaction = transferStarter.prepareTransaction(transactionRequest);
const result = await sourceWallet.sendTransaction(preparedTransaction);

setTransactionHash(result.hash);
await result.wait?.();
} catch (error) {
setExecutionError(getErrorMessage(error));
} finally {
setIsExecuting(false);
}
};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ideally, we would create a BridgeTransferStarterFactory and it would return the correct transferStarter. Then sendTransaction take the prepared transaction, whether it's solana or evm

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