Returns
createSolanaAccount()
Returns
Promise<string>
function useCreateSolanaAccount(): {
createSolanaAccount: () => Promise<string>;
};
{
createSolanaAccount: () => Promise<string>;
}
createSolanaAccount: () => Promise<string>;
Promise<string>
import { useCreateSolanaAccount } from '@coinbase/cdp-hooks';
function MyComponent() {
const { createSolanaAccount } = useCreateSolanaAccount();
const handleCreateAccount = async () => {
try {
const account = await createSolanaAccount();
console.log('Solana account created:', account);
} catch (error) {
console.error('Failed to create Solana account:', error);
}
};
return <button onClick={handleCreateAccount}>Create Solana Account</button>;
}
Was this page helpful?