Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
builder
✓ import { builder } from 'solami'
✗ import builder from 'solami'
Named export only; no default export exists.
CommitmentLevel
✓ import { CommitmentLevel } from 'solami'
Enum with values PROCESSED, CONFIRMED, FINALIZED.
buildTipIx
✓ import { buildTipIx } from 'solami'
Creates a SystemProgram.transfer instruction to a random tip account; must be included in transactions landed via SWQOS.
Region
✓ import { Region } from 'solami'
✗ const { Region } = require('solami')
Enum with Global, Ams, Fra, Nyc. Use for regional routing.
Initialize Solami client with RPC and gRPC, fetch slot and block, subscribe to slot changes and gRPC transaction streams.
import { builder, CommitmentLevel } from 'solami';
const client = await builder()
.withRpc(process.env.SOLAMI_RPC_TOKEN ?? '')
.withGrpc(process.env.SOLAMI_RPC_TOKEN ?? '')
.build();
const slot = await client.rpc().connection.getSlot();
const block = await client.rpc().getBlock(slot);
client.ws().connection.onSlotChange((info) => console.log(info.slot));
const stream = await client.grpc().subscribeTransactions(
'pumpfun',
['6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P'],
CommitmentLevel.PROCESSED,
);
stream.on('data', (msg) => console.log(msg));
Debug
Known issues
gotchaQUIC buffers outgoing frames; if the script exits immediately after landTransaction, the FIN frame may be dropped and the transaction never sent.fixKeep the Node.js process alive for a few seconds after landTransaction (e.g., await new Promise(r => setTimeout(r, 2000))).
affects: >=0.1.0
breakingVersion 0.1.8 is early-stage; the API may change without notice. The builder pattern and method signatures are not yet stable.fixPin dependency to exact version (e.g., "solami": "0.1.8") and review changelog before upgrading.
affects: >=0.1.0
gotchabuildTipIx must be included in the transaction for landTransaction to accept it, otherwise it will reject.fixAlways call buildTipIx(payer.publicKey, tipAmountInSol) and add the returned instruction to your transaction.
affects: >=0.1.0
deprecatedNo deprecated features known yet as the package is pre-1.0.
Errors
Common errors & fixes
TypeError: Cannot read properties of undefined (reading 'connection')
Attempting to call client.rpc() without enabling withRpc in the builder.
fixEnsure builder().withRpc(token) is called before .build().
Error: 12 UNIMPLEMENTED: Method not found
Using an invalid gRPC method or incorrect region
fixCheck that the grpc method name is correct and region is set via .withGrpc(token).grpcRegion(Region.Ams) or similar.
Error: Transaction failed: missing tip
Transaction passed to landTransaction does not include a tip instruction.
fixAdd buildTipIx(payer.publicKey, 0.0001) to the transaction instructions.
Could not find a declaration file for module 'solami'.
Missing TypeScript types; likely using an older version that doesn't ship types.
fixUpdate to solami@0.1.8 which includes bundled type declarations. Or install @types/solami if it becomes available.
Audit
Dependencies
@solana/web3.jsoptionalPeer dependency for Keypair, TransactionMessage, VersionedTransaction types and helpers
bs58optionalUsed for encoding/decoding base58 keys and keypairs