#Why are requests and handlers not exposed in SnarkyJS?

7 messages · Page 1 of 1 (latest)

quaint yoke
#

.

vague ermine
#

I think we answered this in office hours?

tribal zodiac
#

@quaint yoke The question that I'd have is -- should they be exposed? (Or recreated on the JS side) I think they offer a fairly clean/robust, but somewhat cumbersome way to get values from outside anywhere into the circuit. They same can be done in a variety of other ways, which feel more brittle or "ad hoc". We actually have created some of these ad hoc solutions for snarkyjs internal use.

#

Spinning this further, maybe an API that would fit in with how smart contract methods are written, and feels JS-native, is to pass a callback into the method for every handler? We could support that with a new custom "Callback" Struct

quaint yoke
#

@tribal zodiac I think requests and handlers are technically more powerful.

#

Not sure though.

#

You can at the very least easily change what private inputs you take.