Use Tip Post Action Hook
A hook for tipping Lens Posts using the Lens React SDK.
This hook allows users to tip a post using a specified payment source and amount.
Installation
Usage
import { useTipPostAction } from "@/hooks/use-tip-post-action";
import { usePost, useSessionClient, PaymentSource, postId } from "@lens-protocol/react";
const { data: sessionClient } = useSessionClient();
const { data: walletClient } = useWalletClient();
const { execute: tipPost } = useTipPostAction({ sessionClient, walletClient });
const post = postId("SOME_POST_ID");
const res = await tipPost({
post,
source: PaymentSource.Signer,
amount: "1.0",
tokenAddress: NativeToken
});
// See https://lens.xyz/docs/protocol/best-practices/error-handling
// on how to handle ResultAsync responses