Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions packages/gill/src/core/create-solana-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,9 @@ export function createSolanaClient<TCluster extends ModifiedClusterUrl>({
rpc,
rpcSubscriptions,
sendAndConfirmTransaction: sendAndConfirmTransactionWithSignersFactory({
// @ts-ignore - TODO(FIXME:nick)
rpc,
// @ts-ignore - TODO(FIXME:nick)
rpcSubscriptions,
rpc: rpc as any,
rpcSubscriptions: rpcSubscriptions as any,
}),
// @ts-ignore
simulateTransaction: simulateTransactionFactory({ rpc }),
simulateTransaction: simulateTransactionFactory({ rpc: rpc as any }),
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,10 @@ export function sendAndConfirmTransactionWithSignersFactory<
rpc,
rpcSubscriptions,
}: SendAndConfirmTransactionWithSignersFactoryConfig<TCluster>): SendAndConfirmTransactionWithSignersFunction {
// @ts-ignore - TODO(FIXME)
const sendAndConfirmTransaction = sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions });
const sendAndConfirmTransaction = sendAndConfirmTransactionFactory({
Copy link
Collaborator

Choose a reason for hiding this comment

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

curious on your thought process here? does this make it possible to pass a devnet rpc with mainnet subscriptions etc?

Copy link
Author

@lalitcap23 lalitcap23 Sep 17, 2025

Choose a reason for hiding this comment

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

@catmcgee you're right that this technically allows network mismatches. However, the previous code had the same issue - the @ts-ignore comments were bypassing all type checking including network validation. i will fix it and enforce that RPC and RpcSubscriptions must use the same network type . Anything else i should do .

rpc: rpc as Rpc<GetEpochInfoApi & GetSignatureStatusesApi & SendTransactionApi & GetLatestBlockhashApi>,
rpcSubscriptions: rpcSubscriptions as RpcSubscriptions<SignatureNotificationsApi & SlotNotificationsApi>,
});
return async function sendAndConfirmTransactionWithSigners(transaction, config = { commitment: "confirmed" }) {
if ("messageBytes" in transaction == false) {
if ("lifetimeConstraint" in transaction === false) {
Expand Down