Open bpierre opened 4 years ago
Woow, thanks a lot for doing this write-up. It makes things so much clear and easy to go ahead and be more confident in what we need to implement 🙏
First a few small nitpicks:
Intent
section. I think the example is doing await org.appIntent
but if I understood correctly now that should be await org.intent
.ForwardingPathDescription
section. When you explain the types, maybe the ForwardingPathDescriptionTreeEntry
should be ForwardingPathDescriptionEntry
? Or I'm missing something there 🤔I would like to start working on a first draft of the second item on the TODO list 🙋♂️
Finally would like if we could further sync on the 3rd and 4th items. Would like us to be a bit more specific on these ones. For example, what are the missing pieces until we consider we can check: "Finalize the path builder API".
This issue will keep track of the planned changes regarding the intents, forwarding paths and transactions.
These changes are aiming to improve / solve the following:
[1] This is why the term “Forwarding Path” is now preferred to “Transaction Path”.
Current Status
Going forward we'll use a milestone to keep track of the progress: https://github.com/aragon/connect/milestone/1
Storing the signing address in the connection context
The idea here is to attach a default address to the connection context. This address will get used by the methods generating forwarding paths and transaction requests. It will be possible to override it at any point.
It could be passed to
connect()
:It should also be possible to update it without resetting the connection. A new method on
Organization
could help doing that:Reshaping the intent-to-transaction flow
ForwardingPath
AppIntent
andTransactionPath
.Organization
andApp
(e.g.App#exec()
).new
).New
App
methods:exec()
andexecPaths()
The two initial methods returning
ForwardingPath
instances areApp#exec()
(to get the shortest path) andApp#execPaths()
(to get all the possible paths).Address
This is a type we could use for documentation purposes.
AppOrAddress
This type accepts an
App
instance or its address, and should get used whenever possible rather than an address only.ForwardingPathDeclaration
This type allows to express a forwarding path in a simplified, but limited way: it is not possible to nest the forwarding actions.
Transaction
Transaction
replacesTransactionRequest
, and is now a type rather than a class. It describes a subset of theeth_sendTransaction
parameters in the Ethereum JSON-RPC API.ForwardingPathDescription
This object contains all the information needed to render the description of a forwarding path. It gets returned by
ForwardingPath#describe()
.Forwarding Path Builder
Forwarding Path Declaration Syntax
Paths can be complex and defining them using JS structures might not provide a level of clarity that is sufficient. Having a dedicated syntax could improve that.
Using tagged templates could make it possible to integrate our existing object types into it,
App
andIntent
in particular.Initial draft:
In this example,
?
would express a part that need to be filled by the library, if possible.Note: this draft is only used to express the idea, its syntax will probably be different.
Path Builder Utility
Using the language previously mentioned above, we could also provide a forwarding path builder. This tool would let users edit a forwarding path after its initial creation.
We could imagine an initial implementation accepting the same JS structure than the one returned by
path\
``.Initial draft:
Note: this draft is only used to express the idea, its syntax will probably be different.