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

sol-gasless-adapter

v1.3.0

Published

A Solana adapter for Gasless Relayer

Downloads

7

Readme

Sol-Gasless-Adapter

A Solana adapter for Gasless Relayer, providing a simple and consistent interface for interacting with Solana wallets and the Solana blockchain.

Features

  • Connect to Solana wallets (Phantom, etc.)
  • Send transactions
  • Sign messages
  • Get account balances
  • React components and hooks for easy integration
  • TypeScript support
  • Error handling
  • Event handling
  • Gasless transactions: Submit transactions through a relayer that sponsors gas fees
  • Automatic fallback: If relayer is unavailable, transactions fall back to regular transactions
  • Project tracking: Add your project ID for tracking and monitoring transaction activity

Installation

npm install sol-gasless-adapter
# or
yarn add sol-gasless-adapter

Usage

Basic Usage

import { SolanaAdapter } from 'sol-gasless-adapter';

const adapter = new SolanaAdapter({
  connectionSettings: 'confirmed',
  // Optional: For project tracking and monitoring
  projectId: 'your-project-id',
  // Optional: Custom relayer URL (defaults to https://sol-relayer.fly.dev/api)
  relayerApiUrl: 'https://your-custom-relayer-endpoint.com/api',
});

// Connect to a wallet
const result = await adapter.connect({
  provider: window.solana,
  providerType: 'solana',
});

// Get balance
const balance = await adapter.getBalance({
  address: result.address,
  currency: 'SOL',
});

// Sign message
const signResult = await adapter.signMessage({
  message: 'Hello, Solana!',
  provider: result.provider,
  providerType: 'solana',
});

// Send regular transaction
const txResult = await adapter.sendTransaction({
  to: 'recipient-address',
  value: '1.5',
  provider: result.provider,
  providerType: 'solana',
});

// Send gasless transaction (sponsored by relayer)
const gaslessTxResult = await adapter.sendTransaction({
  to: 'recipient-address',
  value: '1.5',
  provider: result.provider,
  useRelayer: true,
  metadata: {
    purpose: 'Donation',
    referenceId: '12345',
  },
});

// Check if a fallback was used
if (gaslessTxResult.usedFallback) {
  console.log('Relayer was unavailable, used regular transaction as fallback');
}

React Integration

The package includes React components and hooks for easy integration into your React application.

First, wrap your application with the SolanaAdapterProvider:

import {
  SolanaAdapterProvider,
  ConnectWallet,
  WalletBalance,
  SignMessage,
  SendTransaction,
} from 'sol-gasless-adapter';

function App() {
  return (
    <SolanaAdapterProvider
      connectionSettings="confirmed"
      projectId="your-project-id"
      // The adapter now uses a default relayer URL (https://sol-relayer.fly.dev/api)
      // so you don't need to specify it unless you're using a custom relayer
    >
      <ConnectWallet />
      <WalletBalance />
      <SignMessage />
      <SendTransaction useRelayer={true} />
    </SolanaAdapterProvider>
  );
}

Project ID for Transaction Tracking

When you register your project with our relayer service, you'll receive a unique projectId that you should include when initializing the adapter. This enables:

  1. Transaction tracking: Monitor all transactions originating from your application
  2. Usage analytics: Get insights into user behavior and transaction patterns
  3. Quota management: Track your relayer usage against your allocated quota
  4. Error reporting: Receive detailed error reports for failed transactions

To register for a project ID, visit the relayer service dashboard at https://sol-relayer.fly.dev/dashboard and create an account.