Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fetchContractDataMapEntry fails with JSON error #85

Open
dantrevino opened this issue Mar 2, 2022 · 0 comments
Open

fetchContractDataMapEntry fails with JSON error #85

dantrevino opened this issue Mar 2, 2022 · 0 comments

Comments

@dantrevino
Copy link

  const lookup_key = { "key": cvToHex(uintCV(asset_id)) }
  
  const mapEntry = await fetchContractDataMapEntry({
    url: network.getCoreApiUrl(),
    contract_name,
    contract_address,
    map_name,
    lookup_key
  });

fails with SyntaxError: Unexpected end of JSON input at line 0, col 0

Not sure if this is my lookup_key, but it appears that the body being sent to the api is not being set as application/json.

const body = lookup_key;
const path = generateUrl(
`${v2Endpoint(url)}/map_entry/${contract_address}/${contract_name}/${map_name}`,
{ proof: proof, tip: tip }
);
return fetchJsonPost<MapEntryResponse>(path, { body });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant