A super-fast, lightweight library for interacting with Cardano CIP-30 wallets. Supports native browser and React contexts.
import { FC } from "react";
import { WalletObserverProvider, RenderWallet } from "@sundaeswap/wallet-lite";
const App: FC = () => {
return (
<RenderWallet render={(state) => (
return <p>{state.adaBalance.value.toString()}</p>
)} />
)
}
const Root: FC<PropsWithChildren> = ({ children }) => {
return (
<WalletObserverProvider>
{children}
</WalletObserverProvider>
)
}
const target = document.querySelector("#app");
if (target) {
const root = createRoot(target);
root.render(<Root><App/></Root>);
}
- Clone the repository locally.
- Run
bun install
- In a terminal, run
cd lib && bun watch
to enter development mode for the library. - In a separate terminal, run
cd dev && bun start
to load a React UI for testing.
- Run
bun test
,bun test --watch
, orbun test --coverage
.