In both cases I’m setting the timestamp variable to null …which to my understanding means I should get the latest price yes? Is this true for both crypto and forex?
I’ve also tried using timestamps now and recently but still get errors. I’ve made sure my environment is timesync’ed to the correct time. Any ideas?
I just ran the xrc_demo project with a hardcoded USD/EUR asset pair against the exchange rate canister running on mainnet (uf6dk-hyaaa-aaaaq-qaaaq-cai) and everything worked fine.
When you say that you’re “calling XRC locally in development”, does that mean that you have your own instance of the XRC running? In that case, it is possible that you see this error because the XRC fetches daily forex only a few times a day, so a freshly installed XRC simply doesn’t have any forex rates yet.
@icplonger do you mean a workaround to make the XRC work? Or a workaround just by not using the XRC and fetching the exchange rate in other ways? Could you share more details about the workaround you found?
What version of dfx are you using? IIRC, there were issues in prior versions when connecting to IPv4 addresses with HTTPS outcalls. The vast majority of foreign exchange sources use only IPv4.
When the XRC canister is initially installed, it should reach out to all foreign exchanges and update the internal store. This should allow you to successfully retrieve a rate. There is one potential issue remaining. There is a time zone check in the XRC.
At the moment, the only way to turn off the time zone check is with a feature flag when compiling the wasm. Setting this value to yes will disable the timezone check. You could compile and then install the wasm.