-
Notifications
You must be signed in to change notification settings - Fork 188
Create (raw) Transaction builder class #886
Description
This is a TODO for a project (see side bar)
As part of the Lightweight SDK API we would like to have a class that eases creation of (raw) transactions. A raw transaction can be understood as a serialised Transaction
that can be send to the network via a RPC node or directly on the TCP network.
The available Transaction
s and their possible attributes are described in the documentation. There are 2 existing examples on how to manually build raw transactions in python here. From that code you can see there is enough room to simplify this for the end user. e.g. adding a description attribute to the transaction is currently done as follows
contract_tx.Attributes.append(TransactionAttribute(usage=TransactionAttributeUsage.Description, data="My raw contract transaction description"))
a simplified interface could be
contract_tx.addDescription("My raw contract transaction description")
Some ideas:
- simplify adding TX attributes (see example above)
- simplify setting transaction destinations. Currently you have to create
TransactionOutput
s (ref) using script hashes and alike. Instead we could support an API likecontract_tx.set_destination_addr("neo address")
- support loading raw TX's and inspection
- support TX validation e.g.
For the first iteration we should only support the following transactions
- ClaimTransaction - for claiming GAS
- ContractTransaction - for sending NEO/GAS
- InvocationTransaction - for interacting with smart contracts