Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v12.18.3
22.9.0
4 changes: 4 additions & 0 deletions src/hooks/useReferralSignature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ export function useReferralSignature(affiliateAddress: string): {
state: ReferralSignatureState.VALID,
callback: async function onReferralSignature(): Promise<string> {
try {
if (account === affiliateAddress) {
throw new Error("Cannot refer yourself")
}

let validationResponse = await fetch(`${REFERRAL_API}/affiliates/${affiliateAddress}`)
if (!validationResponse.ok) {
throw new Error('Failed to validate affiliate address')
Expand Down