Skip to content
TuwaIOPublic

About

The official server-side Node.js & Edge SDK for the TUWA Ecosystem, featuring built-in React authentication bridges.

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

171 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

TUWA SDK

License Build Status

TUWA SDK

The TUWA SDK is the shortest way to use TUWA in a React app. @tuwaio/sdk re-exports the client packages of Orbit Utils, Pulsar, Satellite Connect, SIWX and Nova UI Kit under subpaths, and its add-ons @tuwaio/evm-sdk and @tuwaio/solana-sdk add the chains your app uses. Payments are a module of their own on top of it, @tuwaio/payments-sdk, in Quasar Client.

πŸ“– Documentation: sdk.docs.tuwa.io


πŸ›οΈ Ecosystem Layer Architecture

TUWA is built in stages. The SDK is Stage 5 (SDK Integration): it adds no logic of its own and packages the client projects of the stages below it β€” Orbit Utils and SIWX, Satellite Connect and Pulsar, Nova UI Kit.

Layer 8: SDK (L8)

  • @tuwaio/sdk: Orbit, Pulsar, Satellite Connect, SIWX and Nova UI Kit under subpaths (@tuwaio/sdk/pulsar, @tuwaio/sdk/nova-connect, …) and the Nova stylesheets. The TUWA packages are dependencies; peer dependencies: react, react-dom.

Layer 9: Chain add-ons (L9)

  • @tuwaio/evm-sdk: the EVM packages of Orbit, Satellite Connect, Pulsar, SIWX and Nova Connect. Peer dependencies: @tuwaio/sdk, @wagmi/core, viem.
  • @tuwaio/solana-sdk: the Solana packages of the same projects. Peer dependencies: @tuwaio/sdk, @solana/kit and the @wallet-standard packages.

πŸ”§ Monorepo Structure

sdk/
β”œβ”€β”€ apps/
β”‚   └── docs/                   # sdk.docs.tuwa.io (Next.js 16 + Nextra 4)
β”‚       β”œβ”€β”€ src/content/        # Introduction (MDX) + generated `packages/` pages
β”‚       └── package-pages/      # Packages overview page, page script and sidebar templates
β”œβ”€β”€ packages/
β”‚   β”œβ”€β”€ sdk/                    # L8: re-exports of the TUWA client packages and the Nova stylesheets
β”‚   β”œβ”€β”€ evm-sdk/                # L9: re-exports of the EVM packages
β”‚   └── solana-sdk/             # L9: re-exports of the Solana packages

πŸ’Ύ Installation

# React app
pnpm add @tuwaio/sdk react react-dom

# EVM chains
pnpm add @tuwaio/evm-sdk @wagmi/core viem

# Solana
pnpm add @tuwaio/solana-sdk @solana/kit

pnpm (8 and later), npm (7 and later) and Bun also install the Wallet Standard peers of @tuwaio/solana-sdk (@wallet-standard/app, base, features, react, ui and ui-registry); with Yarn, add them to the command.


πŸš€ Architectural Usage Example

The providers of a React app with EVM and Solana wallets and a connect button:

'use client';

import { EVMConnectorsWatcher } from '@tuwaio/evm-sdk/nova-connect';
import { satelliteEVMAdapter } from '@tuwaio/evm-sdk/satellite';
import { NovaConnectProvider } from '@tuwaio/sdk/nova-connect';
import { ConnectButton } from '@tuwaio/sdk/nova-connect/components';
import { SatelliteConnectProvider } from '@tuwaio/sdk/satellite';
import { SolanaConnectorsWatcher } from '@tuwaio/solana-sdk/nova-connect';
import { satelliteSolanaAdapter } from '@tuwaio/solana-sdk/satellite';
import { createConfig, http, injected } from '@wagmi/core';
import type { ReactNode } from 'react';
import { mainnet } from 'viem/chains';

const appChains = [mainnet] as const;
const solanaRPCUrls = { devnet: 'https://api.devnet.solana.com' };
const wagmiConfig = createConfig({ chains: appChains, connectors: [injected()], transports: { [mainnet.id]: http() } });
const adapters = [satelliteEVMAdapter(wagmiConfig, appChains), satelliteSolanaAdapter({ rpcUrls: solanaRPCUrls })];

export function Providers({ children }: { children: ReactNode }) {
  return (
    <SatelliteConnectProvider adapter={adapters} autoConnect>
      <EVMConnectorsWatcher wagmiConfig={wagmiConfig} />
      <SolanaConnectorsWatcher />
      <NovaConnectProvider appChains={appChains} solanaRPCUrls={solanaRPCUrls}>
        <ConnectButton />
        {children}
      </NovaConnectProvider>
    </SatelliteConnectProvider>
  );
}

Transaction tracking, SIWX sign-in and Quasar sync are added in the Full-Stack React guide.


πŸ› οΈ Development

pnpm install                          # installs dependencies and builds all packages
pnpm build                            # builds packages with tsup (ESM, CJS, types) and copies the Nova stylesheets
pnpm test                             # runs vitest in every package
pnpm lint                             # runs ESLint
pnpm docs:gen                         # regenerates the Packages pages in apps/docs
pnpm --filter @tuwaio/sdk-docs dev    # runs the docs site locally

The Packages pages are regenerated by the pre-commit hook: the page of each package is its README. The tests of @tuwaio/evm-sdk and @tuwaio/solana-sdk import the built @tuwaio/sdk: run pnpm build after changing it.


🀝 Contribution & Auditing

Please review our ecosystem Contribution Guidelines.

πŸ“„ License

Licensed under the Apache-2.0 License. See the LICENSE file for details.

About

The official server-side Node.js & Edge SDK for the TUWA Ecosystem, featuring built-in React authentication bridges.

Resources

Code of conduct

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages