Smart Account SDK
A React hook for managing smart accounts on Differeent Chains using Privy, JiffyPaymaster, and Permissionless.
- Smart Account Management: Initialize and manage smart accounts seamlessly.
- Chain Selection: Switch between different blockchain networks.
- User Operation Hash Fetching: Retrieve user operation hashes with retry logic.
- Integration with Privy and Wagmi: Simplify wallet interactions.
To install the SDK, use npm or yarn:
npm install jiffy-hooks
or
yarn install jiffy-hooks
// ExampleComponent.tsx
import React from 'react';
import { useSmartAccount } from '../src/hooks/useSmartAccount';
const ExampleComponent: React.FC = () => {
const {
isConnected,
smartAccountClient,
handleChainChange,
selectedChain,
fetchUserOperationHash,
} = useSmartAccount();
return (
<div>
{isConnected ? (
<div>
<h1>Connected to {selectedChain.name}</h1>
{/* Chain selection logic */}
<select onChange={handleChainChange}>
{/* Options here */}
</select>
{/* Use smartAccountClient or fetchUserOperationHash as needed */}
</div>
) : (
<h1>Please connect your wallet</h1>
)}
</div>
);
};
export default ExampleComponent;