Trouble viewing OpenChat User Canister API in Candid UI

Hello! I am trying to explore my OpenChat User canister using Candid UI but I am failing and not sure why. The UI I’m using is https://a4gq6-oaaaa-aaaab-qaa4q-cai.raw.ic0.app.

The steps I’m using are as follows:

  1. Visit Candid UI - https://a4gq6-oaaaa-aaaab-qaa4q-cai.raw.ic0.app
  2. Enter my canister id, found in Profile Settings on OpenChat
  3. Select the candid file from my local OpenChat repo at backend/canisters/user/api/can.did
  4. Click “Go”

I would expect to be able to see the available query and update calls but instead I see

An error happened in Candid canister:
Error: Cannot fetch candid file
    at fetchActor (https://a4gq6-oaaaa-aaaab-qaa4q-cai.raw.ic0.app/index.js:2:319660)
    at async https://a4gq6-oaaaa-aaaab-qaa4q-cai.raw.ic0.app/index.js:2:329683

I feel like this should be possible. Is there anything I’m missing?

can.did contains an import of another did file: open-chat/backend/canisters/user/api/can.did at master · open-chat-labs/open-chat · GitHub. Currently, we don’t take did file with local imports.

You can manually flatten that import and use it in Candid UI, but I think the best way to ask OpenChat to embed the did file in the canister metadata, so that Candid UI can fetch it without providing a did file.

Of course! If only I just opened the candid file :sweat_smile:. Flattened the imports and things are working :raised_hands:

I’ll open up an issue on the OpenChat GH around including the did file in the canister metadata.
Thank you very much!