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

@caatinga/client

v0.2.2

Published

Browser and Node client for Soroban smart contracts — connects generated bindings, Caatinga artifacts, and wallet adapters

Readme

@caatinga/client

Install

pnpm add @caatinga/client

If you are using Freighter, add the optional adapter dependency:

pnpm add @stellar/freighter-api
import { createCaatingaClient } from "@caatinga/client";
import { freighterWalletAdapter } from "@caatinga/client/freighter";

The @caatinga/client/freighter subpath is optional and only needed when you want the bundled Freighter adapter.

What It Solves

@caatinga/client is the supported browser and Node integration layer for invoking generated Soroban bindings with Caatinga artifacts, network configuration, and a wallet adapter.

It connects:

  • generated contract bindings
  • caatinga.artifacts.json
  • RPC URL and network passphrase
  • wallet-backed signing for invocation and XDR preparation flows

Supported Surface

Supported runtime root exports:

  • createCaatingaClient
  • resolveContractId
  • createDefaultBindingAdapter
  • CaatingaContractClient
  • buildXdr

Supported type-only root exports:

  • CaatingaBindingAdapter
  • CaatingaClientConfig
  • CaatingaContractRegistration
  • CaatingaInvokeOptions
  • CaatingaInvokeResult
  • CaatingaInvokeStatus
  • CaatingaNetwork
  • CaatingaWalletAdapter
  • CaatingaXdrBuildResult

Supported subpath export:

  • @caatinga/client/freighter -> freighterWalletAdapter (optional)

Primary flow:

  • createCaatingaClient(...)
  • client.contract(name).invoke(method, args?)
  • client.contract(name).buildXdr(method, args?)

Counter Example

import { createCaatingaClient } from "@caatinga/client";
import { freighterWalletAdapter } from "@caatinga/client/freighter";
import * as Counter from "./contracts/generated/counter";
import artifacts from "../caatinga.artifacts.json";

const client = createCaatingaClient({
  network: {
    name: "testnet",
    rpcUrl: "https://soroban-testnet.stellar.org",
    networkPassphrase: "Test SDF Network ; September 2015"
  },
  artifacts,
  wallet: freighterWalletAdapter,
  contracts: {
    counter: {
      binding: Counter
    }
  }
});

const result = await client.contract("counter").invoke("increment");

Wallet Adapter Contract

export interface CaatingaWalletAdapter {
  getPublicKey(): Promise<string>;

  signTransaction(input: {
    xdr: string;
    networkPassphrase: string;
  }): Promise<string>;
}

The default Freighter adapter is exported from @caatinga/client/freighter.

Debug Output Rules

  • XDR data is omitted by default
  • debugXdr: true includes XDR snapshots such as unsigned, prepared, and signed values
  • raw binding or submission output is omitted by default
  • debugRaw: true includes raw binding or submission output

Consumers should treat debug fields as opt-in diagnostics, not part of the default happy-path payload.

Errors

@caatinga/client emits documented CAATINGA_* codes for public failures. Consumers should key automation on the code, not the message text.

Common codes include:

  • CAATINGA_CONTRACT_ARTIFACT_NOT_FOUND
  • CAATINGA_BINDING_CLIENT_NOT_FOUND
  • CAATINGA_BINDING_METHOD_NOT_FOUND
  • CAATINGA_WALLET_NOT_CONNECTED
  • CAATINGA_XDR_BUILD_FAILED
  • CAATINGA_XDR_PREPARE_FAILED
  • CAATINGA_XDR_SIGN_FAILED
  • CAATINGA_XDR_SUBMIT_FAILED
  • CAATINGA_XDR_RESULT_FAILED

Limitations

  • this package does not replace Stellar CLI, Stellar SDK, Soroban SDK, or generated bindings
  • manual SCVal serialization and manual XDR parsing are out of scope
  • React hooks, multisig orchestration, backend signing, and non-documented wallet integrations are not part of the supported contract
  • private module paths and undocumented helpers are less stable than the exports listed above