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

@phorcefield/liquidity-sdk

v1.0.0

Published

Client SDK for the Phorcefield Liquidity Router

Readme

@phorcefield/liquidity-sdk

Client SDK for the Phorcefield Liquidity Router — swap USDC to SUI with multi-chain routing support.

Install

npm install @phorcefield/liquidity-sdk

Quick Start

import { LiquidityClient } from '@phorcefield/liquidity-sdk';

const client = new LiquidityClient({
  baseUrl: 'https://router.phorcefield.com',
  apiKey: 'your-api-key',
});

// Get a USDC → SUI quote
const quote = await client.getQuote({ fromAmount: '10000000' }); // 10 USDC (6 decimals)

// Create an intent from the quote
const { intent, negotiation } = await client.createIntent({
  quoteId: quote.id,
  userSuiAddress: '0xYOUR_SUI_ADDRESS',
});

// The negotiation contains the payment request — submit the USDC payment on-chain,
// then poll for completion:
const completed = await client.waitForCompletion(intent.id, {
  onStatusChange: (status) => console.log('Status:', status),
});

console.log('Received SUI:', completed.receipt?.settlementAmount);

Multi-Chain Routing

Route USDC from Solana, Base, or Ethereum to SUI in one call:

import { LiquidityClient, Chain } from '@phorcefield/liquidity-sdk';

const client = new LiquidityClient({
  baseUrl: 'https://router.phorcefield.com',
  apiKey: 'your-api-key',
});

// Get optimal routes from multi-chain balances
const routes = await client.getRoutes({
  balances: [
    { chain: Chain.SUI, amount: '5000000' },
    { chain: Chain.SOLANA, amount: '20000000' },
  ],
  userSuiAddress: '0xYOUR_SUI_ADDRESS',
});

console.log('Best route:', routes.bestRouteId);
console.log('Routes:', routes.routes);

// Or use executeRoute() to handle the full flow automatically:
const { route, intent } = await client.executeRoute(
  [
    { chain: Chain.SOLANA, amount: '20000000' },
  ],
  '0xYOUR_SUI_ADDRESS',
);

API Reference

new LiquidityClient(config)

| Option | Type | Default | Description | |--------|------|---------|-------------| | baseUrl | string | — | Router API URL | | apiKey | string? | — | API key for authentication | | fetch | typeof fetch? | globalThis.fetch | Custom fetch (React Native, testing) | | timeoutMs | number? | 15000 | Request timeout in ms | | on402 | (negotiation) => boolean | — | Callback for 402 Payment Required |

Methods

| Method | Description | |--------|-------------| | getQuote(params) | Get a USDC → SUI swap quote | | createIntent(params, idempotencyKey?) | Create a swap intent from a quote | | getIntent(id) | Get intent status by ID | | cancelIntent(id) | Cancel an unpaid intent | | waitForCompletion(id, opts?) | Poll until intent reaches terminal state | | getRoutes(params) | Get ranked multi-chain routes | | createCrossChainIntent(params, idempotencyKey?) | Create intent from a cross-chain route | | executeRoute(balances, address, opts?) | Full flow: route → intent → wait |

Enums

  • IntentStatusNEW, AWAITING_PAYMENT, PAID_CONFIRMED, BRIDGING, SWAPPING, SETTLING, COMPLETED, FAILED, EXPIRED, CANCELED
  • ChainSUI, SOLANA, BASE, ETHEREUM
  • ErrorCode — Structured error codes for all failure modes

Error Classes

  • LiquidityApiError — API error with statusCode, code, and details
  • LiquidityTimeoutError — Request timeout
  • WaitTimeoutError — Polling timeout with intentId and lastStatus

License

MIT