Catalog npm
PACKAGE EXPLORERView in registry

@0xsquid/mpp

npm

Cross-chain payment adapter for Tempo using Squid Router

cross-chainmpppaymentssquidtempo
Versions collected4
Direct dependencies7From release 0.2.0
Last observed21 Oct, 11:41 UTC

README

Current package documentation

squid-mpp

Cross-chain payment method for mppx that fulfills MPP charge challenges via Squid Router.

Given a viem Account, it scans all Squid-supported EVM chains for available balances, selects a viable source token, bridges it to the challenge currency on Tempo mainnet, and returns a credential containing the destination tx hash.

Agent on Base (or other chain)  →  Squid bridge  →  Tempo chain  →  MPP recipient

Install

npm install @0xsquid/mpp

Usage

import { Mppx } from "mppx/client"
import { squid } from "@0xsquid/mpp"
import { privateKeyToAccount } from "viem/accounts"

const account = privateKeyToAccount(process.env.PRIVATE_KEY! as `0x${string}`)

const { fetch: mppxFetch } = Mppx.create({
  polyfill: false,
  methods: [
    squid({
      account,
      integratorId: "my-app"
    })
  ]
})

const response = await mppxFetch("https://some-mpp-api.com/resource")
console.log(await response.json())

Options

OptionTypeRequiredDescription
accountAccountyesviem Account — Squid scans all supported chains for available funds
integratorIdstringyesYour Squid integrator ID

How it works

  1. Receives a Tempo charge challenge { amount, currency, recipient } from a 402 response
  2. Queries Squid for all supported tokens across EVM chains and finds ones held by the account
  3. Selects the best source token and constructs a bridge route to the challenge currency on Tempo
  4. Executes the bridge transaction and polls for the destination tx on Tempo (every 5s, up to 5min)
  5. Returns a credential { type: "hash", hash } containing the Tempo destination tx hash

The server verifies the credential by fetching the receipt from Tempo and checking that the Transfer event matches the challenge parameters exactly (token address, recipient, amount).

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 4

Collected releases
VersionPublishedDirect dependenciesOpen version
0.2.0Registry latest24 Mar 20267
0.1.1-beta.423 Mar 20267
0.1.1-beta.323 Mar 20267
0.1.1-beta.123 Mar 20267

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
0xsquid/squid-mpp

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 11:41 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:23946ead27a9541e199039f45d403296bfb8142b1ea10f376a27869f783c2111