Skip to content
This repository was archived by the owner on Nov 15, 2021. It is now read-only.
This repository was archived by the owner on Nov 15, 2021. It is now read-only.

Create (raw) Transaction builder class #886

@ixje

Description

@ixje

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 Transactions 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 TransactionOutputs (ref) using script hashes and alike. Instead we could support an API like contract_tx.set_destination_addr("neo address")
  • support loading raw TX's and inspection
  • support TX validation e.g.
    • check that CertUrl, DescriptionUrl, Description, Remark series do not exceed 255 chars (see docs)
    • check that ContractHash, ECDH series, Hash series does not exceed 32 bytes (see docs)
    • check that there are no more than 16 attributes per TX (ref)
    • check that the maximum TX size is not exceeded (ref)

For the first iteration we should only support the following transactions

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions