I’m not exactly sure how to call create: (text, nat32) however from javascript. calling it with a number or Nat32.encodeValue(1) didn’t work. The type signature in motoko is.
public func create(title: Text, hash: Word32) : async ?Prediction
When looking at the Candid documentation page: I see a TODO under the header.
“Use Candid for a JavaScript front-end”
The link that is in there refering to a github repository gives a 404.
Am I supposed to see my create: (text, nat32) → (opt Prediction), getAllPredictions: () → (vec Prediction), revealPrediction: (text) → (bool) functions in the candid UI?
Calling getAllPredictions() in my frontend code correctly gives back an empty array. I currently only see a retrieve(), authorize(), list() and store() functions when I go to the candid UI (currently on 0.6.21)
Edit: nvm calling create with just a normal number seems have worked I think none the less interacting with these functions through the candid UI would be great if that is what is supposed to happen.
even though when I call the functions from the frontend they do seem to work.
EDIT: nvm figured it out. you have to use the motoko canister ID not the frontend canister id
EDIT2: It seems that the random button only uses random values for values that are not already filled in. This fact could probably be improved with some visual feedback e.g filling in the random values in the input field with a light grey or something