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

@lastrum/connect

v0.1.2

Published

TypeScript SDK pra conectar dApps Liquid à Lastrum Wallet (window.lastrum + window.redbird alias / EIP-6963).

Readme

@lastrum/connect

TypeScript SDK pra conectar dApps Liquid à Lastrum Wallet via window.lastrum / EIP-6963.

Install

npm install @lastrum/connect
# ou
bun add @lastrum/connect

Quickstart

import { getProvider, LastrumClient } from "@lastrum/connect";

const provider = await getProvider({ timeout: 1000 });
if (!provider) {
  alert("Lastrum wallet não instalada. https://redbird.anchorkit.dev/download");
  return;
}

const client = new LastrumClient(provider);

// 1. Pede conexão (abre popup se primeira vez)
const { accounts } = await client.requestAccounts();
console.log("Conectado:", accounts[0]); // lq1q…

// 2. Lê saldo (precisa de permissão accounts)
const balances = await client.getBalance();
console.log("Saldos:", balances);

// 3. Assina mensagem (popup obrigatório)
const sig = await client.signMessage("Login: nonce=abc123");
console.log("Assinatura hex:", sig);

// 4. Envia transação (popup obrigatório)
const { txid } = await client.sendTransaction({
  outputs: [
    {
      asset: "6f0279…6d49", // L-BTC
      address: "lq1qabc…",
      amount: "100000", // sats
    },
  ],
});
console.log("Broadcasted:", txid);

API

getProvider(opts?)

Detecta o provider via window.lastrum OU EIP-6963 (eip6963:requestProvider).

const provider = await getProvider({ timeout: 1000 });
// → LastrumProvider | null

listAnnouncedProviders(opts?)

Lista TODAS as wallets que anunciam via EIP-6963 (multi-wallet picker).

const wallets = await listAnnouncedProviders();
// → Array<{ info: Eip6963ProviderInfo, provider: LastrumProvider }>

LastrumClient

Wrapper tipado em volta de provider.request(...).

| Método | Sem permissão | Permissão | Popup? | Retorno | |---|---|---|---|---| | chainId() | ✓ | — | não | "liquidv1" | | walletInfo() | ✓ | — | não | { name, version, uuid, … } | | requestAccounts() | — | accounts | sim (1ª vez) | { accounts, attestation? } | | accounts() | ✓ | accounts (silent) | não | [address] ou [] | | getBalance() | — | accounts | não | [{ assetId, amount, … }] | | signMessage(msg) | — | accounts | sempre | hex | | signPset(pset) | — | accounts | sempre | base64 PSET assinado | | sendTransaction(payload) | — | accounts | sempre | { txid } | | requestPermissions(scopes) | ✓ | — | sim | PermissionGrant[] | | getPermissions() | ✓ | — | não | PermissionGrant[] | | revokePermissions(scopes) | ✓ | — | não | { revoked } |

Eventos

provider.on("accountsChanged", ({ accounts }) => {
  console.log("Wallet ativa mudou:", accounts);
});
provider.on("chainChanged", ({ chainId }) => {
  console.log("Rede mudou:", chainId);
});
provider.on("disconnect", (err) => {
  console.log("Origem revogada:", err);
});

Códigos de erro

Padrão JSON-RPC 2.0 + EIP-1193:

| Code | Significado | |---|---| | 4001 | User rejeitou no popup | | 4100 | Origem sem permissão (ou wallet locked — anti-fingerprint) | | 4200 | Método não suportado | | -32600 | Request inválido | | -32601 | Método não existe | | -32602 | Params inválidos | | -32603 | Internal error |

Spec

Implementação completa: Spec 010 — Lastrum Provider.

License

MIT.