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

@cookill/wallet-adapter

v3.1.4

Published

Official Sheep Wallet adapter for Rialo blockchain - REX confidential TX, SfS gasless TX, Scan-to-Connect

Readme

@cookill/wallet-adapter

Wallet adapter for Sheep Wallet — the browser extension wallet for the Rialo blockchain.

Provides a drop-in React provider, responsive connect modal, and vanilla JS class so dApp developers can integrate Sheep Wallet without writing custom UI.

Installation

npm install @cookill/wallet-adapter

Quick Start (React)

import { WalletProvider, ConnectButton } from '@cookill/wallet-adapter/react';

function App() {
  return (
    <WalletProvider network="devnet" autoConnect>
      <ConnectButton />
      <YourDApp />
    </WalletProvider>
  );
}

WalletProvider renders a built-in connect modal automatically. On desktop the modal opens centered; on mobile it slides up from the bottom as a sheet. No custom modal code needed.

React Hooks

useWallet

import { useWallet } from '@cookill/wallet-adapter/react';

function MyComponent() {
  const {
    connected,       // boolean — is wallet connected
    connecting,      // boolean — connection in progress
    activeAccount,   // WalletAccount | null — first connected account
    chainId,         // string — e.g. "rialo:devnet"
    isInstalled,     // boolean — extension detected in browser

    // Actions
    connect,         // () => Promise<WalletAccount[]>
    disconnect,      // () => Promise<void>
    switchNetwork,   // (network) => Promise<void>
    refreshBalance,  // () => Promise<void>

    // Signing & Transactions
    signMessage,             // (msg: string) => Promise<SignedMessage>
    signTransaction,         // (tx) => Promise<string>
    sendTransaction,         // (tx) => Promise<TransactionResult>
    signAndSendTransaction,  // (tx) => Promise<TransactionResult>

    // Modal control
    openModal,   // () => void — open the connect modal
    closeModal,  // () => void — close it
  } = useWallet();
}

Focused Hooks

const { connect, connecting, isInstalled, error } = useConnectWallet();
const { disconnect, connected } = useDisconnectWallet();
const connected = useIsConnected();
const account = useActiveAccount();
const accounts = useAccounts();
const { balance, refresh } = useBalance();
const { network, chainId } = useNetwork();
const { switchNetwork } = useSwitchNetwork();
const { sendTransaction, signAndSendTransaction } = useSendTransaction();
const { signMessage } = useSignMessage();

Connect Modal

The modal is rendered automatically by WalletProvider. It has two tabs:

  1. Extension — Detects the installed Sheep Wallet extension and connects directly. If the extension is not installed, a download link is shown.
  2. Scan to Connect — Generates a QR code that a mobile Sheep Wallet can scan to pair cross-device. Also supports the reverse flow (wallet shows QR, dApp scans).

On mobile viewports the modal slides up from the bottom as a sheet and can be dismissed by swiping down. On desktop it opens as a centered dialog.

When the user clicks Connect and the extension is installed, the extension popup opens automatically — no manual action required.

Controlling the Modal

const { openModal, closeModal } = useWallet();

// Or use the built-in button
<ConnectButton />

Vanilla JavaScript

import { SheepWallet, isInstalled, formatBalance } from '@cookill/wallet-adapter';

const wallet = new SheepWallet();

if (!wallet.isInstalled) {
  console.log('Extension not found');
}

const accounts = await wallet.connect();
console.log('Address:', accounts[0].address);

const balance = await wallet.getBalance();
console.log('Balance:', formatBalance(balance));

await wallet.signAndSendTransaction({
  to: 'RecipientAddress',
  value: '1000000000', // 1 RLO in kelvins
});

await wallet.disconnect();

ConnectButton

<ConnectButton
  connectLabel="Connect Wallet"   // label when disconnected
  disconnectLabel="Disconnect"     // dropdown label when connected
  showAddress={true}               // show truncated address when connected
  showBalance={false}              // show RLO balance next to address
/>

WalletProvider Props

<WalletProvider
  network="devnet"            // default network
  autoConnect={true}          // silently restore previous session on load
  onConnect={(accounts) => {}}
  onDisconnect={() => {}}
  onNetworkChange={(net) => {}}
  onError={(error) => {}}
>
  {children}
</WalletProvider>

Networks

| Network | Chain ID | RPC URL | Symbol | |----------|-----------------|--------------------------------|--------| | Mainnet | rialo:mainnet | https://mainnet.rialo.io:4101 | RLO | | Testnet | rialo:testnet | https://testnet.rialo.io:4101 | tRLO | | Devnet | rialo:devnet | https://devnet.rialo.io:4101 | dRLO | | Localnet | rialo:localnet | http://localhost:4101 | lRLO |

Provider Interface (window.rialo)

When the Sheep Wallet extension is installed, it injects window.rialo with this interface:

interface RialoProvider {
  isRialo: boolean;
  isSheepWallet: boolean;
  version: string;

  // Connection
  connect(): Promise<WalletAccount[]>;
  disconnect(): Promise<void>;
  isConnected(): Promise<boolean>;
  getAccounts(): Promise<WalletAccount[]>;

  // Transactions
  signTransaction(tx: TransactionRequest): Promise<{ signature: string }>;
  sendTransaction(tx: TransactionRequest): Promise<TransactionResult>;
  signAndSendTransaction(tx: TransactionRequest): Promise<TransactionResult>;

  // Message Signing
  signMessage(message: string | Uint8Array): Promise<SignedMessage>;

  // Network
  getNetwork(): Promise<RialoNetwork>;
  switchNetwork(network: RialoNetwork): Promise<void>;
  getBalance(address?: string): Promise<BalanceResult>;

  // Events
  on(event: WalletEvent, callback: Function): () => void;

  // State (synchronous getters)
  readonly connected: boolean;
  readonly accounts: WalletAccount[];
  readonly address: string | null;
  readonly network: RialoNetwork;
  readonly chainId: string;
}

Supported Events

| Event | Payload | |-------------------|-----------------------------------| | connect | { accounts: WalletAccount[] } | | disconnect | — | | accountsChanged | WalletAccount[] | | networkChanged | { network, chainId } |

Key Types

interface WalletAccount {
  address: string;
  publicKey: string;
}

interface TransactionRequest {
  to: string;
  value: string;      // amount in kelvins (1 RLO = 1_000_000_000 kelvins)
  data?: string;
  memo?: string;
}

interface TransactionResult {
  hash: string;
  signature?: string;
  status: 'pending' | 'confirmed' | 'failed';
}

interface SignedMessage {
  signature: string;
  message: string;
  address: string;
}

type RialoNetwork = 'mainnet' | 'testnet' | 'devnet' | 'localnet';

Utilities

import {
  formatAddress,   // (address, chars?) => "5YNm...VWr8"
  formatBalance,   // (kelvins, decimals?) => "1.0000"
  parseBalance,    // (rlo) => bigint (kelvins)
  isValidAddress,  // (address) => boolean
  isInstalled,     // () => boolean
  NETWORKS,        // Record<RialoNetwork, NetworkConfig>
} from '@cookill/wallet-adapter';

Architecture Notes

  • All provider calls are wrapped with a 20-second timeout to prevent dApp freezes if the extension stops responding.
  • autoConnect uses a silent checkSession() that never triggers a user-facing approval popup — it only restores an existing session.
  • The connect modal is rendered inside WalletProvider so you never need to manage modal state yourself.

License

MIT