0

I'm getting the error Missing private variable string_of_nat Is it not possible to use private lambdas within off_chain_views? What could I do if I want to use them here?

https://smartpy.io/ide?cid=QmTzqbNsLWSEnW2LtcRY5VjhauKJ4mSR57xvvj2SimZ6ks&k=ec28b8aa14ccfcdc3726

I ended up needing a private lambda because I'm needing to call a function that uses a local variable from an offchain view as described on this question Declaration Error: Variable name "x" already in use

I need a function that uses a local variable on an offchain view because I'm dynamically loading tokens' metadata on its respective offchain view.

1 Answer 1

1

Private variables are not allowed in views.

You can define a lambda with sp.build_lambda(…). You can put it in a local variable or not.

1
  • Thank you. I'll try it out.
    – JJJ
    Feb 17 at 1:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.