npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@omni-bridge/solana

v0.2.0

Published

Solana transaction builder for Omni Bridge

Downloads

624

Readme

@omni-bridge/solana

Solana transaction builder for Omni Bridge.

Builds transaction instructions for Solana that can be added to a Transaction and signed with your preferred wallet/keypair.

Installation

npm install @omni-bridge/solana @omni-bridge/core

Quick Start

import { createBridge } from "@omni-bridge/core"
import { createSolanaBuilder } from "@omni-bridge/solana"
import { Connection, Transaction, sendAndConfirmTransaction, Keypair } from "@solana/web3.js"

// Setup - connection is optional, uses public RPC by default
const bridge = createBridge({ network: "mainnet" })
const solBuilder = createSolanaBuilder({ network: "mainnet" })
const keypair = Keypair.fromSecretKey(/* your secret key */)

// 1. Validate transfer
const validated = await bridge.validateTransfer({
  token: "sol:So11111111111111111111111111111111111111112", // wSOL
  amount: 1000000000n, // 1 SOL (9 decimals)
  fee: 0n,
  nativeFee: 0n,
  sender: "sol:YourPublicKey...",
  recipient: "eth:0x1234567890123456789012345678901234567890",
})

// 2. Build instructions (user owns tokens, payer pays fees)
const instructions = await solBuilder.buildTransfer(validated, keypair.publicKey)

// Or with separate payer for fees (e.g., gas refiller pays Wormhole fees)
// const instructions = await solBuilder.buildTransfer(validated, userPubkey, payerPubkey)

// 3. Create and send transaction
const connection = new Connection("https://api.mainnet-beta.solana.com")
const { blockhash } = await connection.getLatestBlockhash()
const tx = new Transaction({ recentBlockhash: blockhash, feePayer: keypair.publicKey })
tx.add(...instructions)

const signature = await sendAndConfirmTransaction(connection, tx, [keypair])
console.log("TX:", signature)

Custom RPC Endpoint

You can provide your own Connection if you need a custom RPC endpoint:

import { Connection } from "@solana/web3.js"

const connection = new Connection("https://your-rpc-endpoint.com")
const solBuilder = createSolanaBuilder({ network: "mainnet", connection })

API

Builder

const builder = createSolanaBuilder({
  network: "mainnet" | "testnet",
  connection?: Connection  // Optional - uses public RPC endpoint if not provided
})

// Transfers - returns TransactionInstruction[]
// user: account that owns tokens and authorizes the transfer
// payer: optional account that pays Wormhole fees and rent (defaults to user)
await builder.buildTransfer(validated, user)
await builder.buildTransfer(validated, user, payer)  // separate fee payer

// Finalization
await builder.buildFinalization(payload, signature, payer)

// Token registration
await builder.buildLogMetadata(token, payer)
await builder.buildDeployToken(signature, metadata, payer)

// PDA derivation (pure, no RPC)
builder.deriveConfig()
builder.deriveAuthority()
builder.deriveWrappedMint(token)
builder.deriveVault(mint)
builder.deriveSolVault()

Why Instructions?

Unlike EVM/NEAR, this package returns native TransactionInstruction[] because:

  1. Single library ecosystem - Everyone uses @solana/web3.js
  2. RPC required anyway - Account lookups need a Connection
  3. Consumer controls blockhash - Can use durable nonces, set priority fees
  4. Batching - Combine multiple operations into one transaction

PDA Derivation

Use PDA methods without building transactions:

const config = solBuilder.deriveConfig()
const authority = solBuilder.deriveAuthority()
const wrappedMint = solBuilder.deriveWrappedMint("near:wrap.near")
const vault = solBuilder.deriveVault(someMintPubkey)
const solVault = solBuilder.deriveSolVault()

Native SOL Transfers

When the token is the native SOL address (11111111111111111111111111111111), the builder automatically uses initTransferSol instead of initTransfer.

License

MIT