
Research
TeamPCP Compromises Telnyx Python SDK to Deliver Credential-Stealing Malware
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.
@solana/plugin-interfaces
Advanced tools
This package defines common TypeScript interfaces for features that Kit plugins can provide or require. It can be used standalone, but it is also exported as part of Kit @solana/kit.
When building Solana applications, different environments require different capabilities. A browser wallet might support signing but not RPC calls. A testing environment might support airdrops. A full client might support everything.
These interfaces serve two purposes:
ClientWithAirdrop).ClientWithRpc to fetch account data).This enables a composable plugin architecture where plugins can build on top of each other's capabilities.
npm install @solana/plugin-interfaces
ClientWithPayerRepresents a client that provides a default transaction payer.
import { ClientWithPayer } from '@solana/plugin-interfaces';
function memoPlugin() {
return <T extends ClientWithPayer>(client: T) => ({
...client,
sendMemo: (message: string) => {
// Use client.payer as the fee payer for the memo transaction
const feePayer = client.payer;
// ...
},
});
}
ClientWithAirdropRepresents a client that can request SOL airdrops (typically on devnet/testnet). The airdrop succeeds when the promise resolves. Some implementations (e.g., LiteSVM) update balances directly without a transaction, so no signature is returned in those cases.
import { ClientWithAirdrop, ClientWithPayer } from '@solana/plugin-interfaces';
function faucetPlugin() {
return <T extends ClientWithAirdrop & ClientWithPayer>(client: T) => ({
...client,
fundMyself: async (amount: Lamports) => {
await client.airdrop(client.payer.address, amount);
},
});
}
ClientWithRpc<TRpcMethods>Represents a client with access to a Solana RPC endpoint.
import { ClientWithRpc } from '@solana/plugin-interfaces';
import { GetBalanceApi } from '@solana/rpc-api';
function balancePlugin() {
return <T extends ClientWithRpc<GetBalanceApi>>(client: T) => ({
...client,
getBalance: async (address: Address): Promise<Lamports> => {
const { value } = await client.rpc.getBalance(address).send();
return value;
},
});
}
ClientWithRpcSubscriptions<TRpcSubscriptionsMethods>Represents a client that provides access to Solana RPC subscriptions for real-time notifications such as account changes, slot updates, and transaction confirmations.
import { ClientWithRpcSubscriptions } from '@solana/plugin-interfaces';
import { AccountNotificationsApi } from '@solana/rpc-subscriptions-api';
function accountWatcherPlugin() {
return <T extends ClientWithRpcSubscriptions<AccountNotificationsApi>>(client: T) => ({
...client,
onAccountChange: async (address: Address, callback: (lamports: Lamports) => void) => {
const subscription = await client.rpcSubscriptions.accountNotifications(address).subscribe();
for await (const notification of subscription) {
callback(notification.value.lamports);
}
},
});
}
ClientWithTransactionPlanningRepresents a client that can convert instructions or instruction plans into transaction plans.
import { flattenTransactionPlan } from '@solana/instruction-plans';
import { ClientWithTransactionPlanning } from '@solana/plugin-interfaces';
function transactionCounterPlugin() {
return <T extends ClientWithTransactionPlanning>(client: T) => ({
...client,
countTransactions: async (instructions: IInstruction[]) => {
const plan = await client.planTransactions(instructions);
return flattenTransactionPlan(plan).length;
},
});
}
ClientWithTransactionSendingRepresents a client that can send transactions to the Solana network. It supports flexible input formats including instructions, instruction plans, transaction messages, or transaction plans.
import { ClientWithPayer, ClientWithTransactionSending } from '@solana/plugin-interfaces';
function transferPlugin() {
return <T extends ClientWithPayer & ClientWithTransactionSending>(client: T) => ({
...client,
transfer: async (recipient: Address, amount: Lamports) => {
const instruction = getTransferSolInstruction({
source: client.payer,
destination: recipient,
amount,
});
const result = await client.sendTransaction(instruction);
return result.context.signature;
},
});
}
Use TypeScript intersection types to require multiple capabilities from the client:
import { ClientWithPayer, ClientWithRpc, ClientWithTransactionSending } from '@solana/plugin-interfaces';
import { GetAccountInfoApi } from '@solana/rpc-api';
function tokenTransferPlugin() {
return <T extends ClientWithPayer & ClientWithRpc<GetAccountInfoApi> & ClientWithTransactionSending>(
client: T,
) => ({
...client,
transferToken: async (mint: Address, recipient: Address, amount: bigint) => {
// Use client.rpc to fetch token accounts
// Use client.payer as the token owner
// Use client.sendTransaction to execute the transfer
},
});
}
FAQs
TypeScript interfaces for building pluggable Solana clients
The npm package @solana/plugin-interfaces receives a total of 20,838 weekly downloads. As such, @solana/plugin-interfaces popularity was classified as popular.
We found that @solana/plugin-interfaces demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.

Security News
/Research
Widespread GitHub phishing campaign uses fake Visual Studio Code security alerts in Discussions to trick developers into visiting malicious website.