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

@muwp/sdk

v1.0.0

Published

TypeScript SDK for MUWP wallet orchestration, asset management, and Stellar DEX swaps.

Downloads

348

Readme

@muwp/sdk

TypeScript SDK for MUWP — multi-token cross-chain swaps to Stellar XLM.

Installation

npm install @muwp/sdk
# or
bun add @muwp/sdk

Quick Start

import { MuwpSdk } from "@muwp/sdk";

const sdk = new MuwpSdk({
  baseUrl: "https://muwp.xyz",  // optional — defaults to production
});

// Request a multi-token quote (2 EVM tokens → XLM on Stellar)
const quote = await sdk.wallets.fetchQuote({
  inputTokens: [
    { address: "0xusdc...", value: "usdc" },
    { address: "0xusdt...", value: "usdt" },
  ],
  outputTokens: [{ address: "stellar:XLM", value: "xlm" }],
  distribution: [50, 50],
  inputChain: 1,    // Ethereum mainnet
  outputChain: 7,   // Stellar
  inputAmount: { usdc: 500_000_000n, usdt: 500_000_000n },
  fromAddress: "0xYourEthAddress",
});

console.log("Temp account:", quote.tempAccount);

Services

sdk.walletsWalletService

Managed wallet and quote orchestration.

const quote = await sdk.wallets.fetchQuote(input);
const tempAddr = await sdk.wallets.ensureTempAccount(input);

sdk.assetsStellarAssetService

Stellar asset lifecycle management.

import { StellarAssetService } from "@muwp/sdk";
import { Networks } from "@stellar/stellar-sdk";

const assets = new StellarAssetService({
  horizonUrl: "https://horizon.stellar.org",
  networkPassphrase: Networks.PUBLIC,
});

// Unsigned trustline XDR (user must sign + submit)
const xdr = await assets.buildTrustlineTransaction({
  account: "GABC...", assetCode: "USDC", issuer: "GDEF...",
});

// Signed issuance XDR
const xdr = await assets.buildIssuanceTransaction({
  issuerSecret: "SABC...", destination: "GABC...",
  assetCode: "USDC", amount: "100", memo: "optional",
});

// Account balances
const balances = await assets.fetchBalances("GABC...");
// → [{ assetCode: "XLM", isNative: true, balance: "100.5" }, ...]

// Bridge amount estimate
const estimate = await assets.estimateBridgeAmount({
  fromChainId: 1, fromTokenAddress: "0xusdc...", amount: 1_000_000n,
});

StellarDexService

Stellar DEX orderbook and market orders.

import { StellarDexService } from "@muwp/sdk";

const dex = new StellarDexService({
  horizonUrl: "https://horizon.stellar.org",
  networkPassphrase: Networks.PUBLIC,
});

const book = await dex.fetchOrderbook({
  selling: { code: "USDC", issuer: "GDEF..." },
});

const result = await dex.swapToXlm({
  selling: { code: "USDC", issuer: "GDEF..." },
  amount: "100",
  accountSecret: "SABC...",
});
// → { hash: "...", acceptedPrice: 0.48 }

SwapService

Full EVM → Stellar swap orchestration with performance metrics.

import { SwapService } from "@muwp/sdk";

const swapper = new SwapService({ routeService, walletService, stellarDex });

const result = await swapper.executeSwap({
  quote, chainId: 1, gasPayer: "0x...",
  signer: async (txData) => { /* sign + submit EVM tx, return hash */ },
  stellarSecret: "SABC...", stellarAssetCode: "USDC", stellarIssuer: "GDEF...",
});

console.log(result.metrics);
// → { initiate: 243, sign: 890, notifyReceive: 118, stellarSwap: 340 }

Configuration

| Option | Default | Description | |--------|---------|-------------| | baseUrl | https://muwp.xyz | MUWP API base URL | | apiKey | — | Optional API key | | fetch | cross-fetch | Custom fetch implementation | | assetOptions.horizonUrl | https://horizon.stellar.org | Horizon endpoint | | assetOptions.networkPassphrase | Networks.PUBLIC | Stellar network | | assetOptions.sorobanUrl | — | Optional Soroban RPC URL |

Examples

bun run examples/01-asset-management.ts   # trustlines, issuance, balances
bun run examples/02-stellar-dex.ts        # orderbook, market orders
bun run examples/03-multi-token-swap.ts   # multi-token EVM → XLM

Development

bun run build        # compile to dist/
bun run test         # 25 tests across 7 suites
bunx tsc --noEmit    # type check