Catalog npm
Back to packageRELEASE DETAILS

0.0.1

npm

@0xsequence/anypay-sdk

SDK for Anypay functionality

anypaysdkwallet
Published19 Jun 2025
Direct dependencies40
Transitive dependenciesNot calculated

README

Current package documentation

@0xsequence/anypay-sdk

Anypay SDK for sending any token from any chain.

⚠️ This is a work in progress!

Installation

npm install @0xsequence/anypay-sdk

Usage

React Widget Component

The easiest way to integrate Anypay is using our pre-built React widget:

import { AnyPayWidget } from '@0xsequence/anypay-sdk/widget'

export const App = () => {
  const sequenceApiKey = import.meta.env.VITE_SEQUENCE_API_KEY

  return (
    <AnyPayWidget
      sequenceApiKey={sequenceApiKey}
    />
  )
}

Low-level API Usage

If you need more control, you can use the low-level APIs directly:

Basic Example

import { prepareSend } from '@0xsequence/anypay-sdk'
import { createWalletClient, custom } from 'viem'

// Initialize a wallet client
const client = createWalletClient({
  account,
  chain: getChainConfig(chainId),
  transport: custom(window.ethereum),
})

// Prepare and send a transaction
const options = {
  account,
  originTokenAddress: '0x0000000000000000000000000000000000000000', // ETH
  originChainId: 42161, // Arbitrum
  originTokenAmount: '1000000000000000',
  destinationChainId: 8453, // Base
  recipient: '0xYourRecipientAddress',
  destinationTokenAddress: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913', // USDC on Base
  destinationTokenAmount: '300003', // Amount in USDC decimals (6)
  sequenceApiKey: 'your-api-key',
  fee: '5600000000000',
  client,
}

const { intentAddress, send } = await prepareSend(options)
console.log('Intent address:', intentAddress.toString())

// Send the transaction
await send()

Advanced Example

import {
  getAPIClient,
  getRelayer,
  getIntentCallsPayloads,
  calculateIntentAddress,
  commitIntentConfig,
  sendOriginTransaction,
  getERC20TransferData,
} from '@0xsequence/anypay-sdk'
import { createWalletClient, http } from 'viem'
import { arbitrum } from 'viem/chains'

async function sendCrossChainToken() {
  // Initialize clients
  const apiClient = getAPIClient('http://localhost:4422', process.env.SEQUENCE_API_KEY)
  const originRelayer = getRelayer({ env: 'local' }, originChainId)
  const destinationRelayer = getRelayer({ env: 'local' }, destinationChainId)

  // Create intent
  const args = {
    userAddress: account.address,
    originChainId: 42161,
    originTokenAddress: '0x0000000000000000000000000000000000000000',
    originTokenAmount: '1000000000000000',
    destinationChainId: 8453,
    destinationToAddress: destinationTokenAddress,
    destinationTokenAddress: destinationTokenAddress,
    destinationTokenAmount: destinationTokenAmount,
    destinationCallData: getERC20TransferData(recipient, BigInt(destinationTokenAmount)),
    destinationCallValue: '0',
  }

  const intent = await getIntentCallsPayloads(apiClient, args)

  // Calculate and commit intent
  const intentAddress = calculateIntentAddress(account.address, intent.calls, intent.lifiInfos)
  await commitIntentConfig(apiClient, account.address, intent.calls, intent.preconditions, intent.lifiInfos)

  // Monitor transaction status
  const status = await getMetaTxStatus(relayer, metaTxId, chainId)
  console.log('Transaction status:', status)
}

Development

# Install dependencies
pnpm install

# Build the package
pnpm run build

# Run tests
pnpm test

License

MIT License

Downloads & popularity

Awaiting observations

No metric observations yet

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

Declared dependencies 47

Native requirements
40 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
ox
Environment
{
  "local_name": "ox",
  "alias": false,
  "peer_metadata": null
}
^0.7.2runtime
wagmi
Environment
{
  "local_name": "wagmi",
  "alias": false,
  "peer_metadata": null
}
^2.15.5runtime
buffer
Environment
{
  "local_name": "buffer",
  "alias": false,
  "peer_metadata": null
}
^6.0.3runtime
motion
Environment
{
  "local_name": "motion",
  "alias": false,
  "peer_metadata": null
}
^12.16.0runtime
@wagmi/core
Environment
{
  "local_name": "@wagmi/core",
  "alias": false,
  "peer_metadata": null
}
^2.17.3runtime
lucide-react
Environment
{
  "local_name": "lucide-react",
  "alias": false,
  "peer_metadata": null
}
^0.493.0runtime
framer-motion
Environment
{
  "local_name": "framer-motion",
  "alias": false,
  "peer_metadata": null
}
^12.16.0runtime
@privy-io/wagmi
Environment
{
  "local_name": "@privy-io/wagmi",
  "alias": false,
  "peer_metadata": null
}
^1.0.4runtime
vite-plugin-dts
Environment
{
  "local_name": "vite-plugin-dts",
  "alias": false,
  "peer_metadata": null
}
^4.5.4runtime
isomorphic-fetch
Environment
{
  "local_name": "isomorphic-fetch",
  "alias": false,
  "peer_metadata": null
}
^3.0.0runtime
@0xsequence/hooks
Environment
{
  "local_name": "@0xsequence/hooks",
  "alias": false,
  "peer_metadata": null
}
^5.3.4runtime
@0xsequence/indexer
Environment
{
  "local_name": "@0xsequence/indexer",
  "alias": false,
  "peer_metadata": null
}
^2.3.9runtime
@privy-io/react-auth
Environment
{
  "local_name": "@privy-io/react-auth",
  "alias": false,
  "peer_metadata": null
}
^2.14.2runtime
@reown/appkit-common
Environment
{
  "local_name": "@reown/appkit-common",
  "alias": false,
  "peer_metadata": null
}
^1.7.9runtime
@tanstack/react-query
Environment
{
  "local_name": "@tanstack/react-query",
  "alias": false,
  "peer_metadata": null
}
^5.80.7runtime
@0xsequence/anypay-api
Environment
{
  "local_name": "@0xsequence/anypay-api",
  "alias": false,
  "peer_metadata": null
}
0.0.0runtime
@0xsequence/wallet-core
Environment
{
  "local_name": "@0xsequence/wallet-core",
  "alias": false,
  "peer_metadata": null
}
github:0xsequence/sequence.js#dists/wallet/coreruntime
@0xsequence/design-system
Environment
{
  "local_name": "@0xsequence/design-system",
  "alias": false,
  "peer_metadata": null
}
^2.1.6runtime
@0xsequence/anypay-relayer
Environment
{
  "local_name": "@0xsequence/anypay-relayer",
  "alias": false,
  "peer_metadata": null
}
0.0.0runtime
@0xsequence/wagmi-connector
Environment
{
  "local_name": "@0xsequence/wagmi-connector",
  "alias": false,
  "peer_metadata": null
}
^4.0.1runtime
@0xsequence/wallet-primitives
Environment
{
  "local_name": "@0xsequence/wallet-primitives",
  "alias": false,
  "peer_metadata": null
}
github:0xsequence/sequence.js#dists/wallet/primitivesruntime
viem
Environment
{
  "local_name": "viem",
  "alias": false,
  "peer_metadata": null
}
^2.30.6development
vite
Environment
{
  "local_name": "vite",
  "alias": false,
  "peer_metadata": null
}
^5.4.19development
turbo
Environment
{
  "local_name": "turbo",
  "alias": false,
  "peer_metadata": null
}
^2.5.4development
dotenv
Environment
{
  "local_name": "dotenv",
  "alias": false,
  "peer_metadata": null
}
^16.5.0development
vitest
Environment
{
  "local_name": "vitest",
  "alias": false,
  "peer_metadata": null
}
^3.2.1development
globals
Environment
{
  "local_name": "globals",
  "alias": false,
  "peer_metadata": null
}
^15.15.0development
postcss
Environment
{
  "local_name": "postcss",
  "alias": false,
  "peer_metadata": null
}
^8.5.4development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^5.8.3development
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^22.15.29development
tailwindcss
Environment
{
  "local_name": "tailwindcss",
  "alias": false,
  "peer_metadata": null
}
^4.1.8development
@types/react
Environment
{
  "local_name": "@types/react",
  "alias": false,
  "peer_metadata": null
}
^19.1.6development
autoprefixer
Environment
{
  "local_name": "autoprefixer",
  "alias": false,
  "peer_metadata": null
}
^10.4.21development
@types/react-dom
Environment
{
  "local_name": "@types/react-dom",
  "alias": false,
  "peer_metadata": null
}
^19.1.6development
@tailwindcss/postcss
Environment
{
  "local_name": "@tailwindcss/postcss",
  "alias": false,
  "peer_metadata": null
}
^4.1.8development
@vitejs/plugin-react
Environment
{
  "local_name": "@vitejs/plugin-react",
  "alias": false,
  "peer_metadata": null
}
^4.5.1development
@types/isomorphic-fetch
Environment
{
  "local_name": "@types/isomorphic-fetch",
  "alias": false,
  "peer_metadata": null
}
^0.0.39development
vite-plugin-css-injected-by-js
Environment
{
  "local_name": "vite-plugin-css-injected-by-js",
  "alias": false,
  "peer_metadata": null
}
^3.5.2development
react
Environment
{
  "local_name": "react",
  "alias": false,
  "peer_metadata": null
}
^19.0.0peer
wagmi
Environment
{
  "local_name": "wagmi",
  "alias": false,
  "peer_metadata": null
}
^2.15.5peer
react-dom
Environment
{
  "local_name": "react-dom",
  "alias": false,
  "peer_metadata": null
}
^19.0.0peer
@0xsequence/hooks
Environment
{
  "local_name": "@0xsequence/hooks",
  "alias": false,
  "peer_metadata": null
}
^5.3.4peer
@0xsequence/indexer
Environment
{
  "local_name": "@0xsequence/indexer",
  "alias": false,
  "peer_metadata": null
}
^2.3.9peer
@0xsequence/anypay-api
Environment
{
  "local_name": "@0xsequence/anypay-api",
  "alias": false,
  "peer_metadata": null
}
0.0.0peer
@0xsequence/design-system
Environment
{
  "local_name": "@0xsequence/design-system",
  "alias": false,
  "peer_metadata": null
}
^2.1.6peer
@0xsequence/anypay-relayer
Environment
{
  "local_name": "@0xsequence/anypay-relayer",
  "alias": false,
  "peer_metadata": null
}
0.0.0peer
@0xsequence/wagmi-connector
Environment
{
  "local_name": "@0xsequence/wagmi-connector",
  "alias": false,
  "peer_metadata": null
}
^4.0.1peer

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "64932a7643a2f266ecf101468ca969e26018a247",
  "tarball": "https://registry.npmjs.org/@0xsequence/anypay-sdk/-/anypay-sdk-0.0.1.tgz",
  "fileCount": 2514,
  "integrity": "sha512-a+HPz6Yk307+U813WLKaqhiRPmzeirrH9WIzKltVfaXrZLD0MnrFAUEG40E/a0K15uNHFySLNApBntFwkJMoDA==",
  "signatures": [
    {
      "sig": "MEQCIFbIjEfP46wCVry4Wc8uDw6zL74ty8p0o2ZV+c2VKNEUAiBRJB4OzGvl/TRoE2HbL4V1qAcdynMzS1t5yi2AzGAPwg==",
      "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
    }
  ],
  "unpackedSize": 28271531
}

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 09:51 UTC

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

Record identity

package_version:e0ed483afebb0479888ce36c83544b3e66e5b665ec43191f4ac4cc51112ce6c8

Other collected versions

0.0.524 Jun0.0.423 Jun0.0.323 Jun0.0.219 Jun0.0.019 JunView all collected versions →