@evefrontier/dapp-kit
v0.1.2
Published
React SDK for EVE Frontier dApps on Sui
Keywords
Readme
@evefrontier/dapp-kit
React SDK for building EVE Frontier dApps on the Sui blockchain.
Full API documentation (TypeDoc): http://sui-docs.evefrontier.com/
Install
pnpm add @evefrontier/dapp-kit
# peer deps
pnpm add @tanstack/react-query reactKeep your app’s versions of react, @mysten/dapp-kit-react, and @mysten/sui in sync with the versions used by this package to avoid type or runtime mismatches. Check
package.jsonfor the current ranges.
Quick start
- Wrap your app with
EveFrontierProvider(requires aQueryClient). - Use
useConnection,useSmartObject,useNotification, anduseSponsoredTransactionas needed.
import { EveFrontierProvider, useConnection, useSmartObject } from "@evefrontier/dapp-kit";
import { QueryClient } from "@tanstack/react-query";
const queryClient = new QueryClient();
function App() {
return (
<EveFrontierProvider queryClient={queryClient}>
<MyDapp />
</EveFrontierProvider>
);
}
function MyDapp() {
const { isConnected, handleConnect } = useConnection();
const { assembly, loading } = useSmartObject();
if (!isConnected) return <button onClick={handleConnect}>Connect</button>;
if (loading) return <div>Loading...</div>;
return <div>{assembly?.name}</div>;
}Configure assembly via env (VITE_OBJECT_ID, as Sui Object ID) or URL (?itemId=...&tenant=..., derived).
More
Hooks, types, GraphQL helpers, utilities, and wallet APIs are documented at http://sui-docs.evefrontier.com/.
License
MIT
