Commit 67c776c9 authored by Jordan Frankfurt's avatar Jordan Frankfurt Committed by GitHub

fix(merkle drop): make claim a post request

parent 719754c4
......@@ -29,18 +29,16 @@ function fetchClaim(account: string, chainId: ChainId): Promise<UserClaimData |
return (CLAIM_PROMISES[key] =
CLAIM_PROMISES[key] ??
fetch(`https://gentle-frost-9e74.uniswap.workers.dev/${chainId}/${formatted}`)
.then(res => {
if (res.status === 200) {
return res.json()
} else {
console.debug(`No claim for account ${formatted} on chain ID ${chainId}`)
return null
}
})
.catch(error => {
console.error('Failed to get claim data', error)
}))
fetch('https://merkle-drop-1.uniswap.workers.dev/', {
body: JSON.stringify({ chainId, address: formatted }),
headers: {
'Content-Type': 'application/json',
'Referrer-Policy': 'no-referrer'
},
method: 'POST'
})
.then(({ ok, json }) => (ok ? json() : console.log(`No claim for account ${formatted} on chain ID ${chainId}`)))
.catch(error => console.error('Failed to get claim data', error)))
}
// parse distributorContract blob and detect if user has claim data
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment