0.0.7 • Published 8 months ago

@easya/layer-ui-react v0.0.7

Weekly downloads
-
License
-
Repository
-
Last release
8 months ago

@easya/layer-ui-react

A React component library for building blockchain applications with ease, focusing on XRPL integration (more coming soon).

Features

  • 🔗 Seamless blockchain connectivity
  • 💰 Token management components
  • 🎨 Dark/Light mode support
  • 🔐 Wallet integration
  • 📊 Balance display components
  • 🔄 Transaction handling

Installation

npm install @easya/layer-ui-react
# or
yarn add @easya/layer-ui-react

Quick Start

import { BlockchainProvider, ConnectButton } from '@easya/layer-ui-react';

const config = {
  network: 'testnet',
  blockchain: 'xrpl',
  wallet: 'crossmark'
};

function App() {
  return (
    <BlockchainProvider config={config}>
      <ConnectButton />
    </BlockchainProvider>
  );
}

Core Components:

  • BlockchainProvider - Provides blockchain context to all components
  • ConnectButton - Button to connect/disconnect wallet
  • AddressDisplay - Shows wallet address
  • BalanceDisplay - Shows XRP balance
  • BalancesDisplay - Shows all token balances
  • TransactionForm - Send tokens/XRP
  • IssueTokenForm - Create new fungible tokens
  • TrustLineForm - Create token trust lines

Setup

  1. create a react app: npm create vite@latest your-project-name -- --template react

  2. cd your-project-name

  3. npm install
  4. npm i @easya/layer-ui-react
  5. now, we can start using it! update App.jx content to:
import { BlockchainProvider, ConnectButton } from '@easya/layer-ui-react';

const config = {
  network: 'testnet',
  blockchain: 'xrpl',
  wallet: 'crossmark'
};

function App() {
  return (
    <BlockchainProvider config={config}>
      <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', height: '100vh' }}>
        <ConnectButton />
      </div>
    </BlockchainProvider>
  );
}

export default App;
  1. npm run dev

Setup a full functional sample

  1. clone the starter repo

https://github.com/EasyA-Tech/easya-layer-starter-react

  1. npm install
  2. npm start

  3. You can now start modifing the starter app

0.0.7

8 months ago

0.0.6

8 months ago

0.0.5

8 months ago

0.0.4

8 months ago

0.0.3

8 months ago

0.0.2

8 months ago

0.0.1

8 months ago