Skip to content

Commit

Permalink
trigger billing on pin minting (#1593)
Browse files Browse the repository at this point in the history
  • Loading branch information
FBalint authored Jan 10, 2025
1 parent 2ab5347 commit f7a2a0d
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { consts } from "@guildxyz/types"
import { useMembershipUpdate } from "components/[guild]/JoinModal/hooks/useMembershipUpdate"
import useGuild from "components/[guild]/hooks/useGuild"
import { env } from "env"
import { useFetcherWithSign } from "hooks/useFetcherWithSign"
import useShowErrorToast from "hooks/useShowErrorToast"
import useSubmit from "hooks/useSubmit"
import { useToastWithShareButtons } from "hooks/useToastWithShareButtons"
Expand Down Expand Up @@ -199,6 +200,22 @@ const useMintGuildPin = () => {
title: "Successfully minted Guild Pin!",
shareText: `Just minted my Guild Pin for joining ${name}!\nguild.xyz/${urlName}`,
})

createPurchase(hash)
}

const fetcherWithSign = useFetcherWithSign()

const createPurchase = (txHash: string) => {
fetcherWithSign([
`/v2/users/${address}/orders/verify`,
{
body: {
txHash: txHash,
chainId,
},
},
])
}

return {
Expand Down

0 comments on commit f7a2a0d

Please sign in to comment.