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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@paraport/react

v0.1.12

Published

React components for Paraport SDK

Readme

@paraport/react

React components for seamless integration of ParaPort cross-chain teleportation functionality.

Installation

pnpm add @paraport/react polkadot-api

Install Peer Dependencies

ParaPort React requires polkadot-api and React in your application. Install the required peers:

# React peer dependencies
pnpm add react react-dom

# Required peer dependency
pnpm add polkadot-api

Build

  • Prerequisites: build @paraport/static, @paraport/core, @paraport/vue, and @paraport/sdk first
  • From repo root:
    • pnpm --filter @paraport/static build
    • pnpm --filter @paraport/core build
    • pnpm --filter @paraport/vue build
    • pnpm --filter @paraport/sdk build
    • pnpm --filter @paraport/react build

Topological order across packages:

  • @paraport/static@paraport/core@paraport/vue@paraport/sdk@paraport/react

See TESTING.md for end-to-end build and test flow.

Component Usage

Basic Integration

import React, { useCallback } from 'react';
import { Paraport } from '@paraport/react';
import '@paraport/react/style';

const App = () => {
  const address = 'YOUR_ADDRESS';
  const amount = '10000000000';
  const chain = 'AssetHubPolkadot';
  const asset = 'DOT';
  const label = 'Mint';

  // Required signer (polkadot-api compatible)
  const getSigner = useCallback(async () => {
    const { connectInjectedExtension } = await import('polkadot-api/pjs-signer')
    const ext = await connectInjectedExtension('talisman', 'Your App')
    const account = ext.getAccounts()[0]
    return account.polkadotSigner
  }, [])

  const handleReady = useCallback((session) => {
    console.log('🚀 ParaPort ready!', session);
  }, []);

  const handleSubmit = useCallback(({ autoteleport, completed }) => {
    console.log('📦 Submit button pressed');
    console.log('💥 Autoteleport: ', autoteleport);
    console.log('✅ Completed: ', completed);
  }, []);

  const handleCompleted = useCallback(() => {
    console.log('✅ Auto-teleport successfully completed!');
  }, []);

  const handleAddFunds = useCallback(() => {
    console.log('💰 Add funds button pressed');
  }, []);

  return (
    <Paraport
      address={address}
      amount={amount}
      chain={chain}
      asset={asset}
      label={label}
      getSigner={getSigner}
      onReady={handleReady}
      onSubmit={handleSubmit}
      onCompleted={handleCompleted}
      onAddFunds={handleAddFunds}
    />
  );
};

export default App;

Optional: custom endpoints

import { Paraport } from '@paraport/react'
import '@paraport/react/style'
<Paraport
  address={address}
  amount="10000000000"
  chain="AssetHubPolkadot"
  asset="DOT"
  endpoints={{ AssetHubPolkadot: ['wss://statemint.api.onfinality.io/public-ws'] }}
  getSigner={getSigner}
/>

Theming

  • Import SDK CSS once (already included via @paraport/react/style).
  • Pass appearance for per-instance token overrides and themeMode if needed.
<Paraport
  appearance={{ '--radius': '12px', '--accent-blue': '#4f46e5' }}
  themeMode="auto" // 'light' | 'dark' | 'auto'
  {...otherProps}
/>

Props Documentation

ParaportProps

| Property | Type | Description | |----------|------|-------------| | address | string | User's address | | amount | string | Amount to be transferred | | chain | string | Chain ID (e.g., 'AssetHubPolkadot') | | chains | string[] | Optional list of allowed chains to scope routing/UX | | asset | string | Asset ID | | endpoints | Record<string, string[]> | Optional RPC endpoints per chain to override defaults | | getSigner | () => Promise | Required function returning a polkadot-api signer | | label | string | Button display text | | logLevel | string | Log level for debugging (e.g., 'DEBUG') | | onSubmit | Function | Callback on form submission with { autoteleport, completed } parameters | | onCompleted | Function | Callback on successful teleport | | onReady | Function | Callback when UI is ready for interaction, receives session object | | onAddFunds | Function | Callback when user clicks to add funds |

License

MIT