Compare commits

...

1 Commits

Author SHA1 Message Date
Jordan Frankfurt
67c776c995 fix(merkle drop): make claim a post request 2021-03-18 01:46:11 -04:00

View File

@@ -29,18 +29,16 @@ function fetchClaim(account: string, chainId: ChainId): Promise<UserClaimData |
return (CLAIM_PROMISES[key] = return (CLAIM_PROMISES[key] =
CLAIM_PROMISES[key] ?? CLAIM_PROMISES[key] ??
fetch(`https://gentle-frost-9e74.uniswap.workers.dev/${chainId}/${formatted}`) fetch('https://merkle-drop-1.uniswap.workers.dev/', {
.then(res => { body: JSON.stringify({ chainId, address: formatted }),
if (res.status === 200) { headers: {
return res.json() 'Content-Type': 'application/json',
} else { 'Referrer-Policy': 'no-referrer'
console.debug(`No claim for account ${formatted} on chain ID ${chainId}`) },
return null method: 'POST'
} })
}) .then(({ ok, json }) => (ok ? json() : console.log(`No claim for account ${formatted} on chain ID ${chainId}`)))
.catch(error => { .catch(error => console.error('Failed to get claim data', error)))
console.error('Failed to get claim data', error)
}))
} }
// parse distributorContract blob and detect if user has claim data // parse distributorContract blob and detect if user has claim data