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

@jadonamite/automata-core

v1.0.3

Published

Embedded cross-chain SDK for Automata — balance reads, USDC bridging (Circle CCTP V2), swaps (LI.FI + Stellar DEX), transfers, yield (Aave V3 + LI.FI Earn), and an optional Gemini AI agent. No backend required.

Readme

@jadonamite/automata-core

Embedded cross-chain SDK for Automata — no backend required.

Bring your own RPC URLs and get direct access to balance reads, USDC bridging (Circle CCTP V2), token swaps (LI.FI + Stellar DEX), transfers, yield opportunities (Aave V3 + LI.FI Earn), and an optional Gemini AI agent — all from a single class.

Installation

npm install @jadonamite/automata-core

Requires Node.js 18+. Peer dependencies: viem, @stellar/stellar-sdk, @lifi/sdk, @google/generative-ai are bundled.

Quick Start

import { AutomataCore } from '@jadonamite/automata-core'

const sdk = new AutomataCore({
  rpc: {
    base:     'https://base-mainnet.g.alchemy.com/v2/YOUR_KEY',
    celo:     'https://celo-mainnet.g.alchemy.com/v2/YOUR_KEY',
    ethereum: 'https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY',
  },
})

// Get balances across all chains
const balances = await sdk.getBalances('0x...', 'G...')
// { base: { ETH: '0.041', USDC: '100.00' }, celo: {...}, ethereum: {...}, stellar: { XLM: '94.2' } }

// Build a bridge transaction (returns unsigned tx — you sign it)
const result = await sdk.buildBridgeTx({
  fromChain:        'base',
  toChain:          'celo',
  amount:           '50',
  walletAddress:    '0x...',
  recipientAddress: '0x...',
})

Configuration

const sdk = new AutomataCore({
  rpc: {
    base:     'https://...',  // required
    celo:     'https://...',  // required
    ethereum: 'https://...',  // required
  },
  stellar: {
    horizonUrl: 'https://horizon.stellar.org',      // optional, defaults to mainnet
    sorobanUrl: 'https://soroban-rpc.stellar.org',  // optional, defaults to mainnet
  },
  lifi: {
    integrator: 'your-app-name',  // optional
    apiKey:     'your-lifi-key',  // optional, increases rate limits
  },
})

API Reference

Balances

const balances = await sdk.getBalances(
  evmAddress,     // '0x...' — reads Base, Celo, Ethereum
  stellarAddress  // 'G...' — optional, reads Stellar
)
// Returns: { base, celo, ethereum, stellar } — each a { token: amount } map

Routing

Find the best route for a cross-chain or same-chain swap before building the transaction.

const route = await sdk.getRoute({
  fromChain:     'base',
  toChain:       'celo',
  fromToken:     'USDC',
  toToken:       'CELO',
  amount:        '100',
  walletAddress: '0x...',
})
// { routeId, estimatedOutput, estimatedFeeUSD, estimatedTimeSeconds, steps }

Supported tokens: USDC, ETH, CELO, cUSD, cKES, XLM, EURC, yXLM

Bridge (Circle CCTP V2)

Moves native USDC between chains in ~90 seconds via burn-and-mint. Returns two unsigned transactions: approve + burn.

const result = await sdk.buildBridgeTx({
  fromChain:        'base',       // 'base' | 'celo' | 'ethereum'
  toChain:          'celo',       // 'base' | 'celo' | 'ethereum'
  amount:           '50',
  walletAddress:    '0x...',
  recipientAddress: '0x...',
})
// result.unsignedTxs = [approveTx, burnTx]
// result.summary = { estimatedTimeSeconds: 90, estimatedFeeUSD: '< $0.01', ... }

After the user signs the burn tx, poll for attestation then build the claim tx:

const { message, attestation } = await sdk.pollAttestation(
  6,       // CCTP source domain (base=6, celo=7, ethereum=0)
  '0x...'  // burn tx hash
)

const claimTx = sdk.buildReceiveMessageTx({
  destinationChain: 'celo',
  message,
  attestation,
  amount: '50',
})

Swap

EVM swaps via LI.FI, Stellar swaps via DEX path payment.

// EVM — call getRoute first, then buildSwapTx
const route = await sdk.getRoute({ fromChain: 'base', toChain: 'base', fromToken: 'ETH', toToken: 'USDC', amount: '0.01', walletAddress: '0x...' })
const swap  = await sdk.buildSwapTx({ routeId: route.routeId, walletAddress: '0x...', fromToken: 'ETH', toToken: 'USDC', fromChain: 'base', amount: '0.01' })

// Stellar DEX — no routeId needed
const swap = await sdk.buildSwapTx({
  fromChain:     'stellar',
  fromAddress:   'G...',
  walletAddress: 'G...',
  fromToken:     'XLM',
  toToken:       'USDC',
  amount:        '100',
  minDestAmount: '9.5',
})
// swap.unsignedTx.xdr — sign with Freighter / Privy Stellar wallet

Transfer

Simple token send on any supported chain.

// EVM USDC transfer
const tx = await sdk.buildTransferTx({
  chain:       'base',
  token:       'USDC',
  amount:      '25',
  fromAddress: '0x...',
  toAddress:   '0x...',
})

// Stellar transfer
const tx = await sdk.buildTransferTx({
  chain:       'stellar',
  token:       'XLM',
  amount:      '50',
  fromAddress: 'G...',
  toAddress:   'G...',
})
// tx.unsignedTx.xdr — ready to sign

Yield

Discover live yield opportunities and build deposit transactions via LI.FI Earn.

// Get opportunities — sorted by APY descending
const opportunities = await sdk.getYieldOpportunities('base', 'USDC')

// Build a deposit tx for a specific vault
const result = await sdk.buildStakeTx({
  opportunityId: '8453-0xbeef...',  // vault slug from getYieldOpportunities
  walletAddress: '0x...',
  amount:        '100',
  tokenDecimals: 6,                 // USDC = 6, ETH = 18
})
// result.unsignedTx — approve + deposit, sign sequentially

// Check active positions
const positions = await sdk.getEarnPositions('0x...')

Fee Estimation

const fees = await sdk.estimateFees([
  { type: 'bridge', fromChain: 'base', toChain: 'celo' },
  { type: 'swap',   token: 'USDC' },
])
// { totalEstimatedFeeUSD: '0.60', breakdown: [...], warning: null }

AI Agent (Optional)

Spin up a Gemini-powered agent that drives all the services above from natural language. The agent uses your RPC config — no separate backend needed.

const agent = sdk.createAgent('AIza...')  // your Gemini API key

const { reply, unsignedTxs, updatedHistory } = await agent.chat(
  'Swap 10 USDC to XLM on Stellar',
  [],           // conversation history (empty for new session)
  '0x...',      // EVM wallet address
  'G...',       // Stellar wallet address
)

console.log(reply)
// "Swapping 10 USDC → ~94.2 XLM on the Stellar DEX. Confirm in your wallet."

// Continue the conversation
const next = await agent.chat(
  'Now send 50 XLM to GABCD...',
  updatedHistory,
  '0x...',
  'G...',
)

The agent supports the full tool loop: balance checks → route finding → tx building → fee estimation — all in a single chat() call.

Unsigned Transactions

All tx-building methods return UnsignedTx objects — the SDK never holds private keys.

// EVM — sign with wagmi, viem, ethers, Privy
await sendTransaction({
  to:    unsignedTx.to as `0x${string}`,
  data:  unsignedTx.data as `0x${string}`,
  value: BigInt(unsignedTx.value),
})

// Stellar — sign with Freighter, Privy, or any XDR-compatible wallet
if (unsignedTx.xdr) {
  await signTransaction(unsignedTx.xdr, { network: 'MAINNET' })
}

Supported Chains & Assets

| Chain | EVM | Tokens | |---|---|---| | Base | ✓ | ETH, USDC | | Celo | ✓ | CELO, USDC, cUSD, cKES | | Ethereum | ✓ | ETH, USDC | | Stellar | — | XLM, USDC, EURC, cKES, yXLM |

Related

License

MIT