neo-one-suite / neo-one

The One for easy, fast, & fun NEO app development.
https://neo-one.io
MIT License
93 stars 34 forks source link

Add `Noficiations.from()` builtin and API #2494

Open spencercorwin opened 3 years ago

spencercorwin commented 3 years ago

We should probably add a way to get arbitrary notifications from any contract with something like Notifications.from(Address.from(<address-string>)) which will return an array of builtin Notifications for the smart contract to parse for whatever logic. This is somewhat difficult and complex.

spencercorwin commented 3 years ago

Look at how we use interfaces as generics in SmartContract.for<T>() in the compiler to do something similar with notifications. If the user knows what a notification's structure will be when we can have them define that with an interface that is passed into something like Notification.for<T>(address). That way we don't have to define every possible stack item in the compiler, which seems non-sensical