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
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.
@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.
@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/kitand the@wallet-standardpackages.
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
# 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/kitpnpm (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.
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.
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 locallyThe 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.
Please review our ecosystem Contribution Guidelines.
Licensed under the Apache-2.0 License. See the LICENSE file for details.
