This repo is a simple example of implementing Safe-Cex into your React application
- Edit
API_KEY
andAPI_SECRET
fromcomponents/with-exchange.component.tsx
- Start a terminal and run
$ npm run dev
- Open in your browser: http://localhost:3000
- Check file
pages/index.tsx
<WithExchangeComponent>
{(exchange) => <HomeComponent exchange={exchange} />}
</WithExchangeComponent>
- Check file
components/home.component.tsx
import { useSnapshot } from "@iam4x/valtio";
const Component = () => {
const snap = useSnapshot(exchange.store);
return <div>{JSON.stringify(snap.balance, null, 4)}</div>;
};